The
radiosity of the poor... |
Hello friends!! I'm gonna teach you how to fake reflected light on objects. This
is so easy to do that I couldn't resist to show to you because this one
is really simple and works like hell. To achieve this effect, you just need to create a samplerInfo, a setRange, 2 vectorProducts, and a ramp. Now, connect the normalCamera to the input1 of the first vectorProduct. Set the operator to vectorMatrix. Connect the output of the vectorProduct into the input1 of the second vectorProduct. Let the operator to dot product. Connect the ouput of the second vectorProduct to the value attr. of the setRange, and set 1 1 1 to the old max and max values. Now connect the outValueX of the setRange into the VCoord of the ramp, and outValueZ into the UCoord. If you have a texture mapped to the color of your material, set the color0 (the first from the bottom) black and color1 to 1 1 1, then connect your ramp's outValue to the colorGain of your texture, or just connect it to your material's ambient (or any other attr. if you don't have a texture mapped into) Now you have your ramp mapped perfectly according it's normal to camera. If you render the object, you will notice (if you're not blind of course) that your object is still the same. Select the second vectorProduct and say, enter -1 in Y of the input2, and.. Oh a miracle!!! God is my witness!!! The object looks like illuminated from below!! Yes, it just looks because it ain't!! Ok, entering a positive or negative value in any axis drives the uv mapping in this/these axis. Just a note on 'more than one axis': according the connection you're using (pointWorld, Camera or Object), the mapping will change from one type to the other (different relative spaces)
With this method (fast and easy), you can fake... the radiosity of the poors... Here you can see a little quick example of what you can get: That's it folks!! Next tutorial, win a chance to understand how to use the skin shader!! ;-) |
Emmanuel Campin - July 10th 2000 |