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-09-07DRW: update test 'draw_pass_all_commands'Germano Cavalcante
It was incorrectly updated in rBc226c480079fc07e3784f673b1bac4a774fe7937
2022-09-06Update DRW testsGermano Cavalcante
And remove retest of `GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR`.
2022-09-06GPU/DRW: Fix testClément Foucault
Regression introduced in rB755e728a9840
2022-09-02DRWManager: New implementation.Clément Foucault
This is a new implementation of the draw manager using modern rendering practices and GPU driven culling. This only ports features that are not considered deprecated or to be removed. The old DRW API is kept working along side this new one, and does not interfeer with it. However this needed some more hacking inside the draw_view_lib.glsl. At least the create info are well separated. The reviewer might start by looking at `draw_pass_test.cc` to see the API in usage. Important files are `draw_pass.hh`, `draw_command.hh`, `draw_command_shared.hh`. In a nutshell (for a developper used to old DRW API): - `DRWShadingGroups` are replaced by `Pass<T>::Sub`. - Contrary to DRWShadingGroups, all commands recorded inside a pass or sub-pass (even binds / push_constant / uniforms) will be executed in order. - All memory is managed per object (except for Sub-Pass which are managed by their parent pass) and not from draw manager pools. So passes "can" potentially be recorded once and submitted multiple time (but this is not really encouraged for now). The only implicit link is between resource lifetime and `ResourceHandles` - Sub passes can be any level deep. - IMPORTANT: All state propagate from sub pass to subpass. There is no state stack concept anymore. Ensure the correct render state is set before drawing anything using `Pass::state_set()`. - The drawcalls now needs a `ResourceHandle` instead of an `Object *`. This is to remove any implicit dependency between `Pass` and `Manager`. This was a huge problem in old implementation since the manager did not know what to pull from the object. Now it is explicitly requested by the engine. - The pases need to be submitted to a `draw::Manager` instance which can be retrieved using `DRW_manager_get()` (for now). Internally: - All object data are stored in contiguous storage buffers. Removing a lot of complexity in the pass submission. - Draw calls are sorted and visibility tested on GPU. Making more modern culling and better instancing usage possible in the future. - Unit Tests have been added for regression testing and avoid most API breakage. - `draw::View` now contains culling data for all objects in the scene allowing caching for multiple views. - Bounding box and sphere final setup is moved to GPU. - Some global resources locations have been hardcoded to reduce complexity. What is missing: - ~~Workaround for lack of gl_BaseInstanceARB.~~ Done - ~~Object Uniform Attributes.~~ Done (Not in this patch) - Workaround for hardware supporting a maximum of 8 SSBO. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D15817
2022-07-08Draw: Curve outline drawing in object mode.Jeroen Bakker
This patch adds (selected/active) outline around a curve object in object mode. {F13270680} In the past the draw bounds option was enabled for any curve objects. With this patch it isn't needed and will be disabled. In the future the curve outline could also be enabled to improve GPU selection. Reviewed By: dfelinto, HooglyBoogly, fclem Maniphest Tasks: T95933 Differential Revision: https://developer.blender.org/D15308
2022-07-07Curves: Add sculpt selection overlayHans Goudey
This commit adds visualization to the selection in curves sculpt mode. Previously it was only possible to see the selection when it was connected to a material. In order to obstruct the users vision as little as possible, the selected areas of the curve are left as is, but a dark overlay is drawn over unselected areas. To make it work, the overlay requests the selection attribute and then ensures that the evaluation is complete for curves. Then it retrieves the evaluated selection GPU texture and passes that to the shader. This reuses the existing generic attribute extraction system because there currently wouldn't be any benefits to dealing with selection separately, and because it avoids duplication of the logic that extracts attributes from curves and evaluates them if necessary. Differential Revision: https://developer.blender.org/D15219
2022-05-01Cleanup: Overlay: Remove unused extern datatoc and shader libraryClément Foucault
These are not needed anymore.
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-01-31Image Editor: Fix background drawing of empty tiles.Jeroen Bakker
Empty (UDIM) tiles where drawn with a transparency checkerboard. They should be rendered with a border background. The cause is that the image engine would select a single area that contained all tiles and draw them as being part of an image. The fix is to separate the color and depth part of the image engine shader and only draw the depths of tiles that are enabled.
2022-01-28Draw: Remove unused shader.Jeroen Bakker
tile images aren't a special case anymore for the image engine.
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
2021-11-09Cleanup: clang-formatCampbell Barton
2021-11-08Basic engine shaders testJarrett Johnson
This patch adds shader compilation tests for the basic engine in `shaders_test.cc` Addresses T92701 Reviewed By: jbakker Differential Revision: https://developer.blender.org/D13066
2021-11-02Cleanup: Change image engine to CPP.Jeroen Bakker
Added namespace blender::draw::image_engine. Code is still C-a-like. Only changed the obvious code style to CPP (structs, nullptr, casts).
2021-08-18T73434: Improve Weight Paint Overlay Drawing.Jeroen Bakker
Master multiplied the weight paint on top of the rendered image. This reduced readability. This patch removes the multiplication for weight painting and adds a hint of the geometry below the overlay. Reviewed By: Mets, pablodp606, campbellbarton Maniphest Tasks: T73434 Differential Revision: https://developer.blender.org/D12170
2021-06-28Cleanup GPU/Draw test cases.Jeroen Bakker
In preparation of supporting vulkan. Draw/GPU tests should use GPU_TEST or DRAW_TEST macros. These macros will run the test on available drawing context backends like OpenGL or Vulkan. As in master there is only an OpenGL backend nothing changed.
2021-06-22Draw: Added testcases for hair refine shaders.Jeroen Bakker
2021-05-14DrawTest: Make setup method public.Jeroen Bakker
This allows other tests to override it.
2021-05-14Draw: Put DrawTest in its own compile unit.Jeroen Bakker
DrawTest will be used by other tests as well.
2021-03-14Cleanup: EEVEE: Remove the horizon search layered shaderClément Foucault
This shader is of no use now that we the fullres hizbuffer.
2021-03-13Cleanup: EEVEE: Remove SSR shader variationsClément Foucault
2021-03-13Cleanup: EEVEE: Remove hammersley texture and split hammersley codeClément Foucault
2021-02-13EEVEE: Depth of field: New implementationClément Foucault
This is a complete refactor over the old system. The goal was to increase quality first and then have something more flexible and optimised. |{F9603145} | {F9603142}|{F9603147}| This fixes issues we had with the old system which were: - Too much overdraw (low performance). - Not enough precision in render targets (hugly color banding/drifting). - Poor resolution near in-focus regions. - Wrong support of orthographic views. - Missing alpha support in viewport. - Missing bokeh shape inversion on foreground field. - Issues on some GPUs. (see T72489) (But I'm sure this one will have other issues as well heh...) - Fix T81092 I chose Unreal's Diaphragm DOF as a reference / goal implementation. It is well described in the presentation "A Life of a Bokeh" by Guillaume Abadie. You can check about it here https://epicgames.ent.box.com/s/s86j70iamxvsuu6j35pilypficznec04 Along side the main implementation we provide a way to increase the quality by jittering the camera position for each sample (the ones specified under the Sampling tab). The jittering is dividing the actual post processing dof radius so that it fills the undersampling. The user can still add more overblur to have a noiseless image, but reducing bokeh shape sharpness. Effect of overblur (left without, right with): | {F9603122} | {F9603123}| The actual implementation differs a bit: - Foreground gather implementation uses the same "ring binning" accumulator as background but uses a custom occlusion method. This gives the problem of inflating the foreground elements when they are over background or in-focus regions. This is was a hard decision but this was preferable to the other method that was giving poor opacity masks for foreground and had other more noticeable issues. Do note it is possible to improve this part in the future if a better alternative is found. - Use occlusion texture for foreground. Presentation says it wasn't really needed for them. - The TAA stabilisation pass is replace by a simple neighborhood clamping at the reduce copy stage for simplicity. - We don't do a brute-force in-focus separate gather pass. Instead we just do the brute force pass during resolve. Using the separate pass could be a future optimization if needed but might give less precise results. - We don't use compute shaders at all so shader branching might not be optimal. But performance is still way better than our previous implementation. - We mainly rely on density change to fix all undersampling issues even for foreground (which is something the reference implementation is not doing strangely). Remaining issues (not considered blocking for me): - Slight defocus stability: Due to slight defocus bruteforce gather using the bare scene color, highlights are dilated and make convergence quite slow or imposible when using jittered DOF (or gives ) - ~~Slight defocus inflating: There seems to be a 1px inflation discontinuity of the slight focus convolution compared to the half resolution. This is not really noticeable if using jittered camera.~~ Fixed - Foreground occlusion approximation is a bit glitchy and gives incorrect result if the a defocus foreground element overlaps a farther foreground element. Note that this is easily mitigated using the jittered camera position. |{F9603114}|{F9603115}|{F9603116}| - Foreground is inflating, not revealing background. However this avoids some other bugs too as discussed previously. Also mitigated with jittered camera position. |{F9603130}|{F9603129}| - Sensor vertical fit is still broken (does not match cycles). - Scattred bokeh shapes can be a bit strange at polygon vertices. This is due to the distance field stored in the Bokeh LUT which is not rounded at the edges. This is barely noticeable if the shape does not rotate. - ~~Sampling pattern of the jittered camera position is suboptimal. Could try something like hammersley or poisson disc distribution.~~Used hexaweb sampling pattern which is not random but has better stability and overall coverage. - Very large bokeh (> 300 px) can exhibit undersampling artifact in gather pass and quite a bit of bleeding. But at this size it is preferable to use jittered camera position. Codewise the changes are pretty much self contained and each pass are well documented. However the whole pipeline is quite complex to understand from bird's-eye view. Notes: - There is the possibility of using arbitrary bokeh texture with this implementation. However implementation is a bit involved. - Gathering max sample count is hardcoded to avoid to deal with shader variations. The actual max sample count is already quite high but samples are not evenly distributed due to the ring binning method. - While this implementation does not need 32bit/channel textures to render correctly it does use many other textures so actual VRAM usage is higher than previous method for viewport but less for render. Textures are reused to avoid many allocations. - Bokeh LUT computation is fast and done for each redraw because it can be animated. Also the texture can be shared with other viewport with different camera settings.
2021-01-05Fix T84053: Mask overlay in image editor not workingJeroen Bakker
The mask overlay wasn't part of the overlay engine. The reasoning nehind this was that more editors used the mask overlay and most of them used old drawing code. This patch adds the mask overlay drawing to the draw overlay engine. This code path will only be used by the image editor VSE, Compositor and Movie Clip editor will still use the previous method. During this patch some alternatives have been researched: 1. `ED_mask_draw_region`: this would lead to different code paths when drawing in the image editor, and some hacks to retrieve the correct framebuffer. 2. Add mask drawing to image engine: Would lead to incorrect color management when viewing the mask. 3. Add mask drawing to image engine and overlay engine: Would lead to duplicated code. 4. Add mask drawing to overlay engine and for combined overlay select the correct framebuffer. Option 4 was chosen as the exception (switching framebuffers) can be done without hacks. The code stays clean.
2020-12-08shaders_test: correct arguments to EEVEE_shaders_cryptomatte_sh_getCampbell Barton
2020-12-04EEVEE CryptomatteJeroen Bakker
Cryptomatte is a standard to efficiently create mattes for compositing. The renderer outputs the required render passes, which can then be used in the compositor to create masks for specified objects. Unlike the Material and Object Index passes, the objects to isolate are selected in compositing, and mattes will be anti-aliased. Cryptomatte was already available in Cycles this patch adds it to the EEVEE render engine. Original specification can be found at https://raw.githubusercontent.com/Psyop/Cryptomatte/master/specification/IDmattes_poster.pdf **Accurate mode** Following Cycles, there are two accuracy modes. The difference between the two modes is the number of render samples they take into account to create the render passes. When accurate mode is off the number of levels is used. When accuracy mode is active, the number of render samples is used. **Deviation from standard** Cryptomatte specification is based on a path trace approach where samples and coverage are calculated at the same time. In EEVEE a sample is an exact match on top of a prepared depth buffer. Coverage is at that moment always 1. By sampling multiple times the number of surface hits decides the actual surface coverage for a matte per pixel. **Implementation Overview** When drawing to the cryptomatte GPU buffer the depth of the fragment is matched to the active depth buffer. The hashes of each cryptomatte layer is written in the GPU buffer. The exact layout depends on the active cryptomatte layers. The GPU buffer is downloaded and integrated into an accumulation buffer (stored in CPU RAM). The accumulation buffer stores the hashes + weights for a number of levels, layers per pixel. When a hash already exists the weight will be increased. When the hash doesn't exists it will be added to the buffer. After all the samples have been calculated the accumulation buffer is processed. During this phase the total pixel weights of each layer is mapped to be in a range between 0 and 1. The hashes are also sorted (highest weight first). Blender Kernel now has a `BKE_cryptomatte` header that access to common functions for cryptomatte. This will in the future be used by the API. * Alpha blended materials aren't supported. Alpha blended materials support in render passes needs research how to implement it in a maintainable way for any render pass. This is a list of tasks that needs to be done for the same release that this patch lands on (Blender 2.92) * T82571 Add render tests. * T82572 Documentation. * T82573 Store hashes + Object names in the render result header. * T82574 Use threading to increase performance in accumulation and post processing. * T82575 Merge the cycles and EEVEE settings as they are identical. * T82576 Add RNA to extract the cryptomatte hashes to use in python scripts. Reviewed By: Clément Foucault Maniphest Tasks: T81058 Differential Revision: https://developer.blender.org/D9165
2020-11-17Fix T82064: Add Image Clone tool to overlay engineJeroen Bakker
The clone tool in the image editor can show a second texture on top of the image. This wasn't ported and now results into alpha and depth issues. This fix adds the clone tool drawing to the overlay engine. Reviewed By: Clément Foucault Differential Revision: https://developer.blender.org/D9352
2020-10-07Fix T81254: Incorrect calculation of EEVEE Transmittance VolumetricsJeroen Bakker
Regular rendering uses a custom blend mode, but render passes renders to 2 separate textures. This wasn't configured correctly inside the fragment shaders. This patch adds a switch to configure the fragment shader with the correct attachments. Backport to Blender 2.83. Reviewed By: Clément Foucault Differential Revision: https://developer.blender.org/D9038
2020-10-02Cleanup: trailing spaceCampbell Barton
2020-09-16Fix building with tests enabledClément Foucault
2020-09-15Liquid Simulation Display Options (GSoC 2020)Sriharsha Kotcharlakot
All the changes made in the branch `soc-2020-fluid-tools` are included in this patch. **Major changes:** === Viewport Display === - //Raw voxel display// or //closest (nearest-neighbor)// interpolation for displaying the underlying voxel data of the simulation grids more clearly. - An option to display //gridlines// when the slicing method is //single//. ==== Grid Display ==== - Visualization for flags, pressure and level-set representation grids with a fixed color coding based on Manta GUI. ==== Vector Display ==== - //**M**arker **A**nd **C**ell// grid visualization options for vector grids like velocity or external forces. - Made vector display options available for external forces. ==== Coloring options for //gridlines// ==== - Range highlighting and cell filtering options for displaying the simulation grid data more precisely. - Color gridlines with flags. - Also, made slicing and interpolation options available for Volume Object. Reviewed By: JacquesLucke, sebbas Differential Revision: https://developer.blender.org/D8705
2020-09-14DrawManager: Resolve Assert in Image EngineJeroen Bakker
Tiled texture uses different texture structure than normal textures. Normally we add dummy textures and use them, but I found it cleaner to have 2 shaders and use the correct shader.
2020-09-11Use DrawManager for Image/UV EditorJeroen Bakker
This project moves the current UV/Image editor drawing to the draw manager. Why would we do this: **Performance**: Current implementation would draw each texel per time. Multiple texels could be drawn per pixel what would overwrite the previous result. You can notice this when working with large textures. Repeat image drawing made this visible by drawing for a small period of time and stop drawing the rest. Now the rendering is fast and all repeated images are drawn. **Alpha drawing**: Current implementation would draw directly in display space. Giving incorrect results when displaying alpha transparent images. This addresses {T52680}, {T74709}, {T79518} The image editor now can show emission only colors. See {D8234} for examples. **Current Limitations** Using images that are larger than supported by your GPU are resized (eg larger than 16000x16000 are resized to 8k). This leaves some blurring artifacts. It is a low priority to add support back of displaying individual pixels of huge images. There is a design task {T80113} with more detail. **Implementation overview** Introduced an Image Engine in the draw module. this engine is responsible for drawing the texture in the main area of the UV/Image editor. The overlay engine has a edit_uv overlay which is responsible to draw the UV's, shadows and overlays specifically for the UV Image editor. The background + checker pattern is drawn by the overlay_background. The patch will allow us to share overlays between the 3d viewport and UV/Image editor more easily. In most cases we just need to switch the `pos` with the `u` attribute in the vertex shader. The project can be activated in the user preferences as experimental features. In a later commit this will be reversed. Reviewed By: Clément Foucault Differential Revision: https://developer.blender.org/D8234
2020-09-08GPU: Extract GPU Base Test caseJeroen Bakker
The draw manager test case initialized ghost, gpu and draw manager. This change splits the base test case to GPU specific and draw manager specific test case. The GPU test base test case will be used for low level GPU tests.
2020-09-08DrawManager: Fixed memory leak in test casesJeroen Bakker
Memory leak is introduced as test cases reinitializes the GPU stack. Added a call to GPU_backend_exit to fix this. In GPU_backend_exit the GPU backend was destroyed but the pointer wasn't reset for reuse. This patch also clears the pointer to be reused.
2020-09-08DrawManager: Move tests in namespaceJeroen Bakker
Using blender::draw::tests as namespaces.
2020-09-08Cleanup: DRW: Replace 0 by NULL in GPU_context_create callsClément Foucault
This was left from a previous refactor.
2020-09-07EEVEE: Shaders testsJeroen Bakker
This will add the remaining static shaders to the eevee shader test suite. - Downsampling - GGX LUT generation - Mist - Motion Blur - Ambient Occlusion - Render Passes - Screen Raytracing - Shadows - Subsurface - Volumes Reviewed By: Clément Foucault Differential Revision: https://developer.blender.org/D8779
2020-09-02EEVEE: Shader tests for Depth of FieldJeroen Bakker
This patch moves the EEVEE depth of field shaders to eevee_shaders.c and adds them to the eevee shaders test suite. Reviewed By: Clément Foucault Differential Revision: https://developer.blender.org/D8771
2020-09-01Cleanup: EEVEE bloom shadersJeroen Bakker
- moved to eevee_shaders - added to test suite Reviewed By: Clément Foucault Differential Revision: https://developer.blender.org/D8763
2020-09-01GHOST: Enable debug context on offscreen context tooClément Foucault
This was a long standing TODO. This was also preventing debug callbacks form other context than the main window.
2020-08-28DrawEngine: Shader Test SuiteJeroen Bakker
A test case that compiles all the GLSL shaders for workbench, gpencil, overlay and some of eevee. Compilation is still platform dependent, but when run on a test-farm with different hardware we will be able to detect GLSL compilation errors early on. The test will be compiled when `WITH_GTEST` and `WITH_OPENGL_DRAW_TESTS` are On. For eevee only the shaders inside eevee_shaders.c are included. EEVEE has some shaders located inside the submodule. They aren't accessible to the outside and aren't added to the test case. We should see how we want to add them. For the test cases it is better to move them to eevee_shaders.c, but for eevee perspective it is better to keep them in the submodule. Keeping them in the submodule could lead to situations that is harder to test. as the shader could already have been initialized. Reviewed By: Clément Foucault Differential Revision: https://developer.blender.org/D8667