Sign in to follow this  
gamefan

Disable Render Targets and clear frame

Recommended Posts

Hi,

I find renderTargetsOptimization very helpful. Is there a way a renderTarget frame can be cleared so that the last frame before render targets are disabled doesn't stay?

I can set ReflectionTextureEnabled = false, but I want to have reflection textures that don't use render targets.

http://www.babylonjs-playground.com/#1YAIO7#37

In this playground I have disabled render targets after 3 seconds but the ball reflection remains static

Thanks

Share this post


Link to post
Share on other sites

You can set each render target with the refresh rate you want:

probe.refreshRate = BABYLON.RenderTargetTexture.REFRESHRATE_RENDER_ONCE;

probe.refreshRate = BABYLON.RenderTargetTexture.REFRESHRATE_RENDER_ONEVERYFRAME;

probe.refreshRate = BABYLON.RenderTargetTexture.REFRESHRATE_RENDER_ONEVERYTWOFRAMES; 

Share this post


Link to post
Share on other sites

Hi Deltakosh,

Thank you for your reply but this is not what I want. I want the render targets textures to disappear after renderTargets optimization is done. The scene looks awkward when the render target textures just stay there at their last rendered frame. It looks awkward even for renders at intermittent frames with the use of refreshRate.

I want a result similar to what "StandardMaterial.ReflectionTextureEnabled = false" does.

Thanks

 

Share this post


Link to post
Share on other sites

Reflections made by MirrorTexture and ReflectionProbe. We want something like what

material.reflectionTexture = null

would do. (As disabling render targets won't update the reflection texture in the next render frames)

StandardMaterial.ReflectionTexturesEnabled = false 

is the right thing to do but I don't want to disable reflection textures that aren't using render targets.

I think scene.renderTargetsEnabled should render/hide the render target texture. What affect this has now is equivalent to (an imaginary) scene.pauseRenderTargets.

Edited by gamefan
After Thought

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.