adamknauer1 Posted October 15, 2023 Share Posted October 15, 2023 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 ssstwitter.com_1697331574695.mp4 vdb_advection_withoutUVs.hipnc Quote Link to comment Share on other sites More sharing options...
Librarian Posted October 16, 2023 Share Posted October 16, 2023 2 wrang ? maybe it's correct 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); Quote Link to comment Share on other sites More sharing options...
adamknauer1 Posted October 16, 2023 Author Share Posted October 16, 2023 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 2023-10-16 00-46-57.mp4 Quote Link to comment Share on other sites More sharing options...
Librarian Posted October 16, 2023 Share Posted October 16, 2023 (edited) @adamknauer1 Hm gonna try to Find Correct solution and Hope that someone gonna Jump in Discussion And Help 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 October 16, 2023 by Librarian Quote Link to comment Share on other sites More sharing options...
adamknauer1 Posted October 16, 2023 Author Share Posted October 16, 2023 @Librarian I appreciate that! Would you be able to explain what this does? I am still learning VEX Thank you! Quote Link to comment Share on other sites More sharing options...
Librarian Posted October 16, 2023 Share Posted October 16, 2023 @adamknauer1 What I use when i See some Vex code and mainly because I know but does not mean that I understand "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. 1 Quote Link to comment Share on other sites More sharing options...
Librarian Posted October 17, 2023 Share Posted October 17, 2023 (edited) @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 October 17, 2023 by Librarian Quote Link to comment Share on other sites More sharing options...
adamknauer1 Posted October 17, 2023 Author Share Posted October 17, 2023 @Librarian Thank you for this! I didn't think of asking Chat GPT for vex help here! I will take a look at the videos Cheers, Adam Quote Link to comment Share on other sites More sharing options...
marcoF Posted August 23 Share Posted August 23 @adamknauer1 Did you find a solution on this topic? I am trying to get a result in this one too. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.