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
2021-04-28Fix T87464 EEVEE: Crash with deformation Motion BlurClément Foucault
This was caused by the new depsgraph persistence. The GPUbatches we got from the cache being the same for each frame means that we need to be more careful about cleanning the additional VBOs references. Moving the `EEVEE_motion_blur_swap_data` function call at the end of the loop makes sure the references are cleaned.
2021-03-14Cleanup: EEVEE: Remove unused mipmapping on main color bufferClément Foucault
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-02-21Fix T85714 Crash when Viewport Rending an image using EEVEE.Clément Foucault
Was caused by non initialized render_timesteps.
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-02-05Cleanup: correct spelling in commentsCampbell Barton
2021-01-05Eevee Cryptomatte: Store hashes in render result meta dataJeroen Bakker
Stores cryptomatte hashes as meta data to the render result. Compositors could use this for lookup on names in stead of hashes. Differential Revision: https://developer.blender.org/D9553
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-06Cleanup: use ELEM macroCampbell Barton
2020-10-13EEVEE: Motion Blur: Add shutter position optionClément Foucault
This makes it easier to generate motion trail effect with EEVEE. This just mimics the cycles option as described here: https://docs.blender.org/manual/en/latest/render/cycles/render_settings/motion_blur.html This fix T80070
2020-10-13Fix T80086 EEVEE: Motion Blur: Subframe not taken into accountClément Foucault
This is a simple fix that just make it work like cycles. The initial time was missing the subframe offset.
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-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-07Cleanup: declare arrays arrays where possibleCampbell Barton
2020-08-07Merge branch 'blender-v2.90-release'Clément Foucault
2020-08-07Fix T78452 EEVEE: Motion Blur: Crash when using camera switchingClément Foucault
This was caused by the ViewLayer being freed with all its engine data.
2020-08-05Merge branch 'blender-v2.90-release' into masterCampbell Barton
2020-08-05Fix T79213 EEVEE: rendering with motion blur can change current frameClément Foucault
It seems to be expected that the render engine reset to the right CFRA if it modifies it.
2020-07-30Cleanup: Split gpu_texture_image.c into BKE and IMB modulesClément Foucault
This is in order to disolve GPU_draw.h into more meaningful code blocks. All the Image related function are in `image_gpu.c`. All the MovieClip related function are in `movieclip.c`. The IMB module now has a connection with GPU. This is not strickly necessary and the code could be move to `image_gpu.c` if needed. The Image garbage collection is also ported to `image_gpu.c`.
2020-07-20Python API: option to use OpenGL context in RenderEngine.renderMiguel Pozo
When bl_use_gpu_context is set, an OpenGL context will be available for OpenGL based render engines. Differential Revision: https://developer.blender.org/D8305
2020-06-25Fix unreported 1 pixel offset when drawing with GPencilAntonio Vazquez
This bug was introduced in d82c3d86155e Reviewers: @fclem
2020-06-24Fix T67741 EEVEE: World update don't update lightcache if one viewport uses ↵Clément Foucault
lookdev Just a matter of not clearing the updating flag in this case.
2020-06-24Fix T78215 EEVEE: incorrect Render Passes results when using motion blurClément Foucault
This was caused by a missing DRWPass initialization. Now we create the passes for every timestep but avoid clearing the buffer after the first sample.
2020-06-24EEVEE: Fix crash when using motion blur without postfx blurClément Foucault
2020-06-24Fix T78190 EEVEE: Render passes broken in final renderClément Foucault
This was caused by the step motion blur implementation. `DRW_cache_restart` was reseting the cache and cause `EEVEE_renderpasses_postprocess` to not work inside `EEVEE_render_read_result`.
2020-06-23Fix T62961 EEVEE: Viewport refresh when hovering widgetsClément Foucault
We now bypass EEVEE's rendering if the TAA accumulation has ended.
2020-06-23EEVEE: Motion Blur: Add accumulation motion blur for better precisionClément Foucault
This revisit the render pipeline to support time slicing for better motion blur. We support accumulation with or without the Post-process motion blur. If using the post-process, we reuse last step next motion data to avoid another scene reevaluation. This also adds support for hair motion blur which is handled in a similar way as mesh motion blur. The total number of samples is distributed evenly accross all timesteps to avoid sampling weighting issues. For this reason, the sample count is (internally) rounded up to the next multiple of the step count. Only FX Motion BLur: {F8632258} FX Motion Blur + 4 time steps: {F8632260} FX Motion Blur + 32 time steps: {F8632261} Reviewed By: jbakker Differential Revision: https://developer.blender.org/D8079
2020-06-19EEEVEE: Object Motion Blur: Initial ImplementationClément Foucault
This adds object motion blur vectors for EEVEE as well as better noise reduction for it. For TAA reprojection we just compute the motion vector on the fly based on camera motion and depth buffer. This makes possible to store another motion vector only for the blurring which is not useful for TAA history fetching. Motion Data is saved per object & per geometry if using deformation blur. We support deformation motion blur by saving previous VBO and modifying the actual GPUBatch for the geometry to include theses VBOs. We store Previous and Next frame motion in the same motion vector buffer (RG for prev and BA for next). This makes non linear motion blur (like rotating objects) less prone to outward/inward blur. We also improve the motion blur post process to expand outside the objects border. We use a tile base approach and the max size of the blur is set via a new render setting. We use a background reconstruction method that needs another setting (Background Separation). Sampling is done using a fixed 8 dithered samples per direction. The final render samples will clear the noise like other stochastic effects. One caveat is that hair particles are not yet supported. Support will come in another patch. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D7297
2020-06-18Cleanup: redundant parenthesisCampbell Barton
2020-06-02EEVEE: Refactor of eevee_material.cClément Foucault
These are the modifications: -With DRW modification we reduce the number of passes we need to populate. -Rename passes for consistent naming. -Reduce complexity in code compilation -Cleanup how renderpass accumulation passes are setup, using pass instances. -Make sculpt mode compatible with shadows -Make hair passes compatible with SSS -Error shader and lookdev materials now use standalone materials. -Support default shader (world and material) using a default nodetree internally. -Change BLEND_CLIP to be emulated by gpu nodetree. Making less shader variations. -Use BLI_memblock for cache memory allocation. -Renderpasses are handled by switching a UBO ref bind. One major hack in this patch is the use of modified pointer as ghash keys. This rely on the assumption that the keys will never overlap because the number of options per key will never be bigger than the pointed struct. The use of one single nodetree to support default material is also a bit hacky since it won't support concurent usage of this nodetree. (see EEVEE_shader_default_surface_nodetree) Another change is that objects with shader errors now appear solid magenta instead of shaded magenta. This is only because of code reuse purpose but could be changed if really needed. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D7642
2020-03-20Python API: add bl_use_stereo_viewport for RenderEngineBrecht Van Lommel
To indicate if the render engine supports rendering a stereo 3D viewport. This is not currently supported for Cycles. Fixes T62582
2020-03-18Objects: Eevee and workbench rendering of new Volume, Hair, PointCloudBrecht Van Lommel
Only the volume drawing part is really finished and exposed to the user. Hair plugs into the existing hair rendering code and is fairly straightforward. The pointcloud drawing is a hack using overlays rather than Eevee and workbench. The most tricky part for volume rendering is the case where each volume grid has a different transform, which requires an additional matrix in the shader and non-trivial logic in Eevee volume drawing. In the common case were all the transforms match we don't use the additional per-grid matrix in the shader. Ref T73201, T68981 Differential Revision: https://developer.blender.org/D6955
2020-02-27Cleanup: split off hair cache function for reusabilityBrecht Van Lommel
For when we support sources of hair other than particle systems.
2020-02-25EEVEE: First Buffer Drawn IncorrectlyJeroen Bakker
SSS buffers are lazy initialized when needed. When shaders recompile the SSS buffers could be incorrectly drawn. During the render passes project we tried to fix this, but that resulted in incorrect result of the first sample after a shader was compiled. We revert this change knowing that we know the issue, but haven't found a proper solution for it.
2020-02-22EEVEE: Fix memleak when G.is_break is set from another threadClément Foucault
2020-02-21EEVEE: Render PassesJeroen Bakker
This patch adds new render passes to EEVEE. These passes include: * Emission * Diffuse Light * Diffuse Color * Glossy Light * Glossy Color * Environment * Volume Scattering * Volume Transmission * Bloom * Shadow With these passes it will be possible to use EEVEE effectively for compositing. During development we kept a close eye on how to get similar results compared to cycles render passes there are some differences that are related to how EEVEE works. For EEVEE we combined the passes to `Diffuse` and `Specular`. There are no transmittance or sss passes anymore. Cycles will be changed accordingly. Cycles volume transmittance is added to multiple surface col passes. For EEVEE we left the volume transmittance as a separate pass. Known Limitations * All materials that use alpha blending will not be rendered in the render passes. Other transparency modes are supported. * More GPU memory is required to store the render passes. When rendering a HD image with all render passes enabled at max extra 570MB GPU memory is required. Implementation Details An overview of render passes have been described in https://wiki.blender.org/wiki/Source/Render/EEVEE/RenderPasses Future Developments * In this implementation the materials are re-rendered for Diffuse/Glossy and Emission passes. We could use multi target rendering to improve the render speed. * Other passes can be added later * Don't render material based passes when only requesting AO or Shadow. * Add more passes to the system. These could include Cryptomatte, AOV's, Vector, ObjectID, MaterialID, UV. Reviewed By: Clément Foucault Differential Revision: https://developer.blender.org/D6331
2020-02-11DRW: Color Management improvementClément Foucault
Reviewed By: brecht sergey jbakker Differential Revision: http://developer.blender.org/D6729
2020-01-30EEVEE: Test maximum texture size before render.Clément Foucault
This will catch any non renderable size.
2020-01-17Fix T71154: EEVEE Soft Shadows Viewport RenderingJeroen Bakker
EEVEE Soft shadows were not rendered correctly during viewport rendering. The reason for this is that during viewport rendering the shadow buffers were only update once and not per sample. This resulted that all the samples calculated the same shadow. This fix moves the call to `EEVEE_shadows_update` from cache finished to draw scene. This needs to happen before `EEVEE_lightprobes_refresh`. Reviewed By: fclem Differential Revision: https://developer.blender.org/D6538
2019-12-11Cleanup: spellingCampbell Barton
2019-11-28EEVEE: Viewport RenderpassesJeroen Bakker
This patch will allow the user to select the EEVEE renderpass to be shown in the viewport by default the combined pass will be shown. Limitations: * Viewport rendering stores the result in a `RenderResult`. RenderResult is not aware of the type of data it holds. In many places where RenderResult is used it is assumed that it stores a combined pass and the display+view transform are applied. I will propose to fix this in a future patch. But that is still being designed and discussed. Reviewed By: fclem Differential Revision: https://developer.blender.org/D6319
2019-11-27EEVEE: GLSL RenderpassesJeroen Bakker
Most of the renderpasses in EEVEE used post-processing on the CPU. For final image rendering this is sufficient, but when we want to display the data to the user we don't want to transfer to the CPU to do post processing to then upload it back to the GPU to display the result. This patch moves the renderpass postprocessing to a GLSL shader. This is the first step to do, before we will enable the renderpasses in the viewport. Reviewed By: fclem Differential Revision: https://developer.blender.org/D6206
2019-09-05Eevee: Shadow map refactorClément Foucault
Reviewed By: brecht Differential Revision: http://developer.blender.org/D5659
2019-08-14Eevee: Improve Transparent BSDF behaviorClément Foucault
Alpha blended Transparency is now using dual source blending making it fully compatible with cycles Transparent BSDF. Multiply and additive blend mode can be achieved using some nodes and are going to be removed.
2019-07-09Eevee: Fix first sample being accumulated without SSRClément Foucault
We check if the previous iteration (sample) was using a valid double buffer. If it wasn't, we request another iteration. This fix the issue for viewport,viewport render and image render. Related to T65761 Eevee render inconsistency between 3D View, Viewport render, and F12 Render
2019-06-14Fix T64913 Eevee: shader compilation does not reset TAAClément Foucault
This tracks the number of compiling shaders and just reset the TAA if previous number mismatch.
2019-06-06Python API: allow external render engines to use Eevee for LookDev shadingBrecht Van Lommel
This is enabled with bl_use_eevee_viewport = True. It allows external engines to generate an Cycles/Eevee shader node setup to emulate their materials in the realtime viewport, or to leave it to users to do manually. Removed bl_use_exclude_layers and bl_use_shading_nodes that did nothing anymore. This should not break API compatibility, any scripts setting those should continue to work the same as before. Also adds descriptions for some RenderEngine settings.
2019-05-23Eevee: Ignore COW tag when deciding on auto-bakeSergey Sharybin
This is too generic flag, and it might be used by anything, starting from changes in transform ending with changes in ID properties. The check here is to be as specific as possible. If that is not possible the decision must be documented. Related on T63111. Reviewers: brecht Differential Revision: https://developer.blender.org/D4923