VEX: Get Min/Max Values of a Texture (the Fastest Way?)

   1173   4   0
User Avatar
Member
1185 posts
Joined: 4月 2017
オフライン
Hi!

I need to find the min and max value of a displacement texture. I was using a Detail Wrangle to go over each pixel but its a bit slow with 4K textures. Is there a trick to getting the min/max values faster (with less calculations)?

-Olivier
User Avatar
Member
5130 posts
Joined: 2月 2012
オフライン
Hi,

The fastest method is likely to load the texture into COPs and use the Volume Reduce SOP. You have to split the volume into scalar volumes using the Volume Vector Split SOP as Volume Reduce SOP doesn't support collated volumes.

Attachments:
volumereduce.png (2.7 MB)

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
9426 posts
Joined: 7月 2007
オフライン
you can also use Statistics COP or Prefix Sum COP
Edited by tamte - 2025年4月21日 17:28:18
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
1185 posts
Joined: 4月 2017
オフライン
Oh, I was avoiding 20.5 because of the slow startup + crashes. I guess I wont have a choice.

Thanks for the infos!

-Olivier
User Avatar
Member
9426 posts
Joined: 7月 2007
オフライン
olivierth
I guess I wont have a choice.
You dont need 20.5 for Volume Reduce SOP
Tomas Slancik
CG Supervisor
Framestore, NY
  • Quick Links