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-16Fix T86612 EEVEE: Wrong AmbientOcclusion on refractive materialsClément Foucault
This is because the refractive materials were using the deferred AO computation instead of tracing their own.
2021-03-15EEVEE: Contact Shadow: Fix self intersection issuesClément Foucault
This was cause by the change of some epsilon values for reflections. This commit changes the planar reflection tracing to have correct handling of parallel rays and discard any self intersection with normal screen raytrace.
2021-03-15Cleanup: EEVEE: Remove unused variableClément Foucault
2021-03-15Fix T86542: Crash going to UV editing workspace with an instancer thatPhilipp Oeser
is hidden from the viewport Check visibilty (as done in workbench_cache_populate) in overlay_edit_uv_cache_populate as well. Maniphest Tasks: T86542 Differential Revision: https://developer.blender.org/D10724
2021-03-15Fix T86370: Select color for glow is invertedFalk David
The shader was filtering everything but the selected color. The fix inverts the check to make sure that color is selected. Reviewed By: fclem Maniphest Tasks: T86370 Differential Revision: https://developer.blender.org/D10670
2021-03-14EEVEE: Specular Occlusion: Avoid overdarkening on smooth surfacesClément Foucault
Accumulate error caused by the low amount of integration slices and correct it for the low roughness surfaces. This increases light leak but it is less distracting than dark fringe everywhere.
2021-03-14Cleanup: EEVEE: Replace `brightness()` by `max_v3()`Clément Foucault
It is more straightforward to understand and is define in common file.
2021-03-14Cleanup: EEVEE: Remove unused mipmapping on main color bufferClément Foucault
2021-03-14Cleanup: EEVEE: Silence warningClément Foucault
2021-03-14EEVEE: RenderPass: Fix Ambient Occlusion passClément Foucault
The shader was not using the horizon texture and was trying to trace the AO again. Also the depth reconstruction was off because now using the maxzBuffer.
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-14EEVEE: Planar reflections: Fix ambient occlusion broken in reflectionsClément Foucault
Use the maxzbuffer to get the correct depth information.
2021-03-13EEVEE: ScreenSpaceReflections: Avoid outputing NaNsClément Foucault
This happens when the normal is too much deformed to give valid reflection even after ensure_valid_reflection. Cycles seems to not handle this case either so we just discard the rays.
2021-03-13Fix T86476 EEVEE: SSS material with variable radius can produce NaNsClément Foucault
Simple divide by 0 error. The input radius was assumed to be safe but is not when the user can scale it arbitrarly. This also move the division out of the loop.
2021-03-13EEVEE: Fix wrong sss component being affected by alphaClément Foucault
This fixes NaNs / blown up values when using alpha-hashed transparency or alpha clip with SSS.
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...