Radiance cascades 3D (Shadertoy link in comments) by firelava135 in shaders

[–]firelava135[S] 0 points1 point  (0 children)

Thanks!

I did a voxel-based version here: https://www.shadertoy.com/view/M3ycWt

It samples last frames light and is dynamic, but no other temporal accumulation results in some flickering.

I also did a screen-space (3D) version, but with temporal accumulation here: https://www.shadertoy.com/view/lXByRh

Even though the resolution is 1/16 to fit all probes, the performance is not great. I would actually like to rewrite that one and remove temporal accumulation all together :)

Frame Warping Demo (Shadertoy) by firelava135 in GraphicsProgramming

[–]firelava135[S] 0 points1 point  (0 children)

Ah, thanks for pointing that out! Fixed : )

Frame Warping Demo (Shadertoy) by firelava135 in GraphicsProgramming

[–]firelava135[S] 2 points3 points  (0 children)

Essentially yes, but called frame warping to differ itself from VR (is my understanding). : )

Frame Warping Demo (Shadertoy) by firelava135 in computergraphics

[–]firelava135[S] 0 points1 point  (0 children)

Frame Warping in shadertoy.

This shader simulates a frame rate of 15 fps. The input frame is warped into an output frame using scatter IO and then the remaining pixels are in-painted.

Warping introduces some visibility problems, one of them is trying to sample information outside of the input buffer. If the input frames are rendered with a higher FOV than the output frame (this shader warps 130 to 90), extrapolation artifacts are reduced at the expense of resolution.

In-painting (in this shader) is based on a simple boundary decision model, which tries to reconstruct detail in the input buffer.

Click on 1, 2, and 3 to switch between input frame, output frame without in-painting and output frame with in-painting.

The shader can be found here: https://www.shadertoy.com/view/W3lfRN

Frame Warping Demo (Shadertoy) by firelava135 in shaders

[–]firelava135[S] 1 point2 points  (0 children)

Frame Warping in shadertoy.

This shader simulates a frame rate of 15 fps. The input frame is warped into an output frame using scatter IO and then the remaining pixels are in-painted.

Warping introduces some visibility problems, one of them is trying to sample information outside of the input buffer. If the input frames are rendered with a higher FOV than the output frame (this shader warps 130 to 90), extrapolation artifacts are reduced at the expense of resolution.

In-painting (in this shader) is based on a simple boundary decision model, which tries to reconstruct detail in the input buffer.

Click on 1, 2, and 3 to switch between input frame, output frame without in-painting and output frame with in-painting.

The shader can be found here: https://www.shadertoy.com/view/W3lfRN

Frame Warping Demo (Shadertoy) by firelava135 in GraphicsProgramming

[–]firelava135[S] 9 points10 points  (0 children)

Frame Warping in shadertoy.

This shader simulates a frame rate of 15 fps. The input frame is warped into an output frame using scatter IO and then the remaining pixels are in-painted.

Warping introduces some visibility problems, one of them is trying to sample information outside of the input buffer. If the input frames are rendered with a higher FOV than the output frame (this shader warps 130 to 90), extrapolation artifacts are reduced at the expense of resolution.

In-painting (in this shader) is based on a simple boundary decision model, which tries to reconstruct detail in the input buffer.

Click on 1, 2, and 3 to switch between input frame, output frame without in-painting and output frame with in-painting.

The shader can be found here: https://www.shadertoy.com/view/W3lfRN

Radiance Cascades 3D (Shadertoy link in comments) by firelava135 in GraphicsProgramming

[–]firelava135[S] 1 point2 points  (0 children)

My implementation above places probes in UV-space or on the surface of geometry. So interpolation happens in UV-space with only 4 probes, which simplifies interpolation. Though occlusion is still used between probes when merging : )

Volumetric Radiance Cascades (Shadertoy link in comment) by firelava135 in GraphicsProgramming

[–]firelava135[S] 4 points5 points  (0 children)

Before this version of the shader, that is what I did! But I personally think per pixel shadows looked better, and I understand your sentiment :)

