Ahiru Posted September 9, 2015 Share Posted September 9, 2015 2 Questions for this one: http://playground.babylonjs.com/#1QT5RS 1. It seems the procedural Textures take a lot of FPS, even they are not shown in Frustum or even if they are not attached to any Mesh? Is there a possibility to switch them off manually if they are not needed (not shown by any camera?) 2. How would I let a sun shine from inside? Do I always need external lights to let them shine? I tried material.emmisiveTexture and color, but that does not work if I don't use some external light to shine at the sun from outside. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 9, 2015 Share Posted September 9, 2015 Hello you can control the refreshrate: (http://doc.babylonjs.com/tutorials/How_to_use_Procedural_Textures) texture.refreshRate = 0 (render just once) texture.refreshRate = 2 (render every two frames), etc... You can use VLS to simulate sun shining: http://playground.babylonjs.com/?25 Quote Link to comment Share on other sites More sharing options...
Ahiru Posted September 11, 2015 Author Share Posted September 11, 2015 Yes, but VLS have the same issue like the procedural Textures - even the element is not in Frustum it still costs a lot of FPS - your example here goes down to 20 FPS on my computer, even lower on an android phone. If that would be only the case when FACING the sun it might be acceptable - but it does not matter if the sun is in view. So with the procedural problem I tried it like this: scene.registerBeforeRender(function () { if (sun.isCompletelyInFrustum(camera)) { fireTexture.refreshRate = 1; } else { fireTexture.refreshRate = 0; }}); http://playground.babylonjs.com/#1QT5RS#1 But that did not work. And how would I stop the rays when out of Frustum? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 11, 2015 Share Posted September 11, 2015 VLS is a post process which means a completely 2D process. To stop it when sun is out of the screen the best idea is to disable the postprocess For the procedural textures, I added a fireTexture.isEnabled to turn them off on demand (See next commit) 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.