Convergence Posted October 6, 2016 Share Posted October 6, 2016 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. Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted October 6, 2016 Share Posted October 6, 2016 NasimiAsl help me on a similar problem. You have to use a non-default shader Quote Link to comment Share on other sites More sharing options...
jellix Posted October 6, 2016 Share Posted October 6, 2016 The PBRMaterial can do that. So maybe you could change your MaterialType fron StandardMaterial to PBRMaterial ... Quote Link to comment Share on other sites More sharing options...
Sebavan Posted October 6, 2016 Share Posted October 6, 2016 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 ? Quote Link to comment Share on other sites More sharing options...
Convergence Posted October 7, 2016 Author Share Posted October 7, 2016 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? Quote Link to comment Share on other sites More sharing options...
jellix Posted October 7, 2016 Share Posted October 7, 2016 It's the reflectivityTexture. http://www.babylonjs-playground.com/#1JCM6S#5 https://doc.babylonjs.com/overviews/Physically_Based_Rendering_Master Quote Link to comment Share on other sites More sharing options...
Sebavan Posted October 7, 2016 Share Posted October 7, 2016 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. 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.