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-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-06Cleanup: spelling in comments, use doxygen commentsCampbell Barton
2022-05-05DRW: Hair: Fix shader compilation of transform feedback shaderClément Foucault
Introduced by rBadbe71c3faba.
2022-05-05Fix T97835: crash when creating hair particle system on MacGermano Cavalcante
Recently `gpu_shader_3D_smooth_color_frag.glsl` had the uniform declarations removed. For shaders without `ShaderCreateInfo` that require this source this results in the error: ``` ERROR (gpu.shader): hair_refine_shader_transform_feedback_workaround_create FragShader: | 54 | fragColor = finalColor; | | gpu_shader_3D_smooth_color_frag.glsl:5:0: Error: Use of undeclared identifier 'fragColor' | gpu_shader_3D_smooth_color_frag.glsl:5:0: Error: Use of undeclared identifier 'finalColor' | 55 | fragColor = blender_srgb_to_framebuffer_space(fragColor); | | gpu_shader_3D_smooth_color_frag.glsl:6:0: Error: Use of undeclared identifier 'fragColor' | gpu_shader_3D_smooth_color_frag.glsl:6:0: Error: Use of undeclared identifier 'fragColor' ``` So port that shader to use `ShaderCreateInfo`.
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-02EEVEE: Rewrite: Implement nodetree support with every geometry typesClément Foucault
This commit introduce back support for all geometry types and all nodetree support. Only the forward shading pipeline is implemented for now. Vertex Displacement is automatically enabled for now. Lighting & Shading is placeholder. Related Task: T93220 # Conflicts: # source/blender/draw/engines/eevee_next/eevee_engine.cc # source/blender/gpu/CMakeLists.txt
2022-05-01Fix T97545 DRW: Crash cause by invalid `"` char in glsl sourceClément Foucault
Some old compiler do not like this character even if inside an `#error` directive.
2022-05-01Overlay: Port wireframe shader to use shaderCreateInfoClément Foucault
This should have no functional changes.
2022-05-01Overlay: Port image empty shader to use shaderCreateInfoClément Foucault
This should have no functional changes.
2022-05-01Overlay: Port outline shaders to use shaderCreateInfoClément Foucault
This should have no functional changes.
2022-04-30Overlay: Port edit uv shaders to use shaderCreateInfoClément Foucault
This should have no functional changes.
2022-04-20Revert "Fix GPU subdivision: Crash on adding subdivision surface modifier"Clément Foucault
The fix does not fix the case of shaders comming from the OpenSubdiv API. This reverts commit f5191b87608f6607aa1dbd4b9409174db351984b.
2022-04-20Fix GPU subdivision: Crash on adding subdivision surface modifierClément Foucault
This was caused by the use of a reserved keyword macro that is not directly used but causes an error on some compiler. Change the occurences to not match the macros.
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-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 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-03-31GPencil: Fix regression with dots uvsClément Foucault
This was introduced by rBeccb0b222e3465baa71430223c5ee2f0206a7b02.
2022-03-31DRW: Rename DRW_shgroup_uniform_vec4_array_copy to mat4_copyClément Foucault
This function was not used for anything other than mat4. This was because of a limitation of the DRW module/ This makes it cleaner for the GLSL and also less tempting to use it for other unconventional purpose.
2022-03-31Cleanup: spelling, trailing space for comment-blocksCampbell Barton
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-30DRW: Port draw_common.c to use shared definition with GLSLClément Foucault
# Conflicts: # source/blender/draw/intern/draw_common_shader_shared.h # source/blender/draw/intern/shaders/draw_view_info.hh
2022-03-29Fix T96356: artefacts with GPU subdivision and vertex paint maskKévin Dietrich
The lines paint mask IBO extraction was not implemented for GPU subdivision. For it to work, we also now need to preserve the subdivision loop to subdivision edge map, which until now was overwritten to store coarse edges (the map to coarse edges is still preserved). Also the paint flag stored in the 4th dimension of the loop normal buffer was not properly set for flat shaded faces, leading to other kind of artefacts and render issues.
2022-03-26DRW: Port draw_common.c to use shared definition with GLSLClément Foucault
2022-03-23Cleanup: move documentation to headers, other minor correctionsCampbell Barton
2022-03-22Metal: Make GLSL shader source MSL compliant alsoJason Fielder
Metal shading language follows the C++ 14 standard and in some cases requires a greater level of explicitness than GLSL. There are also some small language differences: - Explicit type-casts (C++ requirements) - Explicit constant values (C++ requirements, e.g. floating point values using 0.0 instead of 0). - Metal/OpenGL compatibility paths - GLSL Function prototypes - Explicit accessors for vector types when sampling textures. Authored by Apple: Michael Parkin-White Ref T96261 Reviewed By: fclem Maniphest Tasks: T96261 Differential Revision: https://developer.blender.org/D14378
2022-03-20DRW: Port improvements in common_math_lib.glsl from `eevee-rewrite`Clément Foucault
Mostly quality of life functions and macros.
2022-03-20DRW: Introduce GPencil common GLSL libraryClément Foucault
This library contains the needed functions to render GPencil object geometry. Centralizing these will make it possible for other draw engines (EEVEE, Overlay) to reuse the same vertex shader code and possibly the same fragment rejection methods.
2022-03-11Cleanup: use M_PI_2 and M_PI_4 where possibleHallam Roberts
The constant M_PI_4 is added to GLSL to ensure it works there too. Differential Revision: https://developer.blender.org/D14288
2022-03-11Cleanup: fix source comment typosBrecht Van Lommel
Contributed by luzpaz. Differential Revision: https://developer.blender.org/D14307
2022-02-26Cleanup: typos in comments.Kévin Dietrich
2022-02-25Merge remote-tracking branch 'origin/blender-v3.1-release'Kévin Dietrich
2022-02-25Fix different shading between CPU and GPU subdivisionKévin Dietrich
Reuse the same vertex normals calculation as for the GPU code, by weighing each vertex normals by the angle of the edges incident to the vertex on the face. Additionally, remove limit normals, as the CPU code does not use them either, and would also cause different shading issues when limit surface is used. Fixes T95242: shade smooth artifacts with edge crease and limit surface Fixes T94919: subdivision, different shading between CPU and GPU
2022-02-15Merge remote-tracking branch 'origin/blender-v3.1-release'Kévin Dietrich
2022-02-15Fix T95697: GPU subdivision ignores custom normalsKévin Dietrich
Similarly to the CPU subdivision, we interpolate custom loop normals from the coarse mesh, and this for the final normals.
2022-02-15GPU subdiv: fix custom data interpolation for N-gonsKévin Dietrich
Not all coarse vertices were used to compute the center value (off by one), and the interpolation for the current would always start at the base corner for the base face instead of the base corner for the current patch.
2022-02-11File headers: add missing copyright, add MIT to SPDX licensesCampbell Barton
2022-02-11File headers: SPDX License migrationCampbell Barton
Use a shorter/simpler license convention, stops the header taking so much space. Follow the SPDX license specification: https://spdx.org/licenses - C/C++/objc/objc++ - Python - Shell Scripts - CMake, GNUmakefile While most of the source tree has been included - `./extern/` was left out. - `./intern/cycles` & `./intern/atomic` are also excluded because they use different header conventions. doc/license/SPDX-license-identifiers.txt has been added to list SPDX all used identifiers. See P2788 for the script that automated these edits. Reviewed By: brecht, mont29, sergey Ref D14069
2022-02-06DRW: Add preprocessor error if including common_view_lib.glsl without draw_viewClément Foucault
This avoid making include mistake and potentially detect areas that do not really need common_view_lib.glsl.
2022-02-04DRW: Fix a commentClément Foucault
2022-02-01GPUShader: Rename createInfo storage QualifiersClément Foucault
Using opt-in instead of opt-out to make code easier to read. Add combined flag enum. Making restrict an inverse flag option because it is so rare to use it.
2022-01-31Cleanup: use our own conventions for tags in commentsCampbell Barton
2022-01-27GPUShaderCreateInfo: Remove push_constant indexingClément Foucault
This is too much impractical and offers no real benefit.
2022-01-26DRW: Fix builtin uniform name mismatchClément Foucault
This lead to severe unreported regression, like volume rendering broken in workbench.
2022-01-26D13910: Workbench: Port shaders to use GPUShaderCreateInfoClément Foucault
Also adds a few things to GPUShader for easily create shaders. Heavy usage of macros to compose the createInfo and avoid duplications and copy paste bugs. This makes the link between the shader request functions (in workbench_shader.cc) and the actual createInfo a bit obscure since the names are composed and not searchable. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D13910
2022-01-25Cycles: add Point Info nodeBrecht Van Lommel
With (center) position, radius and random value outputs. Eevee does not yet support rendering point clouds, but an untested implementation of this node was added for when it does. Ref T92573
2022-01-25Draw: Migrate hair refine compute shader to use create info.Jeroen Bakker
This patch migrates the draw manager hair refine compute shader to use GPUShaderCreateInfo. Reviewed By: fclem Differential Revision: https://developer.blender.org/D13915
2022-01-24Cleanup: spelling in commentsCampbell Barton
2022-01-17Revert "Revert "GPUShaderCreateInfo for interface abstraction""Jeroen Bakker
This reverts commit edee5a947b7ea3e1324aa334a22c7c9bbf47f5f7. Fixes compilation error (Missing file BLI_float2.hh)
2022-01-17Revert "GPUShaderCreateInfo for interface abstraction"Jeroen Bakker
This reverts commit 8fb2ff458ba579dba08bfdf57d043ad158b5db07. Missing some files.
2022-01-17GPUShaderCreateInfo for interface abstractionJeroen Bakker
This is a first part of the Shader Create Info system could be. A shader create info provides a way to define shader structure, resources and interfaces. This makes for a quick way to provide backend agnostic binding informations while also making shader variations easy to declare. - Clear source input (only one file). Cleans up the GPU api since we can create a shader from one descriptor - Resources and interfaces are generated by the backend (much simpler than parsing). - Bindings are explicit from position in the array. - GPUShaderInterface becomes a trivial translation of enums and string copy. - No external dependency to third party lib. - Cleaner code, less fragmentation of resources in several libs. - Easy to modify / extend at runtime. - no parser involve, very easy to code. - Does not hold any data, can be static and kept on disc. - Could hold precompiled bytecode for static shaders. This also includes a new global dependency system. GLSL shaders can include other sources by using #pragma BLENDER_REQUIRE(...). This patch already migrated several builtin shaders. Other shaders should be migrated one at a time, and could be done inside master. There is a new compile directive `WITH_GPU_SHADER_BUILDER` this is an optional directive for linting shaders to increase turn around time. What is remaining: - pyGPU API {T94975} - Migration of other shaders. This could be a community effort. Reviewed By: jbakker Maniphest Tasks: T94975 Differential Revision: https://developer.blender.org/D13360