Jump to content

Offset UVs based on angle, movement relative to camera


gubar

Recommended Posts

Hi,

I've got a problem I want to solve. Basically - I want to have a layered texture with different UV sets on a flat object, but I want the layers to appear to have depth within the object, with parallax between the layers. So, I'd like the UVs to be offset by different factors, and that offset to be driven by objects position, distance, movement, rotation relative to the viewing and render camera.


Normally I used Houdini for lighting so this is a challenge for me :)

Any advice gratefully appreciated!

Thanks,

G

Link to comment
Share on other sites

Hi Steven,

you can get camera coordinates using optransform() and cracktransform(). Here is a minimal example that shifts UVs based on the camera's position:

matrix xform_cam = optransform('../../cam1');
vector pos_cam = cracktransform(0,0,0,0,0, xform_cam);
v@uv = (v@uv + pos_cam) % vector(1.0);

 

offset_uv_by_camera_position.hipnc

  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...