Jump to content

Texel Density/DPdu/dv baked onto attributes for geo


Sevro

Recommended Posts


I am struggling a bit to build a setup that can bake DPdu/dv onto the points/vertex of an object.  I am trying to then pass this info onto a series of scattered points across the surface that I am caching before passing to another application.

The issue is I cannot seem to calculate DPdu for instance on a surface in a SOP network.  

Apparently Du(), primduv(), etc all don't work in sops and only in shading networks.

I have got something kind of working using the polyframe node.  But the issue is it isn't doing exactly what i need, specifically it seems to be normalizing the vectors.   It says there is an option to orthogolize the output tangentu,tangentv vectors but does seem to be doing that wether that option is checked or not.  Basically I have a box for instance with UDims uv's assigned, and several of the sides have the uvs rotated 45 degrees and zoomed in.  When i view the resulting tangentu/tangentv coming out of the polyframe node they seem to pick up the correct orientation, and are indeed rotated 45 degrees on the facts that are rotated.  However the vectors all seem to be normalized to be 1 in size.  So I cannot then look at the vector size to get texel density/scale for the surface. 

So basically is there a way to get the tangentu/v on a surface from the uv's coming in for an object, such that I can figure out the texel density and at the same time the orientation of the uv's on the surface?

I guess if i could get the scale factor for u or v in world space that would be also enough.   I mean basically I just want the rare unnormalized DPdu values for a piece of geometry that I can then assign to points I scatter across the surface as an attribute?  

I have banged my head against this for a day now, so really appreciate any insights the geniuses on this forum might have, that would save  me another day or so of trying to figure this out.
 

Edited by Sevro
Link to comment
Share on other sites

I think i got it working...

Is there a way to enforce that you want a vector to display like normals in the viewport. Like the tangents for instance that come out of polyframe?

I have figured out what I was missing about vex and executing on vertex vs points to get call uvsample, but just no sure how to get the gradients i am calculating to display as vectors in the viewport...?
 

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