Derpius / PBnJ

1 stars 0 forks source link

Swap out surface shader for custom fragment shader #6

Open Derpius opened 1 year ago

Derpius commented 1 year ago

Surface shaders are more of a legacy API, we should instead use a custom fragment shader implementing a physically based BSDF.

This would allow implementing custom lighting effects with ease, such as re-entry effects.

Need to investigate how Juno samples light sources. If there are fine grain environment maps with MIP levels, it may also be feasible to implement approximate indirect diffuse lighting as I did for the BSDF material preview in VisTrace.

The BSDF used would be a port of https://github.com/Derpius/VisTrace/blob/master/source/libraries/BSDF.cpp

Derpius commented 1 year ago

This is probably not feasible with how much the surface shader abstracts away.

It is possible to override the BSDF used though, as well as applying an additional pass on the final colour which would allow for re-entry effects.