Jump to content

StandardMaterial.reflectionLevelTexture?


Convergence
 Share

Recommended Posts

The StandardMaterial.reflectionTexture specifies the texture that should be reflected, which can then be controlled in intensity by its .level property or additionally by FresnelParameters. However both of those properties only influence the reflectionTexture uniformly. Is there a chance to add a reflectionLevelTexture that specifies the reflection intensity as a map? This would be handy in situations like creating furniture where only the glass part needs to reflect, but not the wood part, or buildings where the windows need to reflect but not the walls.

Now, its always possible to make two meshes or use MultiMaterials, one with a reflecting material, and one without (which is what I'm currently doing), but that adds one draw call per mesh, causes z buffer issues, and is convoluted to model.

Link to comment
Share on other sites

Else if static as it seems, instead of an expensive extra channel, why not creating your texture based on the merge of the two others at the start of your app.

Once the result has been computed you just use the one available channel normally.

You could even do it offline if there are not too many possible combinations ?

Link to comment
Share on other sites

20 hours ago, V!nc3r said:

NasimiAsl help me on a similar problem. You have to use a non-default shader

Thanks, I'll check it out.. :)

15 hours ago, jellix said:

The PBRMaterial can do that.

So maybe you could change your MaterialType fron StandardMaterial to PBRMaterial ...

Which property of the PBRmaterial controls this?

14 hours ago, Sebavan said:

Else if static as it seems, instead of an expensive extra channel, why not creating your texture based on the merge of the two others at the start of your app.

Once the result has been computed you just use the one available channel normally.

You could even do it offline if there are not too many possible combinations ?

I'm not sure I follow.. You mean to merge two materials?

Link to comment
Share on other sites

About merging the textures, If you have a normalized level texture (like black to white for none reflective to reflective) and your reflection texture, as the reflection color is always added on the other colors (diffuse, specular...) during the composition of each pixel in the standard material, you could multiply (either offline or through code) both textures together. 

Doing this offline (in PS for instance) or at load time of the app through code, you will improve your performances by preventing the shader to sample the extra texture and multiply for each pixels.

If your level texture or the reflection is dynamic on another hand, the extra channel in the shader would be better but from what I understood it is not the case.

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