pex-renderer icon indicating copy to clipboard operation
pex-renderer copied to clipboard

Improve reflection probes seams

Open vorg opened this issue 3 years ago • 3 comments

Currently pex-renderer uses Octahedral maps for reflection probes as explained in Octahedral maps for PREM #8.

There is number of never addressed issues though:

  • the resolution of the reflection probe is not configurable and hardcoded at 2048 (1024 for "roughness 0" reflection)
  • a seem might be visible on the higher roughness levels
  • there are visible birth spots on high contrast HDRIs with single bright spot

vorg avatar Nov 07 '22 10:11 vorg

About seams:

Engine Work: Global Illumination with Irradiance Probes KOHZYP9

https://twitter.com/RealtimeVFXMike/status/1221525778359144450

EPO7OCmWsAIbOD- EPO9b0OXkAEem0V

https://twitter.com/Dan87626237/status/1220048547103563777

EO57rzuWAAANkyV

https://twitter.com/val_sagrario/status/1231771907437010949?s=20

ERgiBH7XkAAWLTH

float2 Encode( float3 n )
{
n /=  dot(1, abs(n));
float2 wrap = ( 1.0 - abs( n.zx ) ) * ( n.xz >= 0.0 ? 1.0 : -1.0 );
n.xy = n.y >= 0.0 ? n.xz : wrap;
n.xy = n.xy * 0.5 + 0.5;
return n.xy;
}

Scaling Probe-Based Real-Time Dynamic Global Illumination for Production

Screenshot 2021-05-12 at 11 27 30

vorg avatar Nov 07 '22 10:11 vorg

@dmnsgn here is what i mean by bright spots / fireflies. This might be from bugs in importance sampling or not enough blur. I think in current pex-renderer version i blur the original octahedral map into mipmap levels and sample from them but it's simple downsampling and not soft gaussian blur (not sure if that would be accurate). I do know ThreeJS blurs the reflection levels more.

855020014038114304-C92kHKEXkAAtVih

vorg avatar Nov 07 '22 10:11 vorg

More recent "scratches" example of insufficient filtering. Screenshot 2022-11-07 at 17 04 47

vorg avatar Nov 07 '22 17:11 vorg