PDA

View Full Version : Selective reflection object..ray switch node


H_Molla
08-10-2011, 08:02 AM
I saw that node before, but can't remember
How can I assign different reflectors to two different object in the same scene..
The 1st one see only his reflector and the other one with his own..
It was ray switch or something node !!
Any heads up with me !!

gerardstrada
08-15-2011, 08:18 PM
Would like to see that 'ray switch' node too, but in the meantime, you might want to try this node setup:

http://imagic.ddgenvivo.tv/forums/RefExcl/refexclude2.png

Idea is to apply it into the surface of the object you want its reflection excluded from other specific objects. Let's see a simple example to understand better how it works:

Let's say we have an sphere, a reflective floor and a mirror beside the sphere:

http://imagic.ddgenvivo.tv/forums/RefExcl/ref1.jpg

And we want the sphere reflected in the mirror but not in the floor. Then, in the sphere surface, we set up the first part of our node configuration composed by Michael Wolf's Extended SpotInfo, Denis Pontonnier's Item Info and a Logic node (thanks to Juanjo Díaz for the original idea). RaySource ID provides the rays emitted from different sources, the Logic node (set up by default as If A is Equal to B) will find the ID of the item we pick in the Item ID node, if the ID from the ItemInfo is equal to the RaySource ID, then it outputs a 1.0 value, which will make transparent our object for the rays traced from that item. Then, since we want the sphere invisible for the floor, in the first ItemInfo Node, we chose the floor.
(the Subtract node is for matching the ItemInfo ID with the ExtendedSpotInfo ID by subtracting 1.0 value - thanks to Denis Pontonnier for the trick)

http://imagic.ddgenvivo.tv/forums/RefExcl/ref2.jpg

However, as we can see, we still have the reflection of the sphere (that it's reflected in the mirror) reflected in the floor. To avoid any reflection of the sphere in the floor, we use the second part of our node setup. Since this ray is an indirect ray bounced from the mirror, we get all rays bounced in the scene first (through the SpotInfo node) and discriminate the rays bounced from the mirror specifically by using other ItemInfo and Logic nodes as identifiers. Then, we chose the mirror for this second ItemInfo Node and set up the Subtract node and Logic node in the same way as the first part:

http://imagic.ddgenvivo.tv/forums/RefExcl/ref3.jpg

Let's notice that the reflection of the mirror is still in the floor. The reason for the clamp node is to keep an output value of 1.0 in the transparency channel - higher values can cause undesired results.

Consider the previous node setup will make the object's surface invisible not only for reflections, but for any type of ray, too. Then, this kind of setup can be useful for shadows, transparency, reflections, indirect bounces, occlusion, etc. In order to get soft shadows there, I used a DP_Light with Occlusion type shades, but if let's say we want to use LW raytrace shadows there, we subtract the shadow ray from the source rays before their logic operation:

http://imagic.ddgenvivo.tv/forums/RefExcl/RefExcldNoShdws.png

Same principle should be applicable for other type of rays available in the Spot Info node.



Gerardo

H_Molla
08-16-2011, 09:07 PM
Man...THANKSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
I wish i own 50% of your node experience :-D
Please try to find away to make tut or videos especially after 3D HDRI magazine stopped..

gerardstrada
08-22-2011, 09:23 PM
I'll try, Hesham :)
Glad it helps!



Gerardo

lardbros
09-10-2011, 10:15 AM
Hey gerardo, I've tried this setup and seem to have rendering issues. VPR kind of creates a blobby mess around the reflection of the cylinder, but an F9 still generates a small slither of something in my mirror object.


Any ideas?

gerardstrada
09-10-2011, 08:29 PM
Tim, I got those artifacts when final value at the end of the node tree was major to 1.0. The clamp node limits the final output to 1.0 (which is equivalent to transparency at 100%) and that solved the issue here. Otherwise, maybe you could share your node setup and scene settings.



Gerardo

lardbros
09-11-2011, 04:49 AM
Yeah, I have the clamp in place... That was the only bit I found easy :)

I'll post what I have, see if you can make more sense of it :) Was playing for hours yesterday, it's a cool setup. Just wish I could see internally what Lightwave and each node was doing with the info it's receiving and then what it's spitting out!

Thanks for your help, nods can achieve anything it seems! :)

gerardstrada
09-11-2011, 07:15 PM
You could replace each ID by a different color by connecting the ID outputs into a Hue input in a Color Tool node to visualize more easily what's happening. There's also an InputSpy node that allows to visualize values in our node trees, but in this case it won't help much since the surface needs to be evaluated.

Btw, other way to implement the same method is by replacing the db&w Extended Spot Info node by TruArt's Extended Spot Info (Source Item output) and DP Item Info by TruArt's Extended Item Info (Item output). In that way you won't need to match ItemID with RaySourceID (delete the node that it's subtracting 1.0). Though don't think it might make a difference for your case.



Gerardo

gerardstrada
09-14-2011, 09:06 PM
Btw, Denis Pontonnier has updated his Item Info Node (DPKit) so we don't need to subtract 1.0 from the item ID to match RaySource ID. We just set up the ID Offset to 0 within the Item Info Node.

i.e. the last node setup would be something like this:

http://imagic.ddgenvivo.tv/forums/RefExcl/newItemInfo.png



Gerardo