Junior Posted August 11, 2014 Share Posted August 11, 2014 Hello Everyone, I would like to add shadows and reflections to a car model that was exported from blender to Babylon.JS. (The file is attached to this post.) I have tried using 'static reflection' in the blender software but it looks horrible when I exported it as a *.babylon file. I have seen reflections in 'The Car" demo on the BabylonJS website and would like to know how to do the same. I am not sure how to identify the mesh that I want to use as a reflector (My programming skills is very weak.) I have seen the tutorial on 'advanced texturing' here https://github.com/BabylonJS/Babylon.js/wiki/14-Advanced-Texturing, but I am not clear on how to do it with *.babylon meshes. Could someone help me please? I would greatly appreciate it. Thanks Quote Link to comment Share on other sites More sharing options...
Dad72 Posted August 11, 2014 Share Posted August 11, 2014 You can use LensFlare to create reflections. See here: var lensFlareSystem = new BABYLON.LensFlareSystem("lensFlareSystem", light0, scene);var flare00 = new BABYLON.LensFlare(0.2, 0, new BABYLON.Color3(1, 1, 1), "Assets/lens5.png", lensFlareSystem); https://github.com/BabylonJS/Babylon.js/wiki/How-to-use-lens-flares You can also play with the lights on the specularColor and emissiveColor level. and you can also use the reflexionTexture var material = new BABYLON.StandardMaterial("name", scene);material.reflexionTexture = new BABYLON.Texture("reflexion.jpg", scene);material.emissiveColor = new BABYLON.Color3(0.3, 0.3, 0.3); Quote Link to comment Share on other sites More sharing options...
Junior Posted August 11, 2014 Author Share Posted August 11, 2014 Hello Dad72 Thanks for taking the time out to assist me. My car.babylon file contains several meshes and I would like to make the the body, doors and rim meshes to be reflective. I need to know how to identify and target these meshes so that I can add the reflection texture. I also need to know exactly where to put the code for the reflection texture. Do I add it to the html file or do I create a new javascript file e.g. 'car.js' and place the code in that file. All of this is beyond my present knowledge. Thanks for your help. 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.