Adverti horiz upsell
The Cornell Box Simulation: Raiders of the Last Node
The Cornell Box Simulation: Raiders of the Last Node
sdb1987, added 2005-09-13 12:06:35 UTC 61,314 views  Rating:
(4 ratings)
Page 2 of 3

5 - Open the HyperShade and with the middle mouse buton drag the distanceBetween node.

Now you'll need some extra node to achieve the desired effect.

Let's create it :

One Sampler Infos

One Clamp Node

One PlusMinusAverage

and a lambert shader

Let's do the connections.



Connect the samplerInfo.pointWorld to the distanceBetween.point1



Connect the distanceBetween.distance to the clamp1.inputR and set the clamp value



Connect the clamp1.outputR to the ramp1.vCoord



And the last one : connect the ramp1.outputColor to the lambert1.ambiant.

We forgot something very important for the shader to works.

Let's review all our nodes :

We use the sampler info Node to get information about wold space and fed this to the first point of the distance between .

The distance between value is clamped between 0 and 1 to avoiding repeting ramp. and at last we use a ramp to control the ambiant color of the Lambert shader.

But what we want is to use the distance between the wall and the ground to control the intensity of the ambiant color, so we need to convert the wordSpace into an objectSpace (actually the wall objectSpace).

To do this we need give to the distanceBetween Node the occupation in space of the wall plane.

In the Outliner right click and activate the shape display.

expand the plus symbol to the left of the wall plane and middle drag the shape in the HyperShade.

Connect the nurbsPlane.worldInverseMatrix to the distanceBetween.inMatrix1



Now we have a clomplete Shading Network for the ground but we have only one imput color for the ground and we have two colored wall.

So we need to add another network to get the second reflected color.

Duplicate the shading network



Attention ! when you duplicate the network Maya duplicate also the nurbs surface, you need to delete the duplicate one and reconect the good one (repete the step above).

Now we have two networks but we need to contract them into one in order to output one value to the ambiant color of the ground.

Remember when we started create node we created a plusMinusAverage node.

We gonna use it.

Connect the two outColor of the ramps to the input3D(0) and input3D(1) of the plusMinusAverage node.

(connect the first one and for the second right-click to input3D(0)attribute and choose Connect Next Avaliable)

Double click on the plusMinusAverage Node to open the Attribute Editor and set the operation to Sum.

Connect the plusMinusAverage.output3D to the lambert.ambiantColor.

Setup the ramp to coincide with the side walls colors.in this case one blueish and one redish.

Your HyperShade should look like this one below:



Now assign the lambert to the ground the roof and the back wall and the cylinder. Make another network for the sphere.

And render.