From BlenderWiki

< Doc:Tutorials | Materials | BSoD
Revision as of 11:25, 4 April 2009 by Mindrones (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

[edit] Any reflection from the material

Shiny surfaces will reflect light to give us specular highlights. But real shiny materials also reflect the world around them. A mirror for instance will reflect most of the world around them. Polished or glazed surfaces will also reflect the world to some extent.

Blender like many powerful 3D applications has an excellent RAYTRACE render engine. It works by tracing a ray from the camera back to a light source calculating any reflection, refraction, or absorption. This type of rendering gives the most realistic simulation of a scene. However, because it has to trace back to every light source the render calculations take much longer than does a render without raytracing.

In the early days of 3D design, before raytrace renders, the only way of simulating reflection was by using complex image maps or by careful use of lighting to represent reflected light from surfaces. Blender itself has an old method of mimicking reflection called Env(ironment) mapping.

Opening Title scene of Elephants Dream uses Env Mirror effect


However, Blender's Raytrace renderer is now very efficient and fast. As a result it is much easier to achieve a reflection using Raytrace and that’s the method I shall explain here. If you want to learn about Env mapping go here:- http://mediawiki.blender.org/index.php/Manual/PartIV/Environment_Maps

[edit] Setting Raytrace in the material

In order to use Raytracing you have to set the renderer to use that engine, as well as enable any materials to use a Ray Mirror effect. The default for Blender is that the render is set to Raytrace so I suspect you have been rendering with it already. However, none of the materials we have used so far have raytrace reflection enabled so you probably haven’t seen the true raytraced effect.

NOTE:
If you have no intension of using raytrace reflection or shadows in an image there is no point in having it set in the render. Indeed renders will unnecessarily take up to 12 times longer to render. So if you don’t need raytraced reflections, turn it off in the renderer.


[edit] Reflections need something to reflect

Currently our scene has nothing to reflect as only the desktop has been modelled. However, we don’t need to model an entire office around our desktop. We can simulate the reflected color from the office walls by changing the world color to match what’s in my office.

  • Select the World button F8 and change the color.

image: BSoD-Materials-Textures-world1.jpg

This type of wall, the standard magnolia loved by architects and the office decorators, absorb a fair amount of light before reflecting it on. So I have set the color a lot darker than the actual color to obtain the correct reflection.

  • Set the HoR to 0.540, HoG to 0.427, and HoB to 0.275
  • Press ENTER to confirm those settings.
NOTE:
The default Blender world color is a dark blue (obviously chosen by the same person who opted for the Cyan texture color). I think I need to lie down in a darkened room for a while :-)


[edit] Adding the Power Supply for some close-up reflection

Apart from the walls and the world around my desktop, I have a power supply sitting on the desk as well.


If you look closely what appears to be shadow below the supply and its cable, you will see that it is in fact a reflection on the desk surface and not really a shadow. My office is evenly illuminated and therefore you don’t get many sharp shadows.

I have already created a simple mock-up of the power supply that you can quickly bring to this scene.

[edit] Layers in Blender

It’s been hiding in another layer ready to be revealed to you.


There are 20 layers available and you can place objects and lights in these and only those layers selected will render. The power supply that I have provided is on layer 2 so to select it, and keep layer 1 active as well:-

  • point the mouse cursor at the 2nd layer button, hold SHIFT and click LMB Image:Template-LMB.png

We will be looking at the power supply and wire material a little later, but for now let's enable ray mirror reflections in the desk material.

[edit] Set Raytrace reflections for the material

NOTE:
You should by now be gaining confidence and knowledge of the fundamental Blender tasks such as selection. Beyond this point I will only explain exact mouse or keyboard strokes for obscure, or new, keyboard strokes. If you forget what the key is, or mouse strokes are, just skip back to earlier exercises to refresh your memory.


  • Select the desktop object and move to the material button and the Mirror transp tab.


This tab may appear complex, dealing with things like Fresnel, Falloff, and IOR, but for our use, where we only need reflection, there are only 2 settings, and one button, that need concern us.

Ray Mir is the amount of raytraced reflections and varies between 0 and 1.

  • set it to 0.49

Depth is the depth of calculation Blender takes to trace the ray. The default is 2 but its range is from 0 (no raytrace reflections) to 10 (longer but more accurate raytracing renders).

  • Make sure it is set to 2.
  • To enable the Ray Mirror material effect turn on the Ray Mirror button.

Confirm that the renderer is set for Raytrace in the Render button.

  • F10



[edit] Render the scene so far

  • Either  LMB Image:Template-LMB.png click the render button in the Scene Button F10

or press F12


The whole surface is looking much more realistic. However, real materials and surfaces will have subtle details on them that make the eye distinguish reality.

[edit] Adding a History to a Material (Getting Dirty)







Redirects to fix

  • BSoD/Introduction to Materials/part1i → Doc:Tutorials/Materials/BSoD/part1i