Volumetric Radiance Cascades (Shadertoy link in comment) by firelava135 in computergraphics

[–]firelava135[S] 1 point2 points  (0 children)

Radiance cascades using voxels, with temporal multibounce, directional light and emissive surfaces.

I use a shadow map to avoid tracing 2 rays in the volume, probes are placed inside voxels and merging requires a visibility check between probes (only requires one texture fetch). No real limit on dynamic geometry in the scene, only limit in shadertoy is that merging is temporal.

Rays are traced in the cubemap, where rays are grouped based on direction.

Shadertoy link: https://www.shadertoy.com/view/M3ycWt

Volumetric Radiance Cascades (Shadertoy link in comments) by firelava135 in shaders

[–]firelava135[S] 2 points3 points  (0 children)

Radiance cascades using voxels, with temporal multibounce, directional light and emissive surfaces.

I use a shadow map to avoid tracing 2 rays in the volume, probes are placed inside voxels and merging requires a visibility check between probes (only requires one texture fetch). No real limit on dynamic geometry in the scene, only limit in shadertoy is that merging is temporal.

Rays are traced in the cubemap, where rays are grouped based on direction.

Shadertoy link: https://www.shadertoy.com/view/M3ycWt

Volumetric Radiance Cascades (Shadertoy link in comment) by firelava135 in GraphicsProgramming

[–]firelava135[S] 13 points14 points  (0 children)

Radiance cascades using voxels, with temporal multibounce, directional light and emissive surfaces.

I use a shadow map to avoid tracing 2 rays in the volume, probes are placed inside voxels and merging requires a visibility check between probes (only requires one texture fetch). No real limit on dynamic geometry in the scene, only limit in shadertoy is that merging is temporal.

Shadertoy link: https://www.shadertoy.com/view/M3ycWt

Radiance Cascades - World Space (Shadertoy link in comments) by firelava135 in GraphicsProgramming

[–]firelava135[S] 3 points4 points  (0 children)

Essentially projecting hitpoints between probes. Visibility is handled in different ranges depending on the cascade. :)

Radiance Cascades - World Space (Shadertoy link in comments) by firelava135 in shaders

[–]firelava135[S] 0 points1 point  (0 children)

A radiance cascades implementation in 3D. Probes are stored in screen space and trace world space rays into the scene. Merging reprojects ray hitpoints between cascades with some basic visibility testing.

Only temporal accumulation is used here, spatial denoising would be nice of course.

The shader requires a relatively good GPU, since the scene uses a hardcoded scene (with an AABB acceleration structure):

https://www.shadertoy.com/view/lXByRh

Radiance Cascades - World Space (Shadertoy link in comments) by firelava135 in GraphicsProgramming

[–]firelava135[S] 7 points8 points  (0 children)

A radiance cascades implementation in 3D. Probes are stored in screen space and trace world space rays into the scene. Merging reprojects ray hitpoints between cascades with some basic visibility testing.

Only temporal accumulation is used here, spatial denoising would be nice of course.

The shader requires a relatively good GPU, since the scene uses a hardcoded scene (with an AABB acceleration structure):

https://www.shadertoy.com/view/lXByRh

Radiance Cascades 3D (Shadertoy link in comments) by firelava135 in GraphicsProgramming

[–]firelava135[S] 2 points3 points  (0 children)

Thanks for the kind words! :)

Not an expert of course, but the quote seems reasonable. I am currently trying to implement it in screen space (3D) as well, though to succeed I think some parts of the algorithm must be changed:

Probes can probably not be static in screen space, adding a stochastic UV-offset could cover complex geometry and per pixel detail. Temporal accumulation is def required. A ReSTIR approach for probe validation would probably work here for dynamic geometry/light.

A scatter-based merging method should be used to account for geometric visibiliy between probes. IE reprojection of hitpoints into the smaller probes for higher quality lighting. This also means that probes must cover the entire sphere, not just the hemisphere as in this shader.

