Jump to content

Disabling Reflection Texture has no FPS Win


gamefan
 Share

Recommended Posts

Hi,

I want to offer user to disable reflections in my application so that there is gain in fps if he/she wishes to. I set ReflectionTextureEnabled in standardMaterial to false, the reflection is disabled but there is no performance gain. Removing the reflection texture from the mesh's material does increase the fps count. But I don't want to remove the reflection texture completely as user can toggle this back on again. Any strategies on how to do this?

http://www.babylonjs-playground.com/#DHPSEM#1

Link to comment
Share on other sites

It can be done but I will have to index the meshes in the render list so that they can be added back again once reflections is switched on. I was looking for a simpler solution. Is there a property that will completely disable reflections somewhere deep down in the babylon render loop?

Link to comment
Share on other sites

21 hours ago, gamefan said:

Is there a property that will completely disable reflections somewhere deep down in the babylon render loop?

I would think that StandardMaterial.ReflectionTextureEnabled would be the answer.  This appears to be a bug.

edit:

This fix increases the fps (maybe not completely):

http://www.babylonjs-playground.com/#DHPSEM#11

If you try setting StandardMaterial.ReflectionTextureEnabled to false after the scene is loaded you get a broken reflection:

http://www.babylonjs-playground.com/#DHPSEM#10

Link to comment
Share on other sites

13 hours ago, adam said:

If try setting StandardMaterial.ReflectionTextureEnabled to false after the scene is loaded you get a broken reflection:

Yeah, noticed this. Once set ReflectionTextureEnabled to false it has to be set to true to enable reflection again. That property remains unchanged in the browser session of pg.

#11 increases the fps, but will have to do this to all materials. Can I someway override a StandardMaterial function without editing the babylonjs file. Thanks

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...