PDA

View Full Version : Reflection Depth - Newbie Question



Mas
12-07-2006, 01:43 AM
I am wanting to create an effect similar to the itunes album cover animation where your album covers spin around on a reflective floor. I have a 1 M high object shaped like a rectangular book. It sits on a surface plane which uses the default LW9 mirror surface preset. How can I set up this mirror surface to only reflect say 50% of the book before the reflection starts to blur out and fade away into transparency?
Thanks in advance

Sekhar
12-07-2006, 07:05 AM
I don't know the ad you're talking about; but try setting Reflection to 50% for the floor and using Envelope (E) to ramp it down to 0% over time.

Iaian7
12-07-2006, 07:42 AM
Unfortunately, what you're wanting is reflection fading based on depth. Not terribly easy, last time I tried it. Until someone figures out a nice nodal setup for fading reflections based on ray length (should be possible!) I'd suggest setting your reflectivity between 25-50% and either using a very fine grain bump texture (say, turbulence with scale set to 10 um or something) or reflection blurring. It won't fade the reflection away, but it will at least blur them based on distance. Oh, and generally speaking, the fine grain bump will render a lot faster, especially if you're using decent AA.

Mas
12-08-2006, 12:36 AM
Thanks Iaian7,
Having an objects reflection fade out based on its height away from the reflective floor was what I was trying to achieve. Any nodal guru's out there with any pointers ?
Thanks in advance

Sekhar
12-08-2006, 02:09 AM
Mas, is the below effect what you need? First image ("Without") is with regular reflection, and the second ("With") tapers off with height. I did this using the RayCast node to detect how far the ball is away from the floor and then driving the reflection.

Mas
12-09-2006, 12:59 AM
Thanks Sekhar,
That is really close to the effect that I am looking for. After reading the manual and mucking around with nodes all day I still can't seem to replicate your renders. Two things,
1:
Would this technique work in a scene like the picture I have attached below
2:
Could you when you have a moment upload a screen shot of your RayCast node settings as after much experimentation I still don't really understand how to get it to work.
Thanks In Advance

Sekhar
12-09-2006, 04:52 PM
Sure, should work in any setting. See below an example render, node setting (for floor), and the LWS/LWO files.

The RayCast node tells you how long a ray travels before it hits an object. The basic idea here is to use that information to drive the reflection for each point on the floor. The vector stuff you see is to figure out the direction of the ray. Imagine a ray going from the camera, bouncing on the floor and then hitting the bar - the distance it traverses in the second leg (floor to bar) is what is driving the reflection here.

Iaian7
12-09-2006, 05:25 PM
Sweet! I've spent half the afternoon trying to figure out what needed to be done, and wasn't getting anywhere. This works perfectly!

What's the difference between using the Transform node (1,0,0 / 0,-1,0 / 0,0,1) and a Multiply node (1,-1,1)? I can't tell any change between the two.

Sekhar
12-09-2006, 11:56 PM
Yeah, gives nice renders. You could also use the multiply node - I just don't find it intuitive (since there is no such vector multiplication in real-life math).

Iaian7
12-10-2006, 12:33 AM
Gotcha. I guess nothing about math nodes seems intuitive to me, so the smaller the node, the less threatening. :D

Another question... This works great for length of ray from surface bounce to object, but what about the distance from surface to object? See the attached image for my explanation, but the issue is that the ray length won't animate nicely when the angle between the camera and the surface changes. The .zip file contains my edits to the scene (a very BAD hack at using incidence to control the gradient output), and then there's the two .mov files detailing the ill effects of angle changes. Well, that'd be the first one. The second one details just how bad my incidence hack is! Though it does work a bit better than none at all, I suppose.

Technically I suppose the effect is a bit odd. Where would one find it in real life? Though linoleum seems to have some sort of reflection fading, I'd guess it's more rough diffusion along with some retention of non-diffused, though much darker reflections, as lights are still visible at greater distances. I have seen surface to object (as opposed to surface-bounce to object) reflection limiting in other 3D apps, so in theory it should be doable.

Sorry to keep bugging on this; it's an effect I've wanted for a past project, with no real solution before!

Medi8or
12-10-2006, 05:01 AM
Just thinking here... If you scale the vector from spot to reflected object to the length from raycast, then get Y from a Vector Scalar node?

kyuzo
12-10-2006, 09:05 AM
Would using the occlusion shader as a mask for the reflection work?

Sekhar
12-10-2006, 11:39 AM
Iaian, reflection depending on the total ray length from point to object is the physically accurate way to do this...so that technique would work correctly regardless of animation. E.g., see my animation/setup in the below zip with both camera and object moving. Unfortunately I can't open your videos to see what you're getting, but then you also changed the node setup...

Now, for whatever reason if you do want the height of the reflection point from the base to drive the reflection, that would be the vertical component of the ray length, which you can get by factoring it down by the dot product of the vector from surface point to the object point and the normal vector on the surface - be sure you use unit vectors.

Kyuzo, I don't think you can use occlusion because that'll be affected by proximity to everything, not just that one object point that's being reflected. I.e., to different points on the object as well as to other objects in the scene.

Mas
12-11-2006, 02:11 AM
Thanks heaps for the help Sekhar,
I need to read up more to fully understand how the math, vector and raycast nodes work but this has been a great starting point and the visual result was exactly what I wanted to achieve.
Cheers,
Mas

kyuzo
12-11-2006, 02:32 AM
Yeah Sekhar,
I figured that out pretty quickly myself when I got to my LW PC and tried it. It might do the trick in 'certain' setups, but would be useless for an animation.
I wish I had a laptop to take LW with me everywhere!
I'm glad that Mas has the solution he wanted, and no doubt I'll be playing catchup and start trying to get my head around the nodes' math and raycast functions too.

Iaian7
05-01-2008, 11:35 AM
Update - a thread over on SpinQuad (http://www.spinquad.com/forums/showthread.php?t=17839&referrerid=13367) has the correct nodal reflection setup. Very, very useful. :D

tomasmachado
06-20-2011, 08:36 AM
Sure, should work in any setting. See below an example render, node setting (for floor), and the LWS/LWO files.

The RayCast node tells you how long a ray travels before it hits an object. The basic idea here is to use that information to drive the reflection for each point on the floor. The vector stuff you see is to figure out the direction of the ray. Imagine a ray going from the camera, bouncing on the floor and then hitting the bar - the distance it traverses in the second leg (floor to bar) is what is driving the reflection here.

last post 2008... let's see if i can still find signs of life here.

I've used the node structure to the letter, using similar objects (just didn't pay a lot of attention to the sizes). I even set up the rendering and cameras the same way... but off course... something had to go wrong, and the effect i get is nowhere near the one you got on yours. After thinking it through i understand the idea behind it, and it should work, but mine actually resembles the result from the post previous to the one i quote where the reflexion doesn't have a falloff, than this one. At one point I managed to get a bit of falloff but the result was all weird with just a triangle with falloff reflexion int the midle of the normal reflexion.
It is important to say that i am currently running the verion 10 of lightwave... any ideias?

XswampyX
06-22-2011, 07:43 AM
Try this :- 96072

http://i465.photobucket.com/albums/rr16/xXswampyXx/ReflectionTest.jpg

tomasmachado
07-02-2011, 03:52 PM
XswampyX

Thanks for the reply!

I've tried your solution, and it works exactly as the example you provided. For what i intended to do however it does have the problem of the texture. I've tried bypassing the "crumple" but being honest... i am in over my head when it comes to nodes. Is there any way of doing it? Otherwise the effect does seem to be what i've been looking for.

again, many thanks!

Iaian7
07-13-2011, 10:27 AM
Hey Tomas,

In XswampyX's node setup, the texture is what creates the effect in the first place - a blurred reflection. You can easily create a blurred reflection (without bump textures) by increasing the Reflection Blurring in the Environment tab of the Surface window. Another option, if you want a blurred reflection but no crumple, is to use DPont's gaussian reflection node (part of the superb DPkit (http://dpont.pagesperso-orange.fr/plugins/nodes/Additionnal_Nodes_2.html)). Iit gives fantastic control over reflection stretch effects, including decay (which I guess is new! will have to play with this now...hrm, no distance outputs, it just attenuates the brightness).

If you want to create a reflection that fades out (and gives you the distance data) you'll need a slightly more involved nodal setup (as was discussed previously in this thread). I'm attaching sample files for both fading (using the object's alpha channel for easy compositing) and floor (mixing between reflection and diffuse). You can adjust the distance of the reflection fading by changing the SmoothStep End value (set to 1m by default). Change the reflection falloff curve by adjusting the Power value (currently set to a rather aggressive 0.25).

Iaian7
07-13-2011, 10:49 AM
Oh, something I forgot - the reflection distance will sometimes return 0.0 for infinite distances (where no geometry is present at all), such as in the case of the ReflectionFloor.srf setup. The easiest fix is to create a giant box, flip the normals, and set it to unseen by camera in Layout (turn off shadow casting, receiving, self shadow, and radiosity, but leave seen by rays enabled).

...it may actually be returning -1 for infinite values, but I haven't tried testing for negative numbers.