Jump to content

blender cycles baking


burbonvagin
 Share

Recommended Posts

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):

 

  1. Make sure all textures are unwrapped. They don't really need to have carefully cut seams, but of course that's always better.
  2. Open the texture in Photoshop. 
  3. Back in Blender, go to the object, tab into edit mode, choose the UV editor, then bake the shadows.
  4. Save the shadow image as .png.
  5. In photoshop, copy the shadow map over the original texture, using multiply. Adjust the opacity and add a slight gaussian blur if desired.
  6. 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.

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...