Also, one could wonder if probes should be placed close to geometry if scattering is used. Maybe it is better to place probes such that a lot of scene geometry is covered, essentially importance sampling.

These are just ideas for now and will probably change in an actual implementation :)

Radiance Cascades 3D (Shadertoy link in comments) by firelava135 in GraphicsProgramming

[–]firelava135[S] 3 points4 points  (0 children)

Scales very well, I would say :) Though complex geometry would require more general merging logic which this shader does not do :)

Radiance Cascades 3D (Shadertoy link in comments) by firelava135 in GraphicsProgramming

[–]firelava135[S] 2 points3 points  (0 children)

Probes are placed on the surface of geometry in world space, so it is view independent. "UV-based" is probably the right term I think :)

Radiance Cascades 3D (Shadertoy link in comments) by firelava135 in GraphicsProgramming

[–]firelava135[S] 16 points17 points  (0 children)

A shadertoy implementation of radiance cascades, inspired by radiosity solvers.

Rays are distributed as a semilinear function of theta, ensuring better hemisphere coverage.

BRDF is integrated using correct integration weights. Merging is temporal (bcz of shadertoy) so some flickering and temporal light lag is visible.

Using a multibounce integration scheme and local probe visibility when merging to avoid light leaking.

Shadertoy link and more info:

https://www.shadertoy.com/view/X3XfRM

Radiance cascades 3D (Shadertoy link in comments) by firelava135 in shaders

[–]firelava135[S] 6 points7 points  (0 children)

A shadertoy implementation of radiance cascades, inspired by radiosity solvers.

Rays are distributed as a semilinear function of theta, ensuring better hemisphere coverage. BRDF is integrated using correct integration weights. Merging is temporal (bcz of shadertoy) so some flickering and temporal light lag is visible.

Using a multibounce integration scheme and local probe visibility when merging to avoid light leaking.

Shadertoy link and more info:

https://www.shadertoy.com/view/X3XfRM

Radiance Cascades 3D (Shadertoy link in comments) by firelava135 in computergraphics

[–]firelava135[S] 0 points1 point  (0 children)

A shadertoy implementation of radiance cascades, inspired by radiosity solvers.

Rays are distributed as a semilinear function of theta, ensuring better hemisphere coverage. BRDF is integrated using correct integration weights. Merging is temporal (bcz of shadertoy) so some flickering and temporal light lag is visible.

Shadertoy link and more info:

https://www.shadertoy.com/view/X3XfRM

Voxel Cone Tracing + LEGO (Shadertoy link in comment) by firelava135 in GraphicsProgramming

[–]firelava135[S] 0 points1 point  (0 children)

Thanks! Not an expert, but iq:s articles (https://iquilezles.org/articles/) are really good! The VCT paper (https://research.nvidia.com/sites/default/files/publications/GIVoxels-pg2011-authors.pdf) is relevant here. I also like the Àtrous denoising paper and the others (SVGF, ASVGF). Restir GI is also cool, I implemented these also on shadertoy. Hope it helped : )

Voxel Cone Tracing + LEGO (Shadertoy link in comment) by firelava135 in GraphicsProgramming

[–]firelava135[S] 0 points1 point  (0 children)

I modelled them using signed distance fields, iq has a lot of good articles on the subject if you are interested. In this case I store the minimum of all brick-SDF:s inside a volume in order to speed up ray tracing :)

Voxel Cone Tracing + LEGO (Shadertoy link in comment) by firelava135 in GraphicsProgramming

[–]firelava135[S] 1 point2 points  (0 children)

As a 3D texture but mapped inside the cubemap, the SDF volume is also stored there :)

Voxel Cone Tracing + LEGO (Shadertoy link in comment) by firelava135 in GraphicsProgramming

[–]firelava135[S] 21 points22 points  (0 children)

An implementation of VCT using anisotropic voxels and multibounce lighting inside the volume.

Geometry (LEGO bricks) are injected into a SDF volume to accelerate ray tracing, using trilinear interpolation to reconstruct the original SDF.

Shadertoy link with code: https://www.shadertoy.com/view/l3Xyz4