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-10-08Attribute Node: support accessing attributes of View Layer and Scene.Alexander Gavrilov
The attribute node already allows accessing attributes associated with objects and meshes, which allows changing the behavior of the same material between different objects or instances. The same idea can be extended to an even more global level of layers and scenes. Currently view layers provide an option to replace all materials with a different one. However, since the same material will be applied to all objects in the layer, varying the behavior between layers while preserving distinct materials requires duplicating objects. Providing access to properties of layers and scenes via the attribute node enables making materials with built-in switches or settings that can be controlled globally at the view layer level. This is probably most useful for complex NPR shading and compositing. Like with objects, the node can also access built-in scene properties, like render resolution or FOV of the active camera. Lookup is also attempted in World, similar to how the Object mode checks the Mesh datablock. In Cycles this mode is implemented by replacing the attribute node with the attribute value during sync, allowing constant folding to take the values into account. This means however that materials that use this feature have to be re-synced upon any changes to scene, world or camera. The Eevee version uses a new uniform buffer containing a sorted array mapping name hashes to values, with binary search lookup. The array is limited to 512 entries, which is effectively limitless even considering it is shared by all materials in the scene; it is also just 16KB of memory so no point trying to optimize further. The buffer has to be rebuilt when new attributes are detected in a material, so the draw engine keeps a table of recently seen attribute names to minimize the chance of extra rebuilds mid-draw. Differential Revision: https://developer.blender.org/D15941
2022-10-07DRW: Remove viewport_size from DRWViewClément Foucault
This is part of the effor to simplify the View struct in order to implement multiview rendering.
2022-10-07DRW: Move clipping planes to their own UBOClément Foucault
This is part of the effor to simplify the View struct in order to implement multiview rendering.
2022-08-30GPUBatch: Add multi_draw_indirect capability and indirect buffer offsetClément Foucault
This is for completion and to be used by the new draw manager.
2022-08-02DRW: Add image unbind in debug modeClément Foucault
This allows finding missing binds more easily as the missing binds slots won't be populated with previous texture binds.
2022-08-02DRW: Add DRW_shgroup_call_procedural_triangles_indirectClément Foucault
Just like the name suggest, this adds a way to draw a series of proceduraly positioned triangles using and indirect buffer.
2022-05-15GPUVertBuf: Add support for binding as buffer textureClément Foucault
This is often needed and somehow cumbersome to set up. This will allow some code simplifications.
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-31Fix T96920 DRW: Regression: Hair strands are drawn in wrong placeClément Foucault
This was caused by the recent changes made to the way we handle matrix copies. The matrix copy assumed that the uniform iteration was the same as creation order. But this was far from true. The reality was that the iterator was reverse for `unichunk` but not for `unichunk->uniforms` so this was recreating wrong matrix. I rewrote this part to always use reverse iteration and fix the copy destination. Also I simplified the code making the assumption this won't be used for anything else than mat4.
2022-03-31Cleanup: Unused variable in release build warningSergey Sharybin
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-20DRW: Make use of shader shared headerClément Foucault
# Conflicts: # source/blender/draw/intern/draw_manager.h # source/blender/draw/intern/draw_manager_exec.c # source/blender/draw/intern/draw_shader_shared.h
2022-03-18DRW: Add support for compute indirect command.Clément Foucault
This just expose the GPU API through DRW.
2022-03-18DRW: Add support for GPUStorageBufClément Foucault
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-04DRW: Add compute_ref calls, barriers calls, and vertex_buffer_refClément Foucault
- Compute ref let the size of dispatch be modified just before drawing. - Barrier call makes it possible to chain multiple compute passes in one pass. - DRW_shgroup_vertex_buffer_ref is the analog of DRW_shgroup_uniform_block_ref.
2022-01-27Cleanup: Fix const correctness warningClément Foucault
2022-01-27Cleanup: Add more const correctness to some functionsClément Foucault
These are functions that are used by eevee-rewrite which has more strict const correctness.
2021-12-08Cleanup: move public doc-strings into headers for 'draw'Campbell Barton
Ref T92709
2021-09-21Cycles: merge of cycles-x branch, a major update to the rendererBrecht Van Lommel
This includes much improved GPU rendering performance, viewport interactivity, new shadow catcher, revamped sampling settings, subsurface scattering anisotropy, new GPU volume sampling, improved PMJ sampling pattern, and more. Some features have also been removed or changed, breaking backwards compatibility. Including the removal of the OpenCL backend, for which alternatives are under development. Release notes and code docs: https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles https://wiki.blender.org/wiki/Source/Render/Cycles Credits: * Sergey Sharybin * Brecht Van Lommel * Patrick Mours (OptiX backend) * Christophe Hery (subsurface scattering anisotropy) * William Leeson (PMJ sampling pattern) * Alaska (various fixes and tweaks) * Thomas Dinges (various fixes) For the full commit history, see the cycles-x branch. This squashes together all the changes since intermediate changes would often fail building or tests. Ref T87839, T87837, T87836 Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-08-05Cleanup: remove redundant parenthesisCampbell Barton
2021-07-07Cleanup: spelling in commentsCampbell Barton
2021-07-03Cleanup: consistent use of tags: NOTE/TODO/FIXME/XXXCampbell Barton
Also use doxy style function reference `#` prefix chars when referencing identifiers.
2021-05-28DrawManager: Use Compute Shader to Update Hair.Jeroen Bakker
This patch will use compute shaders to create the VBO for hair. The previous implementation uses transform feedback. Timings before: between 0.000069s and 0.000362s. Timings after: between 0.000032s and 0.000092s. Speedup isn't noticeable by end-users. The patch is used to test the new compute shader pipeline and integrate it with the draw manager. Allowing EEVEE, Workbench and other draw engines to use compute shaders with the introduction of `DRW_shgroup_call_compute` and `DRW_shgroup_vertex_buffer`. Future improvements are possible by generating the index buffer of hair directly on the GPU. NOTE: that compute shaders aren't supported by Apple and still use the transform feedback workaround. Reviewed By: fclem Differential Revision: https://developer.blender.org/D11057
2021-05-26Revert "DrawManager: Use Compute Shader to Update Hair."Jeroen Bakker
This reverts commit 8f9599d17e80254928d2d72081a4c7e0dee64038. Mac seems to have an error with this change. ``` ERROR: /Users/blender/git/blender-vdev/blender.git/source/blender/draw/intern/draw_hair.c:115:44: error: use of undeclared identifier 'shader_src' ERROR: /Users/blender/git/blender-vdev/blender.git/source/blender/draw/intern/draw_hair.c:123:13: error: use of undeclared identifier 'shader_src' ERROR: make[2]: *** [source/blender/draw/CMakeFiles/bf_draw.dir/intern/draw_hair.c.o] Error 1 ERROR: make[1]: *** [source/blender/draw/CMakeFiles/bf_draw.dir/all] Error 2 ERROR: make: *** [all] Error 2 ```
2021-05-26DrawManager: Use Compute Shader to Update Hair.Jeroen Bakker
This patch will use compute shaders to create the VBO for hair. The previous implementation uses tranform feedback. Timings master (transform feedback with GPU_USAGE_STATIC between 0.000069s and 0.000362s Timings transform feedback with GPU_USAGE_DEVICE_ONLY. between 0.000057s and 0.000122s Timings compute shader between 0.000032 and 0.000092s Future improvements: * Generate hair Index buffer using compute shaders: currently done single threaded on CPU, easy to add as compute shader. Reviewed By: fclem Differential Revision: https://developer.blender.org/D11057
2021-02-05Cleanup: correct spelling in commentsCampbell Barton
2021-01-21Cleanup: spellingCampbell Barton
2021-01-04Cleanup: docy comments beginning with '/**' don't end with '**/'Campbell Barton
2020-11-04Merge branch 'blender-v2.91-release'Jeroen Bakker
2020-11-04Fix T67832: Camera Background Images View TransformJeroen Bakker
This patch will apply the view transform when a movie clip is used as camera background image. It does this by rendering the image in the color buffer when it needs the view transform. For other images it uses the overlay buffer. Reviewed By: Clément Foucault Differential Revision: https://developer.blender.org/D7067
2020-11-03Materials: add custom object properties as uniform attributes.Alexander Gavrilov
This patch allows the user to type a property name into the Attribute node, which will then output the value of the property for each individual object, allowing to e.g. customize shaders by object without duplicating the shader. In order to make supporting this easier for Eevee, it is necessary to explicitly choose whether the attribute is varying or uniform via a dropdown option of the Attribute node. The dropdown also allows choosing whether instancing should be taken into account. The Cycles design treats all attributes as one common namespace, so the Blender interface converts the enum to a name prefix that can't be entered using keyboard. In Eevee, the attributes are provided to the shader via a UBO indexed with resource_id, similar to the existing Object Info data. Unlike it, however, it is necessary to maintain a separate buffer for every requested combination of attributes. This is done using a hash table with the attribute set as the key, as it is expected that technically different but similar materials may use the same set of attributes. In addition, in order to minimize wasted memory, a sparse UBO pool is implemented, so that chunks that don't contain any data don't have to be allocated. The back-end Cycles code is already refactored and committed by Brecht. Differential Revision: https://developer.blender.org/D2057
2020-09-19Cleanup: consistent TODO/FIXME formatting for namesCampbell Barton
Following the most widely used convention for including todo's in the code, that is: `TODO(name):`, `FIXME(name)` ... etc.
2020-09-16Fix T80107 Selection: Regression in Box selectionClément Foucault
The Draw State now needs to be in sync with what the selection code set. We query the state just before locking it.
2020-09-12GPU: Add Image Load Store extension supportClément Foucault
This wraps the functionality used to speedup EEVEE volumetrics. This touches the rendering code of EEVEE as it should fix a mis-usage of the GL barrier. The barrier changed type and location, removing an unused barrier.
2020-09-07GPU: Rename gpu_extensions to gpu_capabilitiesClément Foucault
This makes more sense as this module has more to it than just GL extensions.
2020-09-06GPUVertBuf: Make GPUVertBuf private to the GPU moduleClément Foucault
This is just a cleanup to isolate the internals of the vertbuf. This adds some getters to avoid refactor of existing code.
2020-09-01GPU: Move UBO binding validation to GL backendClément Foucault
This also make the validation quicker by tracking the currently bound slots.
2020-08-30GPUFrameBuffer: GL backend isolationClément Foucault
This is related to the Vulkan port T68990. This is a full cleanup of the Framebuffer module and a separation of OpenGL related functions. There is some changes with how the default framebuffers are handled. Now the default framebuffers are individually wrapped inside special GLFrameBuffers. This make it easier to keep track of the currently bound framebuffer state and have some specificity for operations on these framebuffers. Another change is dropping the optimisation of only configuring the changed attachements during framebuffers update. This does not give any benefits and add some complexity to the code. This might be brought back if it has a performance impact on some systems. This also adds support for naming framebuffers but it is currently not used.
2020-08-28Fix T80160: Workbench shadows are brokenJeroen Bakker
In recent refactoring {a9f2ebb21508} an issue was introduced that the opengl rasterizer would be disabled when only writing to a stencil buffer. This fix adds stencil writing to the write mask and set it. This makes the write map not evaluate to GPU_WRITE_NONE and the rasterizer will be enabled in `GLStateManager::set_write_mask`. Reviewed By: Clément Foucault Differential Revision: https://developer.blender.org/D8743
2020-08-22DRW: Fix state not being lockedClément Foucault
Regression introduced by rBe12c08e8d170b7ca40f204a5b0423c23a9fbc2c1
2020-08-21GPUShader: Make GPUShader* an opaque pointer to blender::gpu::ShaderClément Foucault
This avoids the misleading inheritance. Also cleanup by setting the blender::gpu::Shader as active shader to avoid some casting.
2020-08-21GPUUniformBuf: Rename struct and change API a bitClément Foucault
This follows the GPU module naming of other buffers. We pass name to distinguish each GPUUniformBuf in debug mode. Also remove DRW_uniform_buffer interface.
2020-08-20DRW: Remove some more direct gl state modification.Clément Foucault
2020-08-19DRW: Fix crash drawing gpencilClément Foucault
2020-08-18GPUState: Port default state to StateManager constructorClément Foucault
2020-08-18Cleanup: DRW: Use GPUState instead of raw opengl callsClément Foucault
Should not break anything! Huh!
2020-08-18GPUShader: GL backend isolationClément Foucault
2020-08-13GPUShader: Change shader state tracking to be part of the GPUContextClément Foucault
This remove the use of batch->program and replace it with batch->shader. This will allow GL abstraction latter.
2020-08-13GPUBatch: Remove usage of gl_prim_type outside of GPU moduleClément Foucault