Camera specular/reflection rig

   3944   6   1
User Avatar
Member
11 posts
Joined: July 2013
Offline
Basically I'm trying to create a DA that I can select a particular object and be able to control where the specular/reflect appears on the surface with respect to the camera.

I know I need to calculate the reflection angle with reference to the normal of the surface and the camera - but I want to be able to animate the point on the surface so I can control the position of the specular over time. So essentially it should be a null that I could move across the surface of the object and at the angle of reflection I'd have a light which would cause the specular (which would move accordingly if the null is moved). Sorry, does this make sense?

I've been scratching my brain with this all day as I know logically how to build it - I just can't figure out the best way to do it in houdini… yet (I'm going to keep trying but wanted to see if any one had any tips/ideas). Cheers
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Here's one way.

You could take the helper nodes and locator null and turn in to an asset then just parent your light to the rig.

Attachments:
light_spec_locator.hip (180.8 KB)

There's at least one school like the old school!
User Avatar
Member
11 posts
Joined: July 2013
Offline
Thanks Jeff, really like the solution - need to pick it apart a bit in order to get a better understanding of what you've done.
User Avatar
Member
11 posts
Joined: July 2013
Offline
Jeff, this method doesn't seem to produce the result I'm after (or I'm operating it incorrectly?). Here is a little screen capture of the same thing I'm trying to create in Houdini but made in Cinema4D…

When I move the locator in the scene the light doesn't update. Even when I look through the camera and move it a little the specular spot isn't accurate to the locator location?

Attachments:
camera_highlight_reversed.mov (12.4 MB)

User Avatar
Staff
2540 posts
Joined: July 2005
Offline
I guess you missed the note where I mentioned to move the specular locator in the camera view… If the locator looking through the camera's frustum doesn't “hit” the object, then the light will lock to the locator and not work.

I also mentioned that it makes most sense to look through the camera when adjusting the locator. Even in your movie, adjusting the spec locator when not looking through the camera puts the spec off as OpenGL is using the current view to calculate the spec hit.

My idea is to have these rigs follow the camera and work that way. Not bound to any geometry. Just hit whatever is in the camera view and go from there. You can pull the nulls real close to the camera as well.

The above file doesn't attempt to constrain the locator on the object which is the only thing not implemented in the file above as shown in the attached movie. Spheres aren't the best target geometry as you can apply a polar constraint and cheat a bit.

One way to constrain a null Object to target geometry is to use a Rivet Object which requires uv's on your target geometry. If you do have uv's then this works quite well. Holding down Shift while you drag the locator will constrain it to the current ray intersection in the viewport.

See the adjusted file attached.

I am avoiding turning this in to an asset and completely simplify it in hopes that you will.

I still kinda like the loosey goosey approach of the first file. Just have to look through the cam to make it all work and put the locator anywhere. The only time the spec location makes sense imho. I may be missing something big in the workflow so please elaborate if so.

Attachments:
light_spec_locator2.hip (1.1 MB)

There's at least one school like the old school!
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Oh I just remembered one use case where you want the spec to be on the object, locked in tight with nice guides over spec location, size and orientation.

Eyes.

Eye rigs that the animator can control the location, size and orientation of the spec spot and then have the light driven by that. Pretty easy to do that btw. Especially since the Physically Based Specular is angle based.

Eyes rarely use scene lighting for spec highlights in features.

Any more?
There's at least one school like the old school!
User Avatar
Member
11 posts
Joined: July 2013
Offline
Thanks Jeff that is brilliant - I actually realised what I was doing wrong when you pointed out the note (which I did read but miss interpreted ). I kept moving the locator light null and not the spec location null causing me to break the rig some how. The first solution works far better I see now

Really appreciate the help, now I just need to turn it into a DA like you said.

I was working with some colleagues to build this rig for a product animation where we wanted to trace the specular along edges. So far we've built it in Xpresso in C4D (think simple VOPs) and another of the guys has built a python version. But this implementation seems the most versatile.
  • Quick Links