Sharpen Heightfield Terrains

   3646   6   1
User Avatar
Member
92 posts
Joined: 3月 2013
オフライン
Does anyone know how to sharpen Heightfield Terrains? I would like to avoid sharpening the polygons. Curious if there's a way to do this on the voxel side of things.
User Avatar
Member
5104 posts
Joined: 2月 2012
オフライン
Hi,

You can perform an unsharp mask in VEX on a volume like this where the second input is the output of a HeightField Blur, using a Volume Wrangle SOP:

int index = nametoprim ( 1, chs("layer") );
float d = volumesample ( 1, index, @P );
@density += ( @density - d ) * ch("amount");
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
User Avatar
Member
92 posts
Joined: 3月 2013
オフライン
Wow, thank you. What are you inputing into the layer?
User Avatar
Member
5104 posts
Joined: 2月 2012
オフライン
tadian
Wow, thank you. What are you inputing into the layer?

height

This is inline with other HF SOPs that expects a layer name.

And make sure to bind height to density:

Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
User Avatar
Member
92 posts
Joined: 3月 2013
オフライン
Thank you so very much. This is awesome. I read up on the principles behind unsharp mask and not only does this work, but I understand it. Your explanation and graphic was very helpful.
Edited by tadian - 2023年3月27日 21:43:20
User Avatar
Member
1 posts
Joined: 2月 2021
オフライン
hi
thank you for your help.
is it okay to write it that way?

float d = volumesample(1,"height",@P);
@height += (@height - d)*ch("amount");

thank!
User Avatar
Member
5104 posts
Joined: 2月 2012
オフライン
yx042117
hi
thank you for your help.
is it okay to write it that way?

float d = volumesample(1,"height",@P);
@height += (@height - d)*ch("amount");

thank!

Yes that's valid as well.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
  • Quick Links