Now we have our room, light and camera in place. Lets add some objects, a UVsphere and a Cone and set up these transformations:
We will change the sphere and cone's color by creating two materials.
Select the sphere and hit F5 (Shader section) Select Add new and add pure red using the RGB Sliders RGB(1,0,0). Do the same for the cone but change to a different color, try Blue RGB(0, 0.5, 1)
One last thing: the cube`s normals are looking outside, so if we preview our scene we will not be able to see the walls. Lets fix this by selecting the cube, changing to edit mode (TAB Key), selecting all (A key) and pressing CTRL+F for face specials menú. Select Flip Normals and exit Edit mode (Tab Key again). Now the cube room is ready.
Ok, our scene is done.
2.-Setting up the walls for baquíng.
Now we will create a UV Calculation for every face inside the cube. In order to do this we will split the 3D viewport to see the UV/image window.
- At 3D view:
- Select the cube.
- Enter edit mode (Tab)
- Select all inside (A)
- Press U (UV Calculation Menu) and choose “Lightmap UVPack”
Press New Image and 1024 for image size. 512 would alos be fine. It's important to select “New Image” ONLY the first time we are doing this calculation. If we need to calculate the UV’s again deselect this option.
Ok. We have a new Blak coloured texture for our cube and the UV coordinates.
Exit edit mode.
Press F10 to go to render options and go to “Bake” menu.
Select our cube if not selected, press the “Bake” button and voilá! We got a nice, shadowed room!.
The baked texture must be saved. If you save your scene and quit, you will lose the bake, so in the UV editor, select image-> save, or pak to include the image in the .blend file.
You can improve your shadow quality by selecting the light, hit F5(Shading) And increasing Software size, samples and threshold.
If you need to change your light properties (location, color, ….) you will have to bake again as we just did.
BGE Capture before baquíng
BGE capture after baquíng
Some last tips:
You can animate your camera inside the room by changing the UV/Image window to the Ipo Curve editor.
Go to frame 1, select the camera, press (I key), and select LocRot to make the first key.
Advance about 100 frames.
With the camera selected, press (Shift + F) “fly mode”, use the W,A,S, and D keys to move your camera, and clik the LMB when you are satisfied with the view.
Press (I key) and select LocRot again.
Insert as many keys as you like... once you are finished, hit F4 to go to the Logic Panel.
Add a sensor, controller and actuator and set up like this (Camera selected)
Ok that's all… oh, and press P to preview. :P
I wasn't satisfied with the darque shadows and their quality, and thought that will help to understand how blender’s light works. For a deeper information about this matter please refer to http://download.blender.org/document...Spotlight.html
by Olivier Saraja.
Ok, lets go on:
First we are going to subdivide the cube a little. This is for adjusting the margins when we have more complex meshes to be baked.
Now lets light 'em up!
- Select the cube.
- Enter Edit Mode (TAB Key)
- Select All (A Key)
- Press W for Specials Menu
- Select Subdivide
- Subdivide once more
- Exit Edit Mode
Nowadays, the Lamp light can cast shadows but you can't worque with them. We will use spot lights which are more configurable to cast shadows for our objects and emulate the shadows cast by our Lamp light.
In order to do this:
First select the lamp and disable “Ray Shadow”. Now we don't have any shadows.
With the lamp selected, press Shift+D to duplicate and without moving the mouse press LMB, so we have the duplicated light at the same exact position as the original one.
Because it will be hard to select one or the other light, change the UV/Image window to the Outliner.
Within the outliner, select the Lamp.001 and go to Lamp Options
Change the selected Lamp button for Spot. We can see we have more options now.
If all goes well the spot will be heading for our Red Sphere. If not, just rotate the spot to do that.
With the spot selected hit ALT+D to create an instance. Without moving the mouse LMB again. We do this because we want the same shadow intensity on both objects.
Rotate Lamp.002 to head toward the cone.
Now Select “Only Shadow” for this Lamp.002. Because Lamp.001 and Lamp.002 are instances the options changed in one light will change the other too.
Hit F12 to preview the scene.
We should have something like this.
Ok, we will handle our shadow's Hardness by controlling the Spot's Energy. Lets try 0.5
Hit F12 to preview the shadows. It seems much better now.
Lets bake the cube again to draw our new shadows on the wall. Press P to preview in real time. This is much better now, but if we are too close to the objects we can see that they don't have enough resolution.
Samples = 1 Samples=16
Max the light’s samples to 16 and bake again.
You can try different values at “Shadow and spot section” to get the desired effect.
Don't forget to save or repak the baked image before quitting Blender.
Ok, that's truly all.
Any questions mail to me at email@example.com