burbonvagin Posted September 21, 2014 Share Posted September 21, 2014 i haven't actually tried this yet but i saw a video on blender cycles baking and it looks like it could be awesome in babylon.js. i just wanted to share it. http://youtu.be/sB09T--_ZvU?list=UUOKHwx1VCdgnxwbjyb9Iu1g Quote Link to comment Share on other sites More sharing options...
AlexB Posted September 21, 2014 Share Posted September 21, 2014 I just completed a project using this technique and it works very well. In fact, I'd say that after working with Babylon a little, the ideal workflow is to avoid using Babylon's lights and shadows completely, and do all of your lighting in Blender and then use a single hemi light in Babylon. My workflow is as follows (using the Blender renderer): Make sure all textures are unwrapped. They don't really need to have carefully cut seams, but of course that's always better. Open the texture in Photoshop. Back in Blender, go to the object, tab into edit mode, choose the UV editor, then bake the shadows. Save the shadow image as .png. In photoshop, copy the shadow map over the original texture, using multiply. Adjust the opacity and add a slight gaussian blur if desired. Save out the new texture and apply in Babylon.When I get some time, I'll write up a tutorial on this. It's really not that hard to do. Quote Link to comment Share on other sites More sharing options...
Adrian Posted September 21, 2014 Share Posted September 21, 2014 Hi AlexB, I am very interested by your tutorial ! Thanks for that. Do you have a sample scene you could show using this technique? Quote Link to comment Share on other sites More sharing options...
AlexB Posted September 21, 2014 Share Posted September 21, 2014 Hi AlexB, I am very interested by your tutorial ! Thanks for that. Do you have a sample scene you could show using this technique? Soon! It's under an NDA. Quote Link to comment Share on other sites More sharing options...
gryff Posted September 21, 2014 Share Posted September 21, 2014 I think what burbonvagin is talking about is the ability to bake textures from the cycles render engine. This feature arrived with Blender 2.71 You have always been able to bake textures, including shadow maps, with the traditional blender render engine. Being able to use the cycles render engine means you will be able to make full use of the Node Editor in Blender to create materials then bake them out.to textures. There is, I believe, a collection of shaders available that can be used with the cycles render engine and the new baking ability will allow these to be baked out. cheers, gryff Quote Link to comment Share on other sites More sharing options...
AlexB Posted September 23, 2014 Share Posted September 23, 2014 Here is the project we just released. http://designthe5.com All of the shadows are baked in, and we're using a single hemi light. Curious how this performs for everyone. The car has lots of polygons but we couldn't use a different model. Quote Link to comment Share on other sites More sharing options...
Temechon Posted September 24, 2014 Share Posted September 24, 2014 Hey Alex, Where should I click to run your demo ? I don't see any canvas in my browser... Quote Link to comment Share on other sites More sharing options...
AlexB Posted September 24, 2014 Share Posted September 24, 2014 Hey Alex, Where should I click to run your demo ? I don't see any canvas in my browser... Oops, sorry guys. The client asked to take it down momentarily. It'll be back online Friday. Sorry for the confusion! Quote Link to comment Share on other sites More sharing options...
AlexB Posted September 26, 2014 Share Posted September 26, 2014 Ok, site is back up. http://designthe5.com/garage If you take a look at the scene, there is a single hemi light set as follows: this.scene.lights = [];var hemisphericLight = new BABYLON.HemisphericLight("hemiLight", new BABYLON.Vector3(0, 1, 0), this.scene);hemisphericLight.diffuse = new BABYLON.Color3(0.65, 0.65, 0.65); hemisphericLight.specular = new BABYLON.Color3(0.5, 0.5, 0.3); hemisphericLight.groundColor = new BABYLON.Color3(0.2, 0.2, 0.2); hemisphericLight.intensity = 2.15;So all of the lights and shadows are baked into the textures. On the floor, we have the basic floor material which is sort of concrete, and then on top of that I layered the output from the Blender shadow baking. It's important to not have overlapping UVs for this to work. So the floor has to be one single texture, with all UVs in their own texture coordinates. You can do this by unwrapping by hand, or even doing a UV project for textures that are just solid colors. That's how I baked the shadows on the tool boxes. For the walls, we baked in shadows from the 30 or so lights in the ceiling, and then softened those in Photoshop, leaving the ones cast from the toolbox as harder edged. The car shadow is actually just a plane parented to the car, with a png outline of the car from the top down, made transparent and with edges softened. Then when the car moves the shadow moves with it. I don't think it's as cool as a real cast shadow but it's effective enough to sell the illusion. 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.