You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just finished a GodrayPass for Wagner, but I encounter some weird stuff with the renderer.clear and the toTexture.
@composer.renderer.autoClear = false
@composer.renderer.setClearColor(0x333333,1)
@composer.reset()
@composer.renderer.clear()
@composer.render(@occlusion.scene, @camera)
@composer.toTexture(@occlusion.texture)
@godrayPass.params.occlusionTexture = @occlusion.texture
@composer.pass( @godrayPass )
@composer.toTexture(@occlusion.texture)
# Force to render to another texture here
@composer.toTexture(@occlusion.texture2)
@composer.reset()
@composer.renderer.clear()
@composer.render(@scene, @camera)
@blendPass.params.tInput2 = @occlusion.texture
@composer.pass(@blendPass)
@composer.toScreen()
After rendering the occlusionScene + the godray pass I want to blend so I needed to reset / clear / draw the scene but the clear will also clear the latest texture used in composer.toTexture.
To fixed it, I used a second texture so the first one is not clear.. but I'm sure there is a better way wihout this extra renderer.
see the screenshot below where texture & texture2 are render on 2 plane for debugging :
Let me know if I miss something!
The text was updated successfully, but these errors were encountered:
So after composer.reset() we also need to add : @composer.renderer.setRenderTarget(@composer.write)
and then the texture use in the toTexture is not overwrite anymore.
I would suggest to put this line as part of the reset function and also call the reset at the initialisation of Wagner to init this.write and this.read without calling composer.reset().
Hi,
I just finished a GodrayPass for Wagner, but I encounter some weird stuff with the renderer.clear and the toTexture.
After rendering the occlusionScene + the godray pass I want to blend so I needed to reset / clear / draw the scene but the clear will also clear the latest texture used in composer.toTexture.
To fixed it, I used a second texture so the first one is not clear.. but I'm sure there is a better way wihout this extra renderer.
see the screenshot below where texture & texture2 are render on 2 plane for debugging :
Let me know if I miss something!
The text was updated successfully, but these errors were encountered: