gamefan Posted May 30, 2018 Share Posted May 30, 2018 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 Quote Link to comment Share on other sites More sharing options...
Guest Posted May 30, 2018 Share Posted May 30, 2018 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; Quote Link to comment Share on other sites More sharing options...
gamefan Posted June 4, 2018 Author Share Posted June 4, 2018 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 Quote Link to comment Share on other sites More sharing options...
Guest Posted June 4, 2018 Share Posted June 4, 2018 So is that custom render targets? Which render targets are we talking about? Quote Link to comment Share on other sites More sharing options...
gamefan Posted June 5, 2018 Author Share Posted June 5, 2018 (edited) 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 June 5, 2018 by gamefan After Thought Quote Link to comment Share on other sites More sharing options...
Guest Posted June 5, 2018 Share Posted June 5, 2018 Ok make sense. I'm afraid you will have to go through scene.materials and get reflectionTexture property and then test if texture.isRender is true Quote Link to comment Share on other sites More sharing options...
gamefan Posted June 6, 2018 Author Share Posted June 6, 2018 Man!! I was afraid of this ?. Any chances this will be incorporated in a future release? Quote Link to comment Share on other sites More sharing options...
Guest Posted June 6, 2018 Share Posted June 6, 2018 That's kind of a really specific need no? Quote Link to comment Share on other sites More sharing options...
gamefan Posted June 11, 2018 Author Share Posted June 11, 2018 My head says no, but it probably is ?. I am fine with your solution but wonder why no one else came across this? ? Quote Link to comment Share on other sites More sharing options...
Guest Posted June 11, 2018 Share Posted June 11, 2018 well..Perhaps more will and in this case we will probably add it in the engine gamefan 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.