Jump to content

UVs on VDB Advection Using Dual Rest


Recommended Posts

Hello all,

I am struggling to get proper UVs to move along with this vdb surface advection (courtesy of artist Jose Leon Molfino). I assume you would just make the UVs the same as the rest attributes but I am not getting the same results (as the video I attached).

 

There is not much out there for blending dual rest and adding UVs to a growth simulation.

 

If someone knows the solution it would be a great help to my personal project!! I attached Jose's file below which I would like to figure out how to add UVs too.

 

Thank you very much!

https://x.com/Jose_Molfino/status/1585375392101064704?s=20

vdb_advection_withoutUVs.hipnc

Link to comment
Share on other sites

2 wrang ? maybe it's correct :wub:
 

f@rest_ratio = fit(cos(2.0 * $PI * @Frame/chf("amount_of_frames")), -1,1,0,1);

amount of frames  ch("../CTRL/dualrestrate")

string filename = chs('texturemap');

v@map1 = colormap(filename, v@rest);
v@map2 = colormap(filename, v@rest2);

v@Cd = lerp(v@map1,v@map2, f@rest_ratio);

 

sfsssfg.gif

Link to comment
Share on other sites

Librarian,

Thank you for your response!! I played around with the VEX you wrote. This looks a lot like the video I attached!

However, the UVs remain untouched correct? These wrangles apply an image to follow the rest attributes and interpolate over the restratio back and forth I think.

I would like to export this alembic to another program and add displacement maps that follow and interpolate just as the colormaps do in the video I attached. Is that possible? 

 

Best,

 

Adam

Link to comment
Share on other sites

@adamknauer1 Hm gonna try to Find Correct solution and Hope that someone gonna Jump in Discussion  And Help :wub:

What if you use this and promote to vertex
 

@restratio = fit(cos(2.0 * $PI * @Frame/30.0),-1,1,0,1);

vector uv1 = v@rest;
uv1[0] += uv1[2];
uv1[1] += uv1[2];

vector uv2 = v@rest2;
uv2[0] += uv2[2];
uv2[1] += uv2[2];

v@uv1 = uv1;
v@uv2 = uv2;

 

Edited by Librarian
Link to comment
Share on other sites

@adamknauer1 What I use when i See some Vex code and mainly because I know but does not mean that I understand  :wub: "its Huge difference".
I use chat GPT ... sometimes its shows some minor error in explanations ... I'm Collector and Just Having Fun in Houdini ...

This code is written in VEX, which is a high-performance shading language used in Houdini, a 3D animation and visual effects software. The code is designed to manipulate UV coordinates for a specific purpose, and it appears to be working with two sets of UV coordinates: `v@rest` and `v@rest2`. Let's break down the code step by step:

1. `@restratio = fit(cos(2.0 * $PI * @Frame/30.0), -1, 1, 0, 1);`

   - `@restratio` is a user-defined attribute that's being calculated.
   - It's using the `fit` function to remap the range of values from `cos(2.0 * $PI * @Frame/30.0)` from the range of -1 to 1 to the range of 0 to 1. This means it takes the cosine of a value based on the frame number (@Frame), scales it to the range of -1 to 1, and then remaps it to the range of 0 to 1. The result is stored in `@restratio`.

2. `vector uv1 = v@rest;`

   - This line initializes a vector variable `uv1` and assigns it the value of the `v@rest` attribute.

3. `uv1[0] += uv1[2];`
   - `uv1[1] += uv1[2];`

   - These lines modify the `uv1` vector by adding the value of `uv1[2]` to both the X and Y components of the vector. This operation effectively moves the UV coordinates in the XY plane based on the value of `uv1[2]`. It might cause a translation in the UV space.

4. `vector uv2 = v@rest2;`

   - This line initializes another vector variable `uv2` and assigns it the value of the `v@rest2` attribute.

5. `uv2[0] += uv2[2];`
   - `uv2[1] += uv2[2];`

   - Similar to what was done with `uv1`, these lines modify the `uv2` vector by adding the value of `uv2[2]` to both the X and Y components of the vector.

6. `v@uv1 = uv1;`
   - `v@uv2 = uv2;`

   - Finally, the modified `uv1` and `uv2` vectors are stored back in the `v@uv1` and `v@uv2` attributes, effectively updating the UV coordinates for these two sets.

In summary, the code appears to be transforming UV coordinates for `v@rest` and `v@rest2` based on a time-dependent value, possibly creating a shifting effect in the UV space. The `@restratio` attribute is used as a scaling factor to determine the amount of transformation applied. The exact visual effect and purpose of this code will depend on how these UV coordinates are used in the broader context of a Houdini project.

  • Like 1
Link to comment
Share on other sites

@adamknauer1 Here its files and other resource to  export . Inside yours file you have color and displacement Vex .just investigate.Have Fun.
https://www.youtube.com/watch?v=1h15stU-TaE

https://www.youtube.com/watch?v=vRSff7FakgE

https://www.youtube.com/watch?v=dc4g1l4rxOU

https://www.youtube.com/watch?v=Oue4qUfea4I
https://www.youtube.com/watch?app=desktop&v=HMh3JyGui1Q

 

Blen.rar

Edited by Librarian
Link to comment
Share on other sites

  • 10 months later...

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