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-03-13EEVEE: ScreenSpaceReflections: Add back multi ray-hitpoint reuseClément Foucault
We now reuse 9 hitpoints from the neighboorhood using a blue noise sample distribution as mentionned in the reference presentation. Reusing more rays does however make some area a bit more blury. The resulting noise is quite lower compared to previous implementation which was only reusing 4 hits.
2021-03-13EEVEE: ScreenSpaceReflections: Increase depth thresholdClément Foucault
This avoids going through geometry when ray have certain angle.
2021-03-13EEVEE: ScreenSpaceReflections: Jitter starting texelClément Foucault
This make sure the rays are generated randomly from a fullres texel center. This creates more noise but increase the convergence when doing half res tracing.
2021-03-13EEVEE: Fix split commitClément Foucault
2021-03-13Cleanup: EEVEE: Remove SSR shader variationsClément Foucault
2021-03-13Cleanup: EEVEE: Split effect_ssr.glslClément Foucault
This split is to make code easier to manage and rename the files to `effect_reflection_*` to avoid confusion. Also this cleans up a bit of the branching mess in the trace shader.
2021-03-13Cleanup: EEVEE: Remove hammersley texture and split hammersley codeClément Foucault
2021-03-13Cleanup: EEVEE: Make bsdf_sampling_lib.glsl more tidyClément Foucault
2021-03-11Cleanup: spellingCampbell Barton
2021-03-10EEVEE: ScreenSpaceReflections: Improve minimal hit thresholdClément Foucault
This makes the hit delta threshold dependant on the ray angle. If the ray is more aligned with the view, its intersection threshold gets bigger to avoid going through geometry. This improves reflections and fix T86448 refraction issue.
2021-03-10Cleanup: EEVEE: Remove unused function and fix commentClément Foucault
2021-03-10Fix T86429 EEVEE: Ambient occlusion broken on some platformClément Foucault
This was cause by a division by 0 if the ray direction had no depth difference. Adding a small epsilon fix the issue.
2021-03-10EEVEE: ScreenSpaceReflections: Add back support for planar reflectionsClément Foucault
We now have a new buffer to output reflection depth. This buffer is only usefull for non planar SSR but we use it to tag the planar rays. This also touch the raytrace algo for planars to avoid degenerate lines on vert sharp reflections.
2021-03-10Cleanup: EEVEE: Use correct prefix for view space vectorsClément Foucault
2021-03-10EEVEE: GGX: Use distribution of visible normal for samplingClément Foucault
This changes the sampling routine to use the method described in "A Simpler and Exact Sampling Routine for the GGXDistribution of Visible Normals" by Eric Heitz. http://jcgt.org/published/0007/04/01/slides.pdf This avoids generating bad rays and thus improve noise level in screen- space reflections / refraction.
2021-03-10EEVEE: ScreenSpaceReflections: Improve hit qualityClément Foucault
This changes the hitBuffer to store `ReflectionDir * HitTime, invPdf` just as the reference presentation. This avoids issues when the hit refinement produce a coordinate that does not land on the correct surface. We now store the pdf in the same texture and store it inversed so we can remove some ALU from the resolve shader. This also rewrite the resolve shader to not be vectorized to improve readability and scalability.
2021-03-10Cleanup: spellingCampbell Barton
2021-03-09BLI: New 'BLI_array_iter_spiral_square'Germano Cavalcante
No functional changes. This function replaces some of the logic in `DRW_select_buffer_find_nearest_to_point` that traverses a buffer in a spiral way to search for a closer pixel (not the closest). Differential Revision: https://developer.blender.org/D10548
2021-03-08Fix T86357: EEVEE: Shadows: Casters have exponential performance degradation ↵Mark Stead
with many objects When you have many distinct objects, in an Eevee render then the shadow caster gets exponentially slower as the number of (distinct) objects increase. This is because of the way that frontbuffer->bbox (EEVEE_BoundBox array) and the associated frontbuffer->update bitmap are resized. Currently the resizing is done by reserving space for SH_CASTER_ALLOC_CHUNK (32) objects at a time. When the number of objects is large, then the MEM_reallocN() gets progressively slower because it must memcpy the entire bbox/bitmap data to the new memory chunk. And there will be a lot of *memcpy* operations for a large scene. (Obviously there are a significant number of memory allocations/deallocations too - though this would be linear performance.) I've switched to doubling the frontbuffer->alloc_count (buffer capacity) instead of adding SH_CASTER_ALLOC_CHUNK (32). As I understand this is the only way to eliminate exponential slowdown. Just increasing the size of SH_CASTER_ALLOC_CHUNK would still result in exponential slowdown eventually. In other changes, the "+ 1" in this expression is not necessary. if (id + 1 >= frontbuffer->alloc_count) The buffer is 0-based. So when the buffer is initially allocated then id values from bbox[0] to bbox[31] are valid. Hence when frontbuffer->count == frontbuffer->alloc_count, is when the resizing should be triggered. As it stands the "+ 1" results in resizing the buffer, when there is still capacity for one more object in the buffer. I've changed the initial buffer allocation to use MEM_mallocN() instead of MEM_callocN(). The difference is that malloc() doesn't memset buffer (with zeros) when allocated. I've checked the code where new bbox records are created, and it does not rely on the buffer being initialised with zeros. Anyway, isn't calloc() safer than using malloc()? Well no, it's actually the opposite in this case. Every time the buffer size is increased, it is done using realloc(), and this does not zero-out the uniniitialised portion of the buffer. So the code would break if it was modified to assume that the buffer contains zeros. Hence I believe initialising the buffer using calloc() could be misleading to a new developer. Won't this result in increased memory usage? Yes, if you have millions of objects in your scene, then you are potentially using up-to twice the memory for the shadow caster. (However if you have millions of objects in your scene you're probably finding the Eevee render times a slow.) Note that once the render gets going the frontbuffer bbox/bitmap will be shrunk to a multiple of SH_CASTER_ALLOC_CHUNK (32), therefore releasing the overallocation of memory. As observed in Visual Studio - this appears to be prior to peak memory usage anyway. Note this shrinking is executed in EEVEE_shadows_update() - during the first render sample pass. If necessary you could consider shrinking the buffer immediately after the EEVEE_shadows_caster_register() has done it's work. (Note however it appears you would need to add that function call is multiple places.) Anyway as per the bug report I raised, I observed a 5% increase in peak-memory. And I'm unclear whether this difference in memory is due to me running the debug build. (It could be that there is no difference because of the shrinking.) I couldn't figure out how the shadow caster backbuffer works. I see that EEVEE_shadows_init() has an explicit command to swap the front/back buffers. However this is done only when the buffers are first initialised and there is nothing in there yet. In my testing, the backbuffer->count was always zero, EEVEE_shadows_update() never did anything with the backbuffer. Finally this problem is most evident when using Geometry Nodes or a Particle System to instantiate many objects. Objects created through say the array modifier do not cause any issues because it is considered one object by the shadow caster. Reviewed By: #eevee_viewport, fclem Differential Revision: https://developer.blender.org/D10631
2021-03-08Fix T81741 EEVEE: Ambient Occlusion does not converge properlyClément Foucault
This was due to the AO random sampling using the same "seed" as the AA jitter. Decorelating the noise fixes the issue.
2021-03-08EEVEE: RenderPass: Improve AO pass if screen space radius is smallClément Foucault
This just bypass the occlusion computation if there is no occlusion data. This avoids weird looking occlusion due to the screen space geometric normal reconstruction.
2021-03-08EEVEE: Occlusion: Use ScreenSpaceRay for iterationClément Foucault
The sampling is now optimum with every samples being at least one pixel appart. Also use a squared repartition to improve the sampling near the center. This also removes the thickness heuristic since it seems to remove a lot of details and bias the AO too much.
2021-03-08EEVEE: Sampling: Split hemisphere sampling just like GGXClément Foucault
This is useful for debugging raycasting.
2021-03-08EEVEE: SSRayTrace: Cleanup/RefactorClément Foucault
This is a major rewrite that improves the screen space raytracing a little bit. This also decouple ray preparation from raytracing to be reuse in other part of the code. This changes a few things: - Reflections have lower grazing angle failure - Reflections have less self intersection issues - Contact shadows are now fully opaque (faster) Unrelated but some self intersection / incorrect bad rays are caused by the ray reconstruction technique used by the SSR. This is not fixed by this commit but I added a TODO.
2021-03-08EEVEE: Use Fullscreen maxZBuffer instead of halfresClément Foucault
This removes the need for per mipmap scalling factor and trilinear interpolation issues. We pad the texture so that all mipmaps have pixels in the next mip. This simplifies the downsampling shader too. This also change the SSR radiance buffer as well in the same fashion.
2021-03-04Fix T86050: use material count from correct data blockJacques Lucke
See comment in code for more details. Differential Revision: https://developer.blender.org/D10615
2021-03-04Fix T86042 EEVEE: incorrect irradiance bakeClément Foucault
The environment (world) irradiance wasn't correctly skipped.
2021-03-03EEVEE: SSS: Fix light leaking bewteen object at different depthsMikhail
The SSS shader in Eevee has the following drawbacks (elaborated in {T79933}): 1. Glowing 2. Ringing. On low SSS jittering it is rendered a bunch of sharp lines 3. Overall blurriness due to the nature of the effect 4. Shadows near occlusions as in T65849 5. Too much SSS near the edge and on highly-tilted surfaces {F9438636} {F9427302} In the original shader code there was a depth correction factor, as far as I can understand for fixing light bleeding from one object to another. But it was scaled incorrectly. I modified its scale to depend on SSS scale*radius and made it independent from the scene scale. The scale parameter (`-4`) is chosen so that it makes tilted surfaces to have visually the same SSS radius as straight surfaces (surfaces with normal pointed directly to the camera). This depth correction factor alone fixes all the problems except for ringing (pt. 2). Because of float-point precision errors and irradiance interpolation some samples near the border of an object might leak light, causing sparkly or dashed (because of aliasing) patterns around the highlights. Switching from `texture()` to `texelFetch()` fixes this problem and makes textures on renders visually sharper. An alternative solution would be to detect object borders and somehow prevent samples from crossing it. This can be done by: 1. Adding an `object_id` texture. I think it requires much more code changing and makes the shader more complicated. Again, `object_id` is not interpolatable. 2. Watch gradient of depth and discard samples if the gradient is too big. This solution depends on scene scale and requires more texture lookups. Since SSS is usually a minor effect, it probably doesn't require that level of accuracy. I haven't notice it in practice, but I assume it can make visible SSS radius slightly off (up to 0.5 px in screen space, which is negligible). It is completely mitigated with render sampling. Reviewed By: Clément Foucault Differential Revision: https://developer.blender.org/D9740
2021-03-03EEVEE: SSR: Check reflection ray against geometric normalClément Foucault
This improve self intersection prevention. Also reduce the bias that was making a lot of rays not being shoot at grazing angles.
2021-03-03EEVEE: Add ensure_valid_reflection to glossy closuresClément Foucault
This is ported from Cycles and fixes issues with bump/normal mapping giving weird reflections/lighting. Fixes T81070 Specular light should be limited to normal pointing toward the camera Fixes T78501 Normal mapping making specular artifact
2021-03-02Cleanup: spelling, minor correctionsCampbell Barton
Also use doxygen comments for sculpt functions.
2021-03-02EEVEE: Fix incorrect volumetric light shadowingClément Foucault
The shadowing was computed on the light distance squared, leaking to much light since it was integrating the extinction behind the ligth itself. Also bump the maximum shadow max step to the actual UI values. Otherwise we get shadowing under evaluated because `dd` is too small.
2021-03-02Fix (unreported) light cache bake crashPhilipp Oeser
missing NULL check if there is no cache there to begin with. Differential Revision: https://developer.blender.org/D10581
2021-03-02Fix T86122: Performance Debug View Viewport Not WorkingJeroen Bakker
The performance debug menu isn't used that often anymore as render doc also show the timings. This patch will make sure that enabling the performance debug view (21) does not crash blender.
2021-03-02Fix error in rBb9e1cc931ee9Clément Foucault
Bad copy paste...
2021-03-02Fix T86138 EEVEE: Bake Indirect Lighting crash in 2.93 with older filesClément Foucault
This was caused by a missing version check.
2021-03-02EEVEE: Depth of field: Do not shrink highlights when using overblurClément Foucault
This fixes the issue of bokeh size being smaller when using overblur. The additional overblur needs to be centered on the outer radius.
2021-03-01Cryptomatte: Flexible Definition of CryptomatteLayers.Jeroen Bakker
Cryptomatte layers in Blender are predefined. Other render engines might have other naming schemes. This patch will allow creation of cryptomatte layers with other names. This will be used by D3959 to load cryptomatte openexr files from other render engines. EEVEE and Cycles still use our fix naming scheme so no changes are detectable by users.
2021-02-25Fix T85959 EEVEE: DOF with "Jitter Camera" brokenClément Foucault
Was caused by recent changes in window_translate_m4 by rBbb2af40ec7dd.
2021-02-25Cleanup: spellingCampbell Barton
2021-02-24Workbench: Fix typo in rB32ca8e58a374Clément Foucault
This was creating incorrectly occluded overlays.
2021-02-24Cleanup: CryptomatteLayer structure.Jeroen Bakker
Current implementation was to restricting for future enhancements where the CryptomatterLayer could be read from existing metadata.
2021-02-24Workbench: Fix samples taken outside of pixel footprintClément Foucault
With the previous implementation, we could have pixels with offset larger than 1 pixel. Also fix a bug when the closest_index is not last. The sample positions were incorrect in this case.
2021-02-24Fix T85726 Workbench: Orthographic view is blurryClément Foucault
This was caused by the window_translate_m4 not offsetting the winmat in the right direction for perspective view. Thus leading to incorrect weights. The workbench sample weight computation was also inverted. This fix will change the sampling pattern for EEVEE too (it will just mirror it in perspective view).
2021-02-24Cleanup: spellingCampbell Barton
2021-02-23Fix T85895: Viewing value passes in Image Editor displays the value as alphaPhilipp Oeser
There was a similar report prior to the introduction of the Image Engine, see T74586. This was fixed by rB6a5bd812b569 at that time, but got lost in the refactor it seems. Above commit introduced the `ED_space_image_get_display_channel_mask` function that will determine the valid bitflags for the display channel of a given ImBuf. But since the refactor, this is not called anymore (`draw_image_main` is not called anymore) Now it seems we can safely reuse that said function `ED_space_image_get_display_channel_mask` also for the Image Engine. Maniphest Tasks: T85895 Differential Revision: https://developer.blender.org/D10510
2021-02-22Fix T85609 EEVEE: Viewport "vibrates" when mouse input is activeClément Foucault
Taa offset was applied on first sample. This wasn't happening before DOF refactor. Also fixes T85618 Wireframe Displays Strangely in Eevee (Rendered, material Preview)
2021-02-22Fix T85720 EEVEE: Contact shadows do not appear when enabling SSRClément Foucault
Contact shadows needed correct `gl_FragCoord.z` but this is not correctly set for fullscreen passes. Need to pass depth using a global variable until we get rid of `cl_eval.tracing_depth`.
2021-02-21Fix T85714 Crash when Viewport Rending an image using EEVEE.Clément Foucault
Was caused by non initialized render_timesteps.
2021-02-21Fix T85603 EEVEE: Baking Indirect lighting crashes BlenderClément Foucault
Was caused by non initialized render_timesteps.