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-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-29Fix rendering of wire curves when used as custom bone objectsSebastian Parborg
In the current code we do not render any curves if they have not been converted to meshes. This change makes the custom bone drawing try to render mesh objects first and then falls back to curve objects if there is no mesh data available. Reviewed By: Clement Differential Revision: http://developer.blender.org/D14804
2022-04-29Fix T97686 DRW: Freeze when switching to material preview or render viewClément Foucault
This was caused by the compilation job being created suspended (to avoid UI slowdown because of the material Preview Icons). The suspended job wasn't passing the `WM_jobs_test` in `DRW_deferred_shader_remove` and the material would still be in the compile queue with its status equal to `GPU_MAT_QUEUED`. This would block the main thread in the waiting loop. But since the job manager timer needs to execute in the main thread, the compilation job was never being pushed out of its suspended state. This lead to a complete lock situation. The solution is to use `WM_jobs_customdata_from_type` which does exactly what we need. Also fixed a nullptr free.
2022-04-29Fix wrong cast from uint to int (2)Germano Cavalcante
Error in rB3d877c8a0d06
2022-04-29Fix wrong cast from uint to intGermano Cavalcante
Error in rB3d877c8a0d06
2022-04-29Select Engine: port shader to use 'GPUShaderCreateInfo'Germano Cavalcante
Simple port with a few cosmetic changes: - Attribute named "color" for indices VBO is now called "index" - The indices VBO is now composed of `int`s instead of `uint`s (this simplifies the source) Differential Revision: https://developer.blender.org/D14800
2022-04-28GPUMaterial: Rework the deferred compilation to not use double locksClément Foucault
This uses refcounter instead of double thread mutexes. This should be more robust and avoir use after free situation. Also remove redundant structures and the use of scene as the job owner.
2022-04-27Fix T97235: PBVH draw cache invalidation bugJoseph Eagar
The PBVH draw cache wasn't being invalidated in all cases. It is now invalidated whenever a PBVH node's draw buffers are freed.
2022-04-27Fix T96434: bad performance with viewport statistics and GPU subdivisionKévin Dietrich
The subdivision is always recomputed on the CPU when displaying stats if the mesh is animated which leads to bad performance. This caches the subdivision topology counters from the draw code in the mesh runtime and uses them for the viewport statistics. Differential Revision: https://developer.blender.org/D14774
2022-04-27Cleanup: formatKévin Dietrich
2022-04-27Fix T96283: last disabled subsurf is used for GPU subdivisionKévin Dietrich
When more than one, consecutive, subdivision modifier is used on a Mesh, the last subsurf modifier is used for GPU subdivision even though it might be disabled. This is because retrieving the last subsurf modifier in the draw code did not check whether the modifier was disabled or not. To fix this, the session UUID of the modifier which delegated evaluation to the GPU code is cached and used in the draw to select the right subsurf modifier. Differential Revision: https://developer.blender.org/D14488
2022-04-25Fix: Incorrect implicit enum conversionHans Goudey
Hardcode Catmull Rom curves for now, since nothing else is implemented.
2022-04-25Cleanup: spelling in commentsCampbell Barton
2022-04-24Cleanup: clang-formatCampbell Barton
2022-04-22Cleanup: Clang tidy, unused variable warningsHans Goudey
Also remove unnecessary uses of `struct` and add const in one place.
2022-04-22Cleanup: Remove unused variables, adjust commentsHans Goudey
2022-04-22Fix: Build error on macOS after previous commitHans Goudey
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-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-20Cleanup: Rename CD_MLOOPCOL to CD_PROP_BYTE_COLORHans Goudey
The "PROP" in the name reflects its generic status, and removing "LOOP" makes sense because it is no longer associated with just mesh face corners. In general the goal is to remove extra semantic meaning from the custom data types.
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-20Cleanup: spelling in commentsCampbell Barton
2022-04-20Cleanup: clang-formatCampbell Barton
2022-04-19DRW: Volume: Fix warning about unused variableClé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-19Refactor: Move mesh face dot tag out of MVertHans Goudey
Continuing the refactors described in T93602, this commit moves the face dot tag set by the subdivision surface modifier out of `MVert` to `MeshRuntime`. This clarifies its status as runtime data and allows further refactoring of mesh positions in the future. Before, `BKE_modifiers_uses_subsurf_facedots` was used to check whether subsurf face dots should be drawn, but now we can just check if the tags exist on the mesh. Modifiers that create new new geometry or modify topology will already remove the array by clearing mesh runtime data. Differential Revision: https://developer.blender.org/D14680
2022-04-18Cleanup: Remove incorrect commentHans Goudey
2022-04-15GPU: Make viewport not acquireable during renderingClément Foucault
This is a partial fix to the fact that rendering with EEVEE or other GL render engines is currently blocking the whole UI when asking to redraw a viewport. This patch just bypasses the viewport bind (containing the Draw Context lock) and the following drawing. There is an update tagging to not loose a viewport update if there was one asked. Other queries other than view redraw (such as selection depth drawing or offscreen drawing) will still block the whole UI as they need immediate data feedback. Ping @Severin for the change in `WM_draw_region_viewport_bind()`. I'm assuming this is not an issue because it's highly unlikely to bring up this operator during rendering. But in this case, it would just lock as usual. The bypassing in `DRW_notify_view_update` might be a bit overparanoid.
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-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-14Fix T96563: tangents artifacts with GPU subdivisionKévin Dietrich
When tangent are computed from generated coordinates, the result for GPU subdivision would be compressed to 16-bit when it shouldn't.
2022-04-14Fix part of T96596: wrong generated coordinates with GPU subdivisionKévin Dietrich
Problem is that the orco layer was not taken care of by the GPU subdivision routines. This only handles the issues for EEVEE/Workbench. For Cycles, this would need to be handled at the wrapper level somehow.
2022-04-14Fix T97053: on cage GPU subdivision shows subdivided edges as actualKévin Dietrich
edges When wireframe mode is turned on, the subdivision edges not originating from coarse edges were also drawn as regular edges, which would confuse users trying to select them. These should not be drawn in edit mode, only in object mode when optimal display is turned off (matching the CPU subdivision case).
2022-04-13Fix some usages of 'GPU_shader_get_uniform_block'Germano Cavalcante
`GPU_shader_get_uniform_block` is marked as deprecated and the value returned does not match what `GPU_uniformbuf_bind` expects. Also, small typo fix in python error message. Differential Revision: https://developer.blender.org/D14638
2022-04-13Cover some DNA files with C++ utility macrosSergey Sharybin
Solves compilation warning with Clang, and moves manipulation with DNA structures to the designed way for C++. The tests and few other places are update to the new code by Jacques. Ref T96847 Maniphest Tasks: T96847 Differential Revision: https://developer.blender.org/D14625
2022-04-08Fix: Build issue with MSVCRay Molenkamp
draw_common.h was included in a C++ file leading to the linker looking for the decorated name for `G_draw` which lead to a linker error. adding an extern "C" for C++ fixes the issue.
2022-04-08Curves edit mode: show dots for pointsKévin Dietrich
This adds support to show dots for the curves points when in edit mode, using a specific overlay. This also adds `DRW_curves_batch_cache_create_requested` which for now only creates the point buffer for the newly added `edit_points` batch. In the future, this will also handle other edit mode overlays, and probably also replace the current curves batch cache creation. Maniphest Tasks: T95770 Differential Revision: https://developer.blender.org/D14262
2022-04-06Cleanup: zero initialize VColRef before setting membersCampbell Barton
Ensures new members will be zeroed, the compiler is able to optimize this into identical compiled output.
2022-04-05Refactor: Unify vertex and sculpt colors into newJoseph Eagar
color attribute system. This commit removes sculpt colors from experimental status and unifies it with vertex colors. It introduces the concept of "color attributes", which are any attributes that represents colors. Color attributes can be represented with byte or floating-point numbers and can be stored in either vertices or face corners. Color attributes share a common namespace (so you can no longer have a floating-point sculpt color attribute and a byte vertex color attribute with the same name). Note: this commit does not include vertex paint mode, which is a separate patch, see: https://developer.blender.org/D14179 Differential Revision: https://developer.blender.org/D12587 Ref D12587
2022-04-05Overlay: Fix edit mode shader compilation after recent commitClément Foucault
This was caused by rBd889762590a4f068aa312879976e98dbd0ee93fc
2022-04-05Curves: Port legacy curve viewport drawing to the new data-blockHans Goudey
Instead of using `CurveEval` to draw the curve wire edges, use the new `Curves` data-block, which is already built as part of an object's evaluated geometry set whenever there is a `CurveComponent`. This means that we can remove `Curve`'s temporary ownership of `CurveEval` for drawing (added in 9ec12c26f16ea3da1e), which caused a memory leak as described in T96498. In my testing this improved performance by around 1.5x during viewport playback, back to the performance of 3.1 before the curve data structure transition started. The next step of using the GPU to do the final curve evaluation for the viewport is described in T96455, but is unrelated. Differential Revision: https://developer.blender.org/D14551
2022-04-05Refactor: Evaluate surface objects as mesh componentsHans Goudey
This commit furthers some of the changes that were started in rBb9febb54a492 and subsequent commits by changing the way surface objects are presented to render engines and other users of evaluated objects in the same way. Instead of presenting evaluated surface objects as an `OB_SURF` object with an evaluated mesh, `OB_SURF` objects can now have an evaluated geometry set, which uses the same system as other object types to deal with multi-type evaluated data. This clarification makes it more obvious that lots of code that dealt with the `DispList` type isn't used. It wasn't before either, now it's just *by design*. Over 1100 lines can be removed. The legacy curve draw cache code is much simpler now too. The idea behind the further removal of `DispList` is that it's better to focus optimization efforts on a single mesh data structure. One expected functional change is that the evaluated mesh from surface objects can now be used in geometry nodes with the object info node. Cycles and the OBJ IO tests had to be tweaked to avoid using evaluated surface objects instead of the newly exposed mesh objects. Differential Revision: https://developer.blender.org/D14550
2022-04-05Cleanup: Change globalBlock members to snake caseClément Foucault
This avoid conflicting defines in GLSL Fix T96998 Blender 3.2.0 Alpha crashes on startup
2022-04-04Cleanup: clang-tidyCampbell Barton