Bhupi Posted January 17, 2017 Share Posted January 17, 2017 Hi. I want to attach a standard material and a reflective texture on the same surface. I have jpg's for both. I tried to use multi-material: var ematerial = new BABYLON.StandardMaterial("wall_wood", scene); ematerial.emissiveTexture = new BABYLON.Texture("wall_wood.jpg", scene); var rmaterial = new BABYLON.Texture("wall_wood_r", scene); rmaterial.reflectionTexture = new BABYLON.Texture("wall_wood_r.jpg", scene); rmaterial.reflectionTexture.coordinatesMode = BABYLON.Texture.PLANAR_MODE; var multimat = new BABYLON.MultiMaterial("multimat", scene); multimat.subMaterials.push(ematerial); multimat.subMaterials.push(rmaterial); mesh.material = multimat; This did not work as expected. How can I achieve this? Is custom shader the way to go? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 17, 2017 Share Posted January 17, 2017 Hello! you can use the same material: material.emisseTexture = .. material.reflectionTexture = ... mesh.material = material Quote Link to comment Share on other sites More sharing options...
leanderr Posted February 3, 2017 Share Posted February 3, 2017 It didn't work for me, I made a playground and tried both ways, even with Alphablending it wont work. Is Z-Indexing the way to go? http://babylonjs-playground.com/#5S6MD#10 Quote Link to comment Share on other sites More sharing options...
Bhupi Posted February 3, 2017 Author Share Posted February 3, 2017 We did not proceed this way (we removed reflection). In general, for reflection to work, you need 3 things: 1: surface/mesh to reflect on: it can have texture 2: meshes/objects that need to be reflected: to be added in the renderlist of the mesh in point 1 3: light: should fall on the mesh in point 1 Quote Link to comment Share on other sites More sharing options...
leanderr Posted February 3, 2017 Share Posted February 3, 2017 http://babylonjs-playground.com/#5S6MD#11 Still couldn't make it work. Can you provide an Example? Maybe fix the Playground? Can anyone mix the Grid with a Standard Material Diffuse? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 3, 2017 Share Posted February 3, 2017 @leanderr can you elaborate on what you try to achieve? This seems not related to original question. Quote Link to comment Share on other sites More sharing options...
leanderr Posted February 3, 2017 Share Posted February 3, 2017 49 minutes ago, Deltakosh said: @leanderr can you elaborate on what you try to achieve? This seems not related to original question. "I want to attach a standard material and a reflective texture on the same surface." (Original Question) And Second I want to blend the Grid Material and a Standard Material with a certain Ratio / Alpha / Alphamap (from Grid). Here are my Attempts so far. http://babylonjs-playground.com/#5S6MD#11 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 6, 2017 Share Posted February 6, 2017 I replied to first question already (just use a stdmaterial which support reflective texture) For your second question: the grid material is a material and meshes can only have one material so you need to have two meshes with the second one transparent to simulate the blending. Multimaterial cannot be used here because it is not for blending. It is used when you want to have some part of the mesh with one material and some with another material Wingnut and leanderr 2 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.