AlexB Posted September 18, 2014 Share Posted September 18, 2014 Working from this link here: https://github.com/BabylonJS/Babylon.js/wiki/13-Advanced-Texturing I can see that it's possible to use mesh objects as the source of reflections, but is it possible to simply use an image file? Similar to this here? http://stemkoski.github.io/Three.js/Reflection.html Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 19, 2014 Share Posted September 19, 2014 Yes:mat.reflectionTexture = new BABYLON.CubeTexture("Refcube", scene); More here:https://github.com/BabylonJS/Babylon.js/wiki/Scene-Environment Quote Link to comment Share on other sites More sharing options...
AlexB Posted September 19, 2014 Author Share Posted September 19, 2014 I see, thanks! One question before I go down this road: does using an image result in faster performance than a group of meshes? I presume so because each mesh has to be calculated vs. simply using a single image, but I wanted to see if any benchmarks have been made of this. Is it worth the trouble? Thanks! Quote Link to comment Share on other sites More sharing options...
AlexB Posted September 20, 2014 Author Share Posted September 20, 2014 Running into troubles with this. I have made my skybox in Blender and exported to six jpeg files. Babylon is correctly loading the files, but instead of rendering a reflection, the texture is coming out totally black. My code is as follows: var floorMaterial:BABYLON.StandardMaterial = (<BABYLON.StandardMaterial>this.scene.getMaterialByName("garage.Concrete_Floor.001")); floorMaterial.reflectionTexture=new BABYLON.CubeTexture("skybox/skybox", this.scene);What am I missing? Quote Link to comment Share on other sites More sharing options...
AlexB Posted September 20, 2014 Author Share Posted September 20, 2014 Ok, got it loading the skybox as a reflection texture, but the scale is way too large. I can't see a way to shrink down the size of the reflections. Any clues? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 23, 2014 Share Posted September 23, 2014 Could you share a demo? this is a bit unclear to me :0 Quote Link to comment Share on other sites More sharing options...
AlexB Posted September 23, 2014 Author Share Posted September 23, 2014 Sure, it finally went live! http://designthe5.com/ Note that the reflections on the floor are scaled too large. They'll never be exact, but if I can scale them down the illusion might sell better. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 23, 2014 Share Posted September 23, 2014 Why not using a true mirror for the ground? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 23, 2014 Share Posted September 23, 2014 BTW this is EXCELLENT! We can showcase it on our main page if you wish AlexB 1 Quote Link to comment Share on other sites More sharing options...
AlexB Posted September 23, 2014 Author Share Posted September 23, 2014 Why not using a true mirror for the ground? It was seriously degrading the frame rate. Quote Link to comment Share on other sites More sharing options...
AlexB Posted September 23, 2014 Author Share Posted September 23, 2014 BTW this is EXCELLENT! We can showcase it on our main page if you wish Thanks, please do! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 23, 2014 Share Posted September 23, 2014 you should also perhaps lower the level of the reflectionTexture like refTexture.level = 0.5 (For the ground I mean) could you share how are you defining the ground material? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 23, 2014 Share Posted September 23, 2014 For the homepage I need a 400x250 picture with a title and and author text Quote Link to comment Share on other sites More sharing options...
AlexB Posted September 23, 2014 Author Share Posted September 23, 2014 Something like this:var floorMaterial:BABYLON.StandardMaterial = (<BABYLON.StandardMaterial>this.scene.getMaterialByName("garage.Concrete_Floor.001"));var cubeTex:BABYLON.CubeTexture = new BABYLON.CubeTexture("/models/garage/skybox/skybox", this.scene);floorMaterial.reflectionTexture = cubeTex;floorMaterial.reflectionTexture.level = 0.175; Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 23, 2014 Share Posted September 23, 2014 could you try to set diffuseColor and specularColor to black? Just to try to see the reflection Quote Link to comment Share on other sites More sharing options...
AlexB Posted September 23, 2014 Author Share Posted September 23, 2014 Doesn't seem to make a difference. I think the hemi light is causing a glare that hides the reflection? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 24, 2014 Share Posted September 24, 2014 Yes I think so 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.