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

   Views 446   Replies 4   Subscribers 0
User Avatar
Member
1115 posts
Joined: 4月 2017
Offline
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
4864 posts
Joined: 2月 2012
Offline
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
9130 posts
Joined: 7月 2007
Offline
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
1115 posts
Joined: 4月 2017
Offline
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
9130 posts
Joined: 7月 2007
Offline
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