Realistic Lighting with LDRI Images by Toni Bratincevic, Croatia

After the click, new window will pop up, named Create Render Node. In that window, open the Texture section. Then, turn off the "With New Texture Placement" Option and in 2D Textures click on to the File. At this moment, the new file node is created and it is connected to the Color Offset option of the LDRI_Image node. To see the whole shading network in the work area of the hypershade select the surface Shader node and click Graph > Input Connections. The shading network should look like this:


Since new file node doesn't have any place2Dtexture node connected to it, it would be mapped with the default parameters of placement, and we don't want this to happen since it will not be correctly rotated, just like the LDRI_Image node was before. And, since we have the correct place2Dtexture node with the right rotation values, we will connect it to the fresh created file node. Remember that place2DTexture node can be attached to as many nodes as you want, but they must be from the 2D Texture section. Press and hold CTRL and with your middle mouse button drag from place2DTexture and drop to the File node. This will create the connection to the file, like in picture:


The file node is empty, and that means that we must point it to the image file. Double click on the file node to open attribute editor. First, rename this node to something like Sun_Scale, then click on the small folder icon on the right side of the Image Name attribute and select the sunscale.tga image. We did it, the first scale map is attached to image. ;) If you do a test render at this moment the rendered image should be similar to the one without scale map, but there is one little difference, the sun looks much brighter than in original picture. ;)


Let's explain things a little bit more. The Color Offset can be used to increase the color values of the original image. This means that if the pixel x in the original image has the color of RGB 0.2 0.2 0.2, and if we increase the Color Offset value to 0.5 0.5 0.5, then the brightness of the pixel x will be offset to the color value of 0.7 0.7 0.7. So, if we connect the image (sunscale) to the Color Offset of the original image, where the sunscale image is black it will not offset the color in original image, but in the areas where the sunscale image is white it will offset the color of the original image by 1. I hope you understand what I'm talking about? :)

At the end, we will also connect the last scale map, named skyscale.tga, to our shading network. To do this, in work area of hypershade view double click on the SunScale node. When attribute editor opens, in the Color Balance section click on the little Box on the right side of Color Offset slider. In Create Render Node window at the Texture > 2D Textures section click on File. This will create the new file node ... and the attribute editor for the node will be automatically opened when you do this. Rename this node to Sky_Scale and in the File Attributes section > Image Name click on the folder icon on the right side of this attribute. Select the skyscale.tga image and click ok. The shading network should look like this:


As you probably know, we must connect the place2DTexture node to the Sky_Scale node to get the correct mapping. So, with CTRL pressed, drag with middle mouse button the place2dTexture node and drop it to Sky_Scale node.


Now our shader has been build up correctly. How does this shading network works? Well, as you see the Sky_Scale image node is connected to the SunScale Color Offset attribute and the Sun_Scale is connected to the LDRI_Image Color Offset attribute. This means that where the Sky_Scale image is white it does the offset to the Sun_Scale image, and where the Sky_Scale image is black it doesn't. After the Sun_Scale image has been offseted, the Sun_Scale node does the same thing to the LDRI_Image image. So with this kind of setup, where the Sky Scale and Sun_Scale is black it doesn't scale the LDRI_Image. Where the Sky_Scale is white and Sun_Scale is black it does the offset to original image of 1. This means that if the pixel color of the original image has the color of RGB 0.7 0.3 0.1, with the offset it will have 1.7 1.3 1.1. And, where the Sky_Scale and Sun_scale is white it does the offset of 2 to the original image. With this trick we're simulating the effect that HDRI image has ... and that means that we are increasing the brightness of the image to values higher than 255 levels. ;) Enough of this, let's see what will we get if we do a test render:


Very nice, but in my opinion the sky is too bright. We can easily control the brightness of the sun, sky and the other parts of the image. How? Well, let's try this for the sky. Double click on the Sky_Scale image node to open the attribute editor. In the Color Balance section, move the Color Gain slider to the middle (GrayColor). This will decrease the sky brightness level. Ok, now remember the first part of tutorial where we calculated the sun scale value? ;) Yes, we will use it here ... double click on the Sun_Scale node to open attribute editor. Then in the Color Balance section click on the color Box on the left side of the Color Gain slider. The color chooser will pop up. In the Sliders section where it says V set the value to somewhere around 5. This will scale up the part of the original image where the sun is. That means, that areas where the white color in sunscale.tga image is, that part in the original image will be scaled by 5 (+ the scaling value of the skyscale). Let's do one test render.


There it is... but, it is not over yet. ;) You can also decrease the brightness of the original image by going in to the attribute editor of the LDRI_Image node and in the Color Balance section move the Color Gain slider to the middle of the line. And here it is, the final image:


I hope you have understand what I was talking about in this tutorial. The technique I showed you goes one step ahead compared to HDRI images, because you can have brightness control of every part in the LDR image. Remember that in the HDR images you can only change the exposition value. Ok, maybe my technique is not as real as the illumination with HDRI images, but it is not too far away from that. I just want to point out that this was a simple example, so be free to experiment with scale maps. For example you can try to use the scale map with gradient for the sky ... that will for sure give the interesting effect. Well, happy rendering and faking. ;) I hope this tutorial helped a little bit... Bye bye till next time... ;)

Related Links

Author's Website: www.interstation3d.com

Page 1 | Page 2 | Page 3 | Page 4
 

 
 
 
  Copyright © 2005-2007. All Rights Reserved