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
2022-05-30Cleanup: fix various typosBrecht Van Lommel
Contributed by luzpaz Differential Revision: https://developer.blender.org/D15057
2022-05-24Cleanup: make formatJacques Lucke
2022-05-24EEVEE: support Curves attributes renderingKévin Dietrich
This adds support to render Curves attributes in EEVEE. Each attribute is stored in a texture derived from a VBO. As the shading group needs the textures to be valid upon creation, the attributes are created and setup during its very creation, instead of doing it lazily via create_requested which we cannot rely on anyway as contrary to the mesh batch, we do cannot really tell if attributes need to be updated or else via some `DRW_batch_requested`. Since point attributes need refinement, and since attributes are all cast to vec4/float4 to account for differences in type conversions between Blender and OpenGL, the refinement shader for points is used as is. The point attributes are stored for each subdivision level in CurvesEvalFinalCache. Each subdivision level also keeps track of the attributes already in use so they are properly updated when needed. Some basic garbage collection was added similar to what is done for meshes: if the attributes used over time have been different from the currently used attributes for too long, then the buffers are freed, ensuring that stale attributesare removed. This adds `CurvesInfos` to the shader creation info, which stores the scope in which the attributes are defined. Scopes are stored as booleans, in an array indexed by attribute loading order which is also the order in which the attributes were added to the material. A mapping is necessary between the indices used for the scoping, and the ones used in the Curves cache, as this may contain stale attributes which have not been garbage collected yet. Common utilities with the mesh code for handling requested attributes were moved to a separate file. Differential Revision: https://developer.blender.org/D14916
2022-05-23Cleanup: GPU: Remove `gpu_shader_common_obinfos_lib.glsl`Clément Foucault
This has been replaced by `draw_object_infos`.
2022-05-23Fix T98251: EEVEE: Regression: Wrong normalmaps on scaled objectsClément Foucault
This was caused by a missing `normalize`.
2022-05-23Cleanup: GPU: Remove `gpu_shader_common_obinfos_lib.glsl`Clément Foucault
This has been replaced by `draw_object_infos`.
2022-05-23Fix T98251: EEVEE: Regression: Wrong normalmaps on scaled objectsClément Foucault
This was caused by a missing `normalize`.
2022-05-23Merge branch 'blender-v3.2-release'Clément Foucault
2022-05-23Fix T98128: EEVEE: Regression: Inverted surface normal on MacOS Intel GPUClément Foucault
This seems to be caused by the `!` used in conjunction with a macro. Using the macro directly as condition does not exhibit this issue.
2022-05-19Cleanup: format, reduce line length & strip trailing spaceCampbell Barton
2022-05-13Cleanup: spelling in comments, capitalize tagsCampbell Barton
Also add missing task-ID reference & remove colon after \note as it doesn't render properly in doxygen.
2022-05-12Merge branch 'blender-v3.2-release'Bastien Montagne
2022-05-12Fix T98026 EEVEE: Refression Crash when rendering Cryptomatte passesClément Foucault
This was because the main `surface_vert.glsl` was changed to accomodate the needs of the `ShaderCreateInfo` but was still used by the cryptomatte shader. The fix is to include the same libraries as the material shaders and bypass `attrib_load()`.
2022-05-12Merge branch 'blender-v3.2-release'Jacques Lucke
2022-05-12Fix T97380 EEVEE: Weird motion-blur on curvesClément Foucault
This was caused by the `mb_data->obmat[]` being wrong because they are now shared between the particle system and the object. But Hair need the dupli parent matrix instead of the object matrix. Disabling `Show Emitter` option fixes the bug. To avoid this problem, request a different `EEVEE_ObjectMotionData` for particle systems using a different key pointer in the hash. This is a bit dirty but there is less code polution using this workaround. Differential Revision: https://developer.blender.org/D14911
2022-05-11Cleanup: use '_num' / '_count' suffix instead of '_ct'Campbell Barton
Use num & count (for counters), in drawing code, see: T85728.
2022-05-10Merge branch 'blender-v3.2-release'Clément Foucault
2022-05-10Fix T97985 EEVEE: Shader mixing not working correctly when reusing shader nodesClément Foucault
This was caused by the `Closure` members being added to the final contribution more than once. The workaround is to clear the members once a closure has been added to the final contribution. I used `inout` on `Closure` inputs so that the render engine implementation of mix and add closure nodes can do its own thing. The nodegraph handling of inout was changed for this to work.
2022-05-09Fix T97983 EEVEE: Tangent Normal of Curves info behaves differently in EeveeClément Foucault
Curve tangent was correctly mistaken with curve normal. This patch fixes the name of the output in the glsl function and make curve attributes more explicit (with `curve_` prefix). This also improve the normal computation by making it per pixel to match cycles. Also ports the changes to eevee-next.
2022-05-09Merge branch 'blender-v3.2-release'Jeroen Bakker
2022-05-07EEVEE: Fix missing function implementation for volumetric materialsClément Foucault
This was leading to linking errors. Fixes T97779 Regression: World volume noise stopped working
2022-05-07Fix T97796 EEVEE: Regression: Alpha clipped materials rendered as alpha hashedClément Foucault
This was because the alpha clip thresholding was previously done in the material nodes codegen. Now it is the responsibility of the engine to implement it. This adds a loose uniform that is set by EEVEE itself to control the clip behavior.
2022-05-07Fix T97881 EEVEE: First Specular and SSS closure not contributing on alpha ↵Clément Foucault
blended material This was because the evaluation was still being deferred just like for the opaque case.
2022-05-06Cleanup: spelling in comments, use doxygen commentsCampbell Barton
2022-05-03Merge remote-tracking branch 'origin/blender-v3.2-release'Kévin Dietrich
2022-05-03Fix T93179: geonodes UVs and Vertex colors do not work in EEVEEKévin Dietrich
Overwriting UV map or vertex color data in Geometry nodes will move the layers to another CustomData channel, and as such, will make attribute lookup fail from the UVMap and Vertex Color nodes in EEVEE as the CustomDataType will also be modified (i.e. no longer `CD_MTFACE` or `CD_MCOL`). As discussed in T93179, the solution is to use `CD_PROP_AUTO_FROM_NAME` so that the render engine is able to find the attributes. This also makes EEVEE emulate Cycles behaviour in this regard. `attr_load_uv` and `attr_load_color` are also removed in favor of the generic attribute API in the various GLSL shaders. Although `CD_PROP_AUTO_FROM_NAME` is now used even for UV maps, the active UV map is still used in case the attribute name is empty, to preserve the old behavior. Differential Revision: https://developer.blender.org/D13730
2022-05-03Cleanup: spelling in commentsCampbell Barton
2022-05-02EEVEE: Fix compilation on MSVCClément Foucault
2022-04-28EEVEE: Add shader compilation progress in the viewportClément Foucault
Since rBfa43c47c7cb8446b632a4c0f712162ba615fe51f the progress bar do not show the compilation progress. This was misleading as users could think it could be canceled or prevent rendering. Now we just show how many shaders are still in the compilation queue inside each viewport. This number is more accurate than the percentage that was previously displayed in the progress bar.
2022-04-27Metal: GLSL Compatibility - Hosting default uniform values.Jason Fielder
There are a number of shaders, most notably grid_frag.glsl, which rely on default assignments to uniform values within shaders. This is not currently supported by the shader uniform push model implemented for the Metal backend, wherein uniform updates are pushed as a singular block of data. Any default assignment would become over-written. As such, adding assignments of these default values in the high-level, to ensure the correct value is written for all APIs. This likely impacts Vulkan push-constants as well. Authored by Apple: Michael Parkin-White Ref T96261 Reviewed By: fclem Maniphest Tasks: T96261 Differential Revision: https://developer.blender.org/D14555
2022-04-22Curves: Further split of curves draw code from particlesHans Goudey
Extends the changes started in f31c3f8114616bb to completely separate much of the DRW curves code from the particle hair drawing. In the short term this increases duplication, but the idea is to simplify development by making it easier to do larger changes to the new code, and the new system will replace the particle hair at some point. After this, only the shaders themselves are shared. Differential Revision: https://developer.blender.org/D14699
2022-04-20Cleanup: spelling in commentsCampbell Barton
2022-04-20Cleanup: clang-formatCampbell Barton
2022-04-19Cleanup: GPUMaterial: Remove GPU_material_is_volume_shaderClément Foucault
2022-04-19GPU: Replace `GPUMaterialVolumeGrid` by `GPUMaterialAttribute`Clément Foucault
This is to make the codegen and shading nodes object type agnostic. This is essential for flexibility of the engine to use the nodetree as it see fits. The essential volume attributes struct properties are moved to the `GPUMaterialAttribute` which see its final input name set on creation. The binding process is centralized into `draw_volume.cc` to avoid duplicating the code between multiple engines. It mimics the hair attributes process. Volume object grid transforms and other per object uniforms are packed into one UBO per object. The grid transform is now based on object which simplify the matrix preparations. This also gets rid of the double transforms and use object info orco factors for volume objects. Tagging @brecht because he did the initial implementation of Volume Grids.
2022-04-19DRW: Centralize smoke domain texture managementClément Foucault
This code was duplicated in multiple engines. Now it is the draw manager responsability to manage the throwaway fluid textures.
2022-04-18Cleanup: Clang tidyHans Goudey
- Inconsistent parameter names - Else after return - Braces around statements - Qualified auto - Also (not clang tidy): Pass StringRef by value, unused parameter
2022-04-15EEVEE: Support disabling all lightprobe object contribution in viewportClément Foucault
This is supported throught the visibility toggle. The light cache will then only be used for world lighting. This is the behavior as light objects.
2022-04-14GPU: Make nodetree GLSL Codegen render engine agnosticClément Foucault
This commit removes all EEVEE specific code from the `gpu_shader_material*.glsl` files. It defines a clear interface to evaluate the closure nodes leaving more flexibility to the render engine. Some of the long standing workaround are fixed: - bump mapping support is no longer duplicating a lot of node and is instead compiled into a function call. - bump rewiring to Normal socket is no longer needed as we now use a global `g_data.N` for that. Closure sampling with upstread weight eval is now supported if the engine needs it. This also makes all the material GLSL sources use `GPUSource` for better debugging experience. The `GPUFunction` parsing now happens in `GPUSource` creation. The whole `GPUCodegen` now uses the `ShaderCreateInfo` and is object type agnostic. Is has also been rewritten in C++. This patch changes a view behavior for EEVEE: - Mix shader node factor imput is now clamped. - Tangent Vector displacement behavior is now matching cycles. - The chosen BSDF used for SSR might change. - Hair shading may have very small changes on very large hairs when using hair polygon stripes. - ShaderToRGB node will remove any SSR and SSS form a shader. - SSS radius input now is no longer a scaling factor but defines an average radius. The SSS kernel "shape" (radii) are still defined by the socket default values. Appart from the listed changes no other regressions are expected.
2022-04-14Metal: GLSL shader compatibility 4th passJason Fielder
MSL follows C++ standard convention, and such variable declarations within switch statements must have their scope localised within each case. Adding braces in all cases ensures correct behaviour and avoids 'case ... bypass initialization of local variable' compilation error. struct initialisation to follow C++ rules for Metal. Implicit constructors replaced with either explicit constructors or list-initialization where appropriate. Ref T96261 Authored by Apple: Michael Parkin-White Reviewed By: fclem Maniphest Tasks: T96261 Differential Revision: https://developer.blender.org/D14451
2022-04-14Metal: GLSL shader compatibility 3rd passJason Fielder
Undefined behaviour for divergent control-flow fixes, replacement for partial vector references, and resolution of a number of calculation precision issues occuring on macOS. Authored by Apple: Michael Parkin-White Ref: T96261 Reviewed By: fclem Differential Revision: https://developer.blender.org/D14437
2022-04-14Cleanup: unused argument warningCampbell Barton
2022-04-14Cleanup: Further hair to curves renamingHans Goudey
These were missed in previous passes. Also remove some logic in `draw_hair.c` that was redundant after f31c3f8114616bb8964c8e7.
2022-04-14Curves: Split curve EEVEE/workbench functions from particle hairHans Goudey
The GPU evaluation for curves will have to change significantly from the current particle hair drawing code, due to its more general use cases and support for more curve types. To simplify that process and avoid introducing regressions for the rendering of hair particle systems, this commit splits drawing functions for the curves object and particle hair. The changes are just inlining of functions and copying code where necessary. Differential Revision: https://developer.blender.org/D14576
2022-04-04Cleanup: ensure space after file named in headersCampbell Barton
Add blank lines after file references to avoid them being interpreted as doc-strings the following declarations.
2022-04-01Cleanup: Use const for bounding boxes where possibleHans Goudey
2022-03-30Metal: Adding alternative support for GPU_PRIM_TRI_FAN/LINE_LOOP For Metal ↵Jason Fielder
backend. - Metal uniform array compatibility in DRW module. - Guard OpenGL-specific workarounds and flushes behind GPU_type_matches_ex API guard. Add further render boundaries for render paths called outside of the main loop. Authored by Apple: Michael Parkin-White Ref: T96261 Reviewed By: fclem Differential Revision: https://developer.blender.org/D14438
2022-03-30Metal: GLSL Shader compatibility 5Jason Fielder
MSL does not have an implicit global scope, this is emulated via macro's adding an indirection for uniforms, attributes, shader stage inputs and outputs such as: #define roughness shaderinst->roughness. Variables in GLSL which exist within uniform blocks can be directly referenced via the global scope, unlike standard C++. This means that variable name pollution occurs if subsequent local variables in the code use the same name, resulting in compilation errors. A number of these conflicting names have been renamed to ensure unique naming and no further scope pollution. Ref T96261 Reviewed By: fclem Maniphest Tasks: T96261 Differential Revision: https://developer.blender.org/D14452
2022-03-30Metal: GLSL Compatibility - explicit mat4_to_mat3 conversionJason Fielder
Explicit constructor for mat3 from a mat4 is not valid and cannot be overloaded. Adding explicit texture resource type flags for depth textures. This is an explicit requirement for Metal Shading language. This is a temporary compatibility, as this path is already supported in GPU_SHADER_CREATE_INFO under ImageType::DEPTH_2D, though required in shader source for MSL shaders which do not have create info. Authored by Apple: Michael Parkin-White Ref T96261 Reviewed By: fclem Maniphest Tasks: T96261 Differential Revision: https://developer.blender.org/D14418
2022-03-25Cleanup: use count or num instead of nbrCampbell Barton
Follow conventions from T85728.