Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-07-13Clang Tidy: enable readability-non-const-parameter warningJacques Lucke
Clang Tidy reported a couple of false positives. I disabled those `NOLINTNEXTLINE`. Differential Revision: https://developer.blender.org/D8199
2020-06-03GPUMaterial: Add support for different sampler state per image samplerClément Foucault
This bridge between the new sampler state support from GPUTexture and draw material handling. The Sampler State is just the one from the texture for now. No change in logic.
2020-06-02EEVEE: Refactor of eevee_material.cClément Foucault
These are the modifications: -With DRW modification we reduce the number of passes we need to populate. -Rename passes for consistent naming. -Reduce complexity in code compilation -Cleanup how renderpass accumulation passes are setup, using pass instances. -Make sculpt mode compatible with shadows -Make hair passes compatible with SSS -Error shader and lookdev materials now use standalone materials. -Support default shader (world and material) using a default nodetree internally. -Change BLEND_CLIP to be emulated by gpu nodetree. Making less shader variations. -Use BLI_memblock for cache memory allocation. -Renderpasses are handled by switching a UBO ref bind. One major hack in this patch is the use of modified pointer as ghash keys. This rely on the assumption that the keys will never overlap because the number of options per key will never be bigger than the pointed struct. The use of one single nodetree to support default material is also a bit hacky since it won't support concurent usage of this nodetree. (see EEVEE_shader_default_surface_nodetree) Another change is that objects with shader errors now appear solid magenta instead of shaded magenta. This is only because of code reuse purpose but could be changed if really needed. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D7642
2020-03-18Objects: Eevee and workbench rendering of new Volume, Hair, PointCloudBrecht Van Lommel
Only the volume drawing part is really finished and exposed to the user. Hair plugs into the existing hair rendering code and is fairly straightforward. The pointcloud drawing is a hack using overlays rather than Eevee and workbench. The most tricky part for volume rendering is the case where each volume grid has a different transform, which requires an additional matrix in the shader and non-trivial logic in Eevee volume drawing. In the common case were all the transforms match we don't use the additional per-grid matrix in the shader. Ref T73201, T68981 Differential Revision: https://developer.blender.org/D6955
2020-03-11Eevee: internal support for arbitrary number of volume gridsBrecht Van Lommel
This has no user visible impact yet since smoke volumes only support a fixed set of attributes, but will become important with the new volume object. For GPU shader compilation, volume grids are now handled separately from image textures. They are somewhere between a vertex attribute and an image texture, basically an attribute that is stored as a texture. Differential Revision: https://developer.blender.org/D6952
2020-03-11Smoke: put density/color in separate textures, fixes for workbench shaderBrecht Van Lommel
This is more in line with standard grids and means we don't have to make many special exceptions in the upcoming change for arbitrary number of volume grids support in Eevee. The workbench shader was also changed to fix bugs where squared density was used, and the smoke color would affect the density so that black smoke would be invisible. This can change the look of smoke in workbench significantly. When using the color grid when smoke has a constant color, the color grid will no longer be premultiplied by the density. If the color is constant we want to be able not to store a grid at all. This breaks one test for Cycles and Eevee, but the setup in that test using a color without density does not make sense. It suffers from artifacts since the unpremultiplied color grid by itself will not have smooth boundaries. Differential Revision: https://developer.blender.org/D6951
2020-02-27Cleanup: more refactoring of GPU material attributes and texturesBrecht Van Lommel
This further separates requested attributes and textures from the actual node graph, that can be retained after the graph has been compiled and freed. It makes it easier to add volume grids as a native concept, which sits somewhere between an attribute and a texture. It also adds explicit link types for UDIM tile mapping, rather than relying on fairly hidden logic.
2020-02-20Cleanup: unused structsCampbell Barton
2020-02-20Cleanup: declatatuons for functions that don't existCampbell Barton
2020-02-15Cleanup: refactor GPU material attribute and texture requestsBrecht Van Lommel
2020-01-16Fix T73133: UDIM texture count in Eevee is limited by OpenGLLukas Stockner
Based on @fclem's suggestion in D6421, this commit implements support for storing all tiles of a UDIM texture in a single 2D array texture on the GPU. Previously, Eevee was binding one OpenGL texture per tile, quickly running into hardware limits with nontrivial UDIM texture sets. Workbench meanwhile had no UDIM support at all, as reusing the per-tile approach would require splitting the mesh by tile as well as texture. With this commit, both Workbench as well as Eevee now support huge numbers of tiles, with the eventual limits being GPU memory and ultimately GL_MAX_ARRAY_TEXTURE_LAYERS, which tends to be in the 1000s on modern GPUs. Initially my plan was to have one array texture per unique size, but managing the different textures and keeping everything consistent ended up being way too complex. Therefore, we now use a simpler version that allocates a texture that is large enough to fit the largest tile and then packs all tiles into as many layers as necessary. As a result, each UDIM texture only binds two textures (one for the actual images, one for metadata) regardless of how many tiles are used. Note that this rolls back per-tile GPUTextures, meaning that we again have per-Image GPUTextures like we did before the original UDIM commit, but now with four instead of two types. Reviewed By: fclem Differential Revision: https://developer.blender.org/D6456
2019-12-12Add support for tiled images and the UDIM naming schemeLukas Stockner
This patch contains the work that I did during my week at the Code Quest - adding support for tiled images to Blender. With this patch, images now contain a list of tiles. By default, this just contains one tile, but if the source type is set to Tiled, the user can add additional tiles. When acquiring an ImBuf, the tile to be loaded is specified in the ImageUser. Therefore, code that is not yet aware of tiles will just access the default tile as usual. The filenames of the additional tiles are derived from the original filename according to the UDIM naming scheme - the filename contains an index that is calculated as (1001 + 10*<y coordinate of the tile> + <x coordinate of the tile>), where the x coordinate never goes above 9. Internally, the various tiles are stored in a cache just like sequences. When acquired for the first time, the code will try to load the corresponding file from disk. Alternatively, a new operator can be used to initialize the tile similar to the New Image operator. The following features are supported so far: - Automatic detection and loading of all tiles when opening the first tile (1001) - Saving all tiles - Adding and removing tiles - Filling tiles with generated images - Drawing all tiles in the Image Editor - Viewing a tiled grid even if no image is selected - Rendering tiled images in Eevee - Rendering tiled images in Cycles (in SVM mode) - Automatically skipping loading of unused tiles in Cycles - 2D texture painting (also across tiles) - 3D texture painting (also across tiles, only limitation: individual faces can not cross tile borders) - Assigning custom labels to individual tiles (drawn in the Image Editor instead of the ID) - Different resolutions between tiles There still are some missing features that will be added later (see T72390): - Workbench engine support - Packing/Unpacking support - Baking support - Cycles OSL support - many other Blender features that rely on images Thanks to Brecht for the review and to all who tested the intermediate versions! Differential Revision: https://developer.blender.org/D3509
2019-08-25Cleanup: redundant struct declarationsCampbell Barton
2019-08-22Shading: Add object color to Object Info node.OmarSquircleArt
The object color property is added as an additional output in the Object Info node. Reviewers: brecht Differential Revision: https://developer.blender.org/D5554
2019-05-14GPU: Move Material index to nodetree evaluationClément Foucault
This removes the need to pass the Material* all over the place in the draw manager. Cleanup comming right after.
2019-05-13Cycles/Eevee: unified and improved texture image color space handlingBrecht Van Lommel
Cycles now uses the color space on the image datablock, and uses OpenColorIO to convert to scene linear as needed. Byte images do not take extra memory, they are compressed in scene linear + sRGB transfer function which in common cases is a no-op. Eevee and workbench were changed to work similar. Float images are stored as scene linear. Byte images are compressed as scene linear + sRGB and stored in a GL_SRGB8_ALPHA8 texture. From the GLSL shader side this means they are read as scene linear, simplifying the code and taking advantage of hardware support. Further, OpenGL image textures are now all stored with premultiplied alpha. Eevee texture sampling looks a little different now because interpolation happens premultiplied and in scene linear space. Overlays and grease pencil work in sRGB space so those now have an extra conversion to sRGB after reading from image textures. This is not particularly elegant but as long as engines use different conventions, one or the other needs to do conversion. This change breaks compatibility for cases where multiple image texture nodes were using the same image with different color space node settings. However it gives more predictable behavior for baking and texture painting if save, load and image editing operations have a single color space to handle. Differential Revision: https://developer.blender.org/D4807
2019-05-08GPU: Remove GPU_INVERSE_NORMAL_MATRIXClément Foucault
The end goal for this is to lower the number of needed matrices. This also cleanup some uneeded transformation.
2019-04-17ClangFormat: apply to source, most of internCampbell Barton
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
2019-03-29Fix T62178 Eevee: Texture Box mapping not matching Cycles if object is scaledClément Foucault
The wrong transformation was used. Add a new matrix specially for this case. This also fix the Node texture coordinate that was suffering the same issue.
2019-02-18doxygen: add newline after \fileCampbell Barton
While \file doesn't need an argument, it can't have another doxy command after it.
2019-02-06Cleanup: remove redundant doxygen \file argumentCampbell Barton
Move \ingroup onto same line to be more compact and make it clear the file is in the group.
2019-02-01Cleanup: remove redundant, invalid info from headersCampbell Barton
BF-admins agree to remove header information that isn't useful, to reduce noise. - BEGIN/END license blocks Developers should add non license comments as separate comment blocks. No need for separator text. - Contributors This is often invalid, outdated or misleading especially when splitting files. It's more useful to git-blame to find out who has developed the code. See P901 for script to perform these edits.
2019-01-29Cleanup: replace attrib w/ attrCampbell Barton
Also rename GPUVertexAttribs to GPUVertAttrLayers, avoids confusion with GPUVertAttr which isn't closely related.
2019-01-28Cleanup: sort forward declarations of enum & structCampbell Barton
Done using: source/tools/utils_maintenance/c_sort_blocks.py
2019-01-23Cleanup: use eGPU prefix for GPU enum typesCampbell Barton
2019-01-15Cleanup: commas at the end of enumsCampbell Barton
Without this clang-format may wrap them onto a single line.
2018-12-30Cleanup: remove non-existing function declarationsCampbell Barton
2018-11-08GPU: Cleanups: Remove GPUMatType, Vectorize / MADD some operationsClément Foucault
2018-11-06Eevee: Fix missing UBO bound if using a muted Shader to RGB node with SSSClément Foucault
This is a nasty bug. Because the node does not get properlly tagged as SSS (sss_id is 0) but is still evaluated (so tagging the GPUMaterial as having SSS). The sssProfile UBO is still declared and we need to bind something to it.
2018-09-20Eevee: Implement Wireframe NodeClément Foucault
This implementation is a bit hacky but match cycles pretty close. If pixel size is not enabled, it will use the geom shader to compute distances between vertices. This will have a cost. Implementation is a bit hacky in gpu_codegen to make the geom shader works in an optional manner.
2018-08-22GPUMaterial: Geometry Node: Add support for parametric outputClément Foucault
This supports meshes and hairs too. Matches cycles output. This adds barycentric coords to the GPUBuiltin enum which will also be used for the wireframe node.
2018-08-14Cleanup: GPU codegen: remove most of legacy codeClément Foucault
A lot of code in codegen was used by previous GLSL system. Now most of it is not used due to all the things being written from scratch in 2.8 and we can clean most of it. As a side not this make the system a bit less flexible (no support for cubemaps, preview image, etc...) but can be extended again.
2018-08-14Cleanup: Rename GPU_* functions to make more senseClément Foucault
* Remove GPU_link_changed which is unused. * Remove all GPU link function that are not used anymore. * GPU_uniform_buffer is now GPU_uniform. * GPU_texture_ramp is now GPU_color_band. * GPU_uniform is now GPU_constant.
2018-08-10GPUMaterial: Group all colorband texture togetherClément Foucault
This lower the use of texture samplers slots and let users use more real textures in their shaders. This patch also make the ramp texture 16 bit floating point. Meaning you can now use value greater than one in your color ramps. With the limit of 128 colorband per shader (a color band being either a color ramp, a wavelength node or a curve node (and maybe wavelength node in the future)). Only drawback with the current implementation is that it does not remove colorband from pruned GPUNodes but it shouldn't really matter in practice. This should fix T56010
2018-08-08Eevee: Use "constant folding" for the principle shaderClément Foucault
This is more like a static optimisation when some parameters are set to 1.0 or 0.0. In theses case we use a more optimized version of the node. This also revisit the transmission parameter behaviour to make it closer to cycles.
2018-08-08Eevee: Remove some of the non-necessary uniformsClément Foucault
The remaining ones are from the attributes linear/srgb switches and from nodes that should be pruned before running their _gpu function.
2018-08-02GPUShader: Add name for debugging & identifying shaders.Clément Foucault
2018-07-27Cleanup: Remove occurances of GPULampClément Foucault
2018-07-19GPU: Add GC to FBOs and UBOs and centralize all GCsClément Foucault
GPUFrameBuffers were being free when no context was attached or in the wrong gl context. This make sure this does not happen again. You can now safely free any gl resource from any thread (well as long as it's not used anymore!).
2018-07-18Cleanup: style for GPU moduleCampbell Barton
2018-07-08Cleanup: rename 'ct' to 'len' for gpuCampbell Barton
2018-06-25Merge branch 'master' into blender2.8Bastien Montagne
Conflicts: source/blender/editors/sculpt_paint/paint_image.c source/blender/editors/space_view3d/view3d_draw.c source/blender/editors/space_view3d/view3d_view.c source/blender/gpu/GPU_draw.h source/blender/gpu/GPU_material.h source/blender/gpu/intern/gpu_draw.c source/blender/gpu/intern/gpu_material.c source/blender/makesrna/intern/rna_userdef.c source/blender/windowmanager/intern/wm_files_link.c source/blender/windowmanager/intern/wm_init_exit.c source/creator/creator_args.c source/gameengine/GamePlayer/ghost/GPG_ghost.cpp source/gameengine/Ketsji/KX_PythonInit.cpp source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
2018-06-25Cleanup: Nuke most of G.main from GPU code.Bastien Montagne
2018-06-08DRW: Fix animated material not refreshingDalai Felinto
This introduces a garbage collection system similar to gpu_texture.
2018-06-08Rename: GPU_material_get_uniform_buffer > GPU_material_uniform_buffer_getDalai Felinto
2018-06-07Uniform Buffer Object: No more dirty tagging calls/checkDalai Felinto
2018-06-07Rename GPU_material_create_uniform_buffer > GPU_material_uniform_buffer_createDalai Felinto
2018-06-07Fix crash cause by SSS referencing Material Nodetree data.Clément Foucault
2018-06-07GPUPass: Refactor gpupass caching system to allow fast gpumaterial creation.Clément Foucault
This is part of the work needed to refactor the material parameters update. Now the gpupass cache is polled before adding the gpumaterial to the deferred compilation queue. We store gpupasses in a single linked list grouped based on their hashes. This is not the most efficient way but it can be improved upon later.
2018-04-21Cleanup: styleCampbell Barton