Jump to content

Volume - Sample attr from point - Strange behaviour


BenWall

Recommended Posts

Hey there,

After spending a fair amount of time on SOP and VEX, I'm now learning basic volumes handling. I found a behavior I don't really understand and can't find any ressources on the subject.

I created a simple setup to change the density of a scalar volume with the distance to a point. Everything works as expected, but when I move the point to a bound of the volume, the density from on side seems to be "reflected" on the other side of this volume. Looking at the screenshot, we should only get yellow values on the left (where the point is), the right side should be blue.

Seems to me there are three possibilities here:

- My volume wrangle might be wrong,

- There is something I didn't understand about volumes,

- There is something wrong with the way I setuped the volume visualization.

 

Can someone explain what I didn't get right?

Thanks

houdini_volumewrangle_distance_bug.jpg

strange_density.hip

Link to comment
Share on other sites

Narrowing it down to avoid vex errors with a distance check, I still get the error :(
 

float dist = distance(@P, point(1, 'P', 0));
float d;

if(dist < chf('max_dist')){
    d = fit(dist, 0, chf('max_dist'), 1, 0);
    d = clamp(d, 0, 1);
    d = chramp('gamma', d);
    f@density = d;
}else{
    f@density = 0;
}

 

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