Jump to content

Procedural Textures / Self-Shining Objects


Ahiru
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...