PDA

View Full Version : Ray trace node



Captain Obvious
01-23-2008, 02:27 PM
I've been working on a custom ray trace solution in a nodal shader network today. I've gotten my experiment working, to a point. I'm doing a custom reflection shader, using only vector nodes and that sort of thing. I'm using a RayTrace node to do my actual ray tracing, and a mathematics network to feed into the Direction input. It all works well, and my formula(1) is working. However, the RayTrace node only checks the environment! It doesn't actually collide with any objects! Am I doing something wrong, or is this really the intended behaviour?

(1) D'=D-2(D*N)N
where D' is the reflection vector
D is the incoming vector
N is the surface normal
D*N is the dot product of D and N


EDIT: NEVERMIND! I forgot to connect world spot to ray trace start point!

zardoz
01-24-2008, 05:42 AM
can you show your node setup? I'm interested in this subject because it may help me understand better some of the nodes.
tx

stib
01-27-2008, 11:46 AM
Yes! I'd love to have a look at the ray trace node in action, it's one of those things I see all the time and never get time to play with properly.

Captain Obvious
01-27-2008, 07:19 PM
Yeah, sure! I'll post some examples tomorrow, if I can find the time.

I figured out a potential use for it, as well:

For this one image I was working on, the clients complained about the reflections in the "mercury-finish" desks, saying we should see things behind the camera in the reflections, rather than just the floor. Of course, the reflections were ray traced and accurate, but they still wanted to see things behind the camera. So I ended up rendering a separate reflection pass, and moved everything except the desks down a bit.

If I have a similar situation in the future, I can just use this node method and bend the rays a bit by modifying the input vector.

stib
01-27-2008, 08:39 PM
I'm flat out at the moment, but you've got me inspired to go and spend the ten seconds it will take to read the documentation. Good thing Newtek keeps it brief so us busy animators don't get bogged down by detail.