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

sampei
05-11-2014, 10:33 AM
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

probiner
05-11-2014, 11:38 AM
You're alive :O ehehe. Can't help. Just saying hi.

sampei
05-11-2014, 03:03 PM
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
05-12-2014, 11:04 PM
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
05-13-2014, 02:22 AM
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:

http://i.imgur.com/BLqaaeo.jpg

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.

http://i.imgur.com/P6y3KIh.jpg

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

gerardstrada
05-13-2014, 02:53 AM
TA Extended ItemInfo works here with the setup shared in 2011.

Anyway, glad you have found a solution :)



Gerardo

sampei
05-13-2014, 04:50 AM
it works on the scene I posted on LW 10.1 64-bit ? I must have done something wrong then, gonna try again...

gerardstrada
05-13-2014, 05:07 AM
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
05-13-2014, 08:20 AM
: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
05-13-2014, 09:57 PM
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:

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

would be something like this:

http://s4.postimg.org/x7qp3roel/refexclude3.png

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
05-14-2014, 01:35 AM
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:

http://i.imgur.com/oTUNI6P.jpg

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.

gerardstrada
05-14-2014, 03:41 AM
Time mode is irrelevant in this context unless you plug a constant or envelope to the Time input parameter (for replacing or offsetting current LW time). High Parameter in Clamp node should be 1.0 in order to get 100% transparency.

Just in case, I'm attaching a very simple LW 11.6 scene. Hope it works in v10.



Gerardo

dpont
05-14-2014, 03:52 AM
...for both Logic nodes Operation is set to "A Equal To B"!...

I think that for filtering further bounces,
you may need to check "A Greater or Equal to B".

Denis.

sampei
05-14-2014, 04:57 AM
Time mode is irrelevant in this context unless you plug a constant or envelope to the Time input parameter (for replacing or offsetting current LW time). High Parameter in Clamp node should be 1.0 in order to get 100% transparency.

Just in case, I'm attaching a very simple LW 11.6 scene. Hope it works in v10.



Gerardo

Thanks for the scene Gerardo, going to try it now. High Parameter is 1.0 (as default) I edited the typo...sorry about that.

edit_this is what renders out from LW 10.1 (layout told me I didn't have "node handler" not sure if relevant):

http://i.imgur.com/c5ukabP.jpg


I think that for filtering further bounces,
you may need to check "A Greater or Equal to B".

Denis.

Hi Denis going to try that too, thanks for the input and for the awesome nodes.

edit_no luck, tried using "A Greater or Equal to B" on both Logic nodes at the same time, then on just (1) and (2) separately and got the following:

http://i.imgur.com/D5IYlnC.jpg

http://i.imgur.com/4LNbREI.jpg

http://i.imgur.com/xmVMZnx.jpg

going to try older versions tonight and report back..

gerardstrada
05-14-2014, 06:59 AM
edit_this is what renders out from LW 10.1 (layout told me I didn't have "node handler" not sure if relevant):
Nope. Not relevant. But result is not what is got in LW 11.6. You should get no reflection of the ball in the floor and its reflection on the floor in the mirror like in the sample:

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

If no Item Info version makes any difference, could be something related with LW version directly. I'd try with a previous version of db&w Extended SpotInfo as well, just in case.



Gerardo

sampei
05-14-2014, 11:59 AM
tried some older versions of db&w and DPont but found no definitive solution, so at this point it must be something in LW 10.1 that's not adding up. In any case:

- versions of db&w previous to 2.1 work as expected but only in VPR and with minor artifacts while in 2.1 only the reflection in the mirror is canceled but the one in the floor is still there (also in VPR). On F9 renders no reflection or shadow is canceled in any version (as if no setup is applied). All of this using it in conjunction with DP Kit for LW 9.6-10 64-bit.

- using other versions of DP Kit either produces some strange artifacts or the nodes cannot be loaded

- tried combining with TA Extended Spot Info with no ideal results

..don't really know what else to try, I suppose it must be a LW 10 problem.

Got the discovery LW 11.6.3 installed and the scene renders out correctly. I've added the shadow to the setup by subtracting Shadow Ray ( spot info ) from Ray Source ( extended spot info) with no issues. However I'm getting some faint artifacts in the shadow pass (can only be seen if the shadow is canceled) and in the reflection pass (see picture below, it's barely visible ). Tried messing around with the clamp but that only made it worse...any ideas ? (the artifact was there from the beginning so unrelated to the shadow ray addition)

http://i.imgur.com/LAYL3Fr.jpg

gerardstrada
05-14-2014, 07:41 PM
Got the discovery LW 11.6.3 installed and the scene renders out correctly. I've added the shadow to the setup by subtracting Shadow Ray ( spot info ) from Ray Source ( extended spot info) with no issues. However I'm getting some faint artifacts in the shadow pass (can only be seen if the shadow is canceled) and in the reflection pass (see picture below, it's barely visible ). Tried messing around with the clamp but that only made it worse...any ideas ? (the artifact was there from the beginning so unrelated to the shadow ray addition)
A pity that this is not working in LW 10, but glad is working in last LW version. As for the artifact, that's a portion of the blurred reflection on the floor. This portion is the intersection between the first ball reflection (from the actual ball) and the second ball reflection (from the reflected ball in the mirror). The way to solve this was provided by Denis just a couple of posts before:


I think that for filtering further bounces,
you may need to check "A Greater or Equal to B".

Denis.

Make this in the Logic node for the bounces :)



Gerardo

sampei
05-15-2014, 01:48 AM
you are correct Gerardo, now it renders out perfectly ! thank you for being so patient, a true samaritan :beerchug:
ps.if anyone from newtek reads this, it wouldn't be a bad idea to include a ray-tracing tab in the object properties panel with exclusion switches for shadows, reflections, transparency etc. extending to every object in the scene.

lardbros
05-15-2014, 01:56 AM
you are correct Gerardo, now it renders out perfectly ! thank you for being so patient, a true samaritan :beerchug:
ps.if anyone from newtek reads this, it wouldn't be a bad idea to include a ray-tracing tab in the object properties panel with exclusion switches for shadows, reflections, transparency etc. extending to every object in the scene.

Yep... I'd second this! Would love all these ray trace settings per object or per surface!!

gerardstrada
05-15-2014, 03:43 AM
Yep... I'd second this! Would love all these ray trace settings per object or per surface!!
Third this! per object and per surface, please :)



Gerardo

erikals
05-15-2014, 03:51 AM
+ AA settings per object / per surface... :]