About VEX Noise direction offset problem.

   1356   4   1
User Avatar
Member
60 posts
Joined: Feb. 2022
Offline
I implemented the noise according to the method of VEX Noise [www.sidefx.com], but the final result is that the whole is offset in the +x, +y direction. Is there a way to offset this offset?

Thanks for your help!



VEX Code
vector freq = chv("freq");
vector off = chv("freq_off");
vector amp = @Cd.r;
float rough = chf("rough");
float atten = 1;
float turbulence = chf("turb");

float mult_height = chf("mult_height");
vector active_v = anoise(v@P * freq + off, turbulence, rough, atten) * amp * mult_height;

v@P += active_v;

v@Cd = fit01(active_v.y, 0, 1);

f@pscale = 0.01;
v@Cd = chramp("color", active_v.y);
Edited by HenDaSheng - Oct. 13, 2022 04:55:45
User Avatar
Member
53 posts
Joined: Feb. 2017
Offline
You are offsetting it in your parameters right? I don't get what behavior is wrong exactly? What are you trying to achieve?
Technical VFX artist @ Housemarque / Sony Interactive Entertainment
User Avatar
Member
60 posts
Joined: Feb. 2022
Offline
罗伯特
You are offsetting it in your parameters right? I don't get what behavior is wrong exactly? What are you trying to achieve?
Thank you for your reply, I hope it can be offset in the four directions of x, -x, y, -y, and now it only offsets in two directions of x, y (as shown in the picture).
User Avatar
Member
4495 posts
Joined: Feb. 2012
Offline
The bounds of alligator noise is 0-1, so you need to remap it if you want it zero centered:

vector active_v = anoise(v@P * freq + off, turbulence, rough, atten);

active_v = fit ( active_v, 0, 0.7, -1, 1 ); // You can play with 0.7 to center the values based on your geometry.

active_v = active_v * amp * mult_height;
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | animatrix2k7.gumroad.com
User Avatar
Member
60 posts
Joined: Feb. 2022
Offline
animatrix_
The bounds of alligator noise is 0-1, so you need to remap it if you want it zero centered:

vector active_v = anoise(v@P * freq + off, turbulence, rough, atten);

active_v = fit ( active_v, 0, 0.7, -1, 1 ); // You can play with 0.7 to center the values based on your geometry.

active_v = active_v * amp * mult_height;

Thanks for your help, this is my attempt, adding the mapping of color and pscale on the basis of noise, friends who encounter similar problems can refer to.

vector freq = chv("freq");
vector off = chv("freq_off");
vector amp = @Cd.r;
float rough = chf("rough");
float atten = 1;
float turbulence = chf("turb");

vector mult_height = chv("mult_height");
vector active_v = anoise(v@P * freq + off, turbulence, rough, atten);

active_v = fit(active_v, 0, 0.7, -1, 1) * amp * mult_height;

v@P += active_v;
v@P.y += mult_height.y;

v@Cd = fit01(v@P.y, 0, 1);

@pscale = chramp("scale", @Cd.r) * chf("scale_mult") * 0.03;
v@Cd = chramp("color",v@P.y);
  • Quick Links