pex-gl / pex-renderer

Physically based renderer (PBR) and scene graph for PEX.
https://pex-gl.github.io/pex-renderer/examples/index.html
MIT License
237 stars 16 forks source link

Improve reflection probes seams #321

Open vorg opened 2 years ago

vorg commented 2 years ago

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:

vorg commented 2 years ago

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 commented 2 years ago

@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 commented 2 years ago

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