Selective reflection object..ray switch node

H_Molla

New member
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

New member
Would like to see that 'ray switch' node too, but in the meantime, you might want to try this node setup:



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:



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)



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:



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:



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



Gerardo
 

H_Molla

New member
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..
 

lardbros

Not so newbie member
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?
 

Attachments

  • RenderArtifact_v001.jpg
    RenderArtifact_v001.jpg
    169.7 KB · Views: 475

gerardstrada

New member
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

Not so newbie member
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

New member
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

New member
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:





Gerardo
 
Last edited:

sampei

New member
my humble apologies for this uncanny necro, but I can't get Gerardo's network (on the post above) to work in LightWave 10.1 and I am using dbw tools 2.1 and the last DP kit for versions for LW9.6->LW10.1 on 64 bit Windows.
I'm attaching a scene if anyone feels kind enough to have a look, I might have got something wrong but I've been at it all day and can't seem to get it to work...haven't tried older plugins or 32 bit since I don't have it installed.
ps.before anyone asks, yes I've used the search function and crawled google but no answers were found, so here we are
ALSO is there any way to apply this flow into a material node with no transparency inputs ? say I want a surface with simple skin to not be reflected, but simple skin has no transparency parameter, any way to do it ? as always thanks in advance for any insight
 

Attachments

  • selective_reflection_network_v001.zip
    12.1 KB · Views: 281
Last edited:

sampei

New member
alive and well old friend, despite spending another sunday night buried in lightwave (damn math nodes are giving me migraines)...
good to see you're still fighting the good fight by the way :D
 

gerardstrada

New member
my humble apologies for this uncanny necro, but I can't get Gerardo's network (on the post above) to work in LightWave 10.1 and I am using dbw tools 2.1 and the last DP kit for versions for LW9.6->LW10.1 on 64 bit Windows.
I'm attaching a scene if anyone feels kind enough to have a look, I might have got something wrong but I've been at it all day and can't seem to get it to work...haven't tried older plugins or 32 bit since I don't have it installed.
ps.before anyone asks, yes I've used the search function and crawled google but no answers were found, so here we are
ALSO is there any way to apply this flow into a material node with no transparency inputs ? say I want a surface with simple skin to not be reflected, but simple skin has no transparency parameter, any way to do it ? as always thanks in advance for any insight
Checking if something in SpotInfo has changed but in the meantime you could also try TA Extended ItemInfo (Item Index output).

As for cases of Materials, guess you can try a similar setup with TA Split Material or db&w Material Blender.



Gerardo
 

sampei

New member
Hi Gerardo and thank you for helping out :thumbsup:
I've tried with TA Extended Item Info but it didn't seem to make any difference, however after some tests with db&w material blender I did manage to achieve a result...but I can't say I understand what I created or if unnecessary nodes are present. Anyhow here's the network:



basically this is active in the sphere surface and blocks out any reflections from the floor surface which keeps reflecting every other surface in the scene.



I could carry out more tests (the scene is crashy as hell) as I am curious to see if I can get the SSS material to work..
 

sampei

New member
it works on the scene I posted on LW 10.1 64-bit ? I must have done something wrong then, gonna try again...
 

gerardstrada

New member
Just tried in LW 11.6x versions (sorry, don't have v10 currently installed).

After a quick consultation to Denis, it seems something has changed between 2011 and 2012. About the current version the ID Offset works only with "Type ID" output. Tried here and DP ItemInfo is working perfectly with TypeID and the shared setup in current versions. Just in case, let's remember we need to offset 1 for objects.



Gerardo
 

sampei

New member
:bangwall:
I can't get it to work, been trying again for the past few hours with no results. Any chance you could post the fixed lwo/lws that works for you or at least a screenshot of the correct network? I must be missing something painfully obvious...
 

gerardstrada

New member
The correct setup for the original case - that is to say, avoiding the reflection of the sphere in the floor and its reflection on the floor in the mirror - like this:



would be something like this:



DP ItemInfo node is getting the ID data from the floor. Remember this setup is for LW 11.6x. Perhaps it's not working in your case because of you are using a previous version.

As for the scene you have posted, the setup is different. Guess because the purpose is different too. What exactly are you trying to achieve? Can modify your scene based on that, but I could only save it as LW 11.6.



Gerardo
 

sampei

New member
so, just to be safe, in regards to the above network:
- network is applied to the ball surface (mine is a cube)
- Item Info is set to the "floor" object with ID-offset=1 (defaults of Time Mode Absolute and Time 0.0)
- for both Logic nodes Operation is set to "A Equal To B"
- Clamp node is set to Low 0.0 and High 1.0
this is what I get:



I'm inclined to think that at least one of the third party nodes isn't performing correctly....going to try older versions of DP Kit and db&w and see if that fixes it. If that fails I'll probably get LW11 trial to see what happens.
 
Last edited:
Top Bottom