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
234 stars 16 forks source link

Post-processing darkens the scene and introduces z-fighting #241

Closed vorg closed 4 years ago

vorg commented 4 years ago

Screenshot 2019-09-10 at 15 26 23

vorg commented 4 years ago

My first guess this is due to non existing camera.postprocessing flag https://github.com/pex-gl/pex-renderer/blob/master/skybox.js#L140

uUseTonemapping: opts.backgroundMode ? !camera.postprocess : false,

New

const postProcessingCmp = camera.entity ? camera.entity.getComponent('PostProcessing') : null
const useTonemapping = !(postProcessingCmp && postProcessingCmp.enabled)
 ...
uUseTonemapping: opts.backgroundMode ? useTonemapping : false,
uExposure: opts.backgroundMode ? camera.exposure : 1
vorg commented 4 years ago

Closing this issue and moving z-fighting to a new one

vorg commented 4 years ago

Closing this issue and moving z-fighting to a new one