m3xican
12-22-2007, 04:38 AM
Hi,
I need to normalize a floating point texture to the range [0.0, 1.0].
The technique I'm using is the following (more info in this post (http://www.m3xbox.com/GPU_blog/?p=20) from my blog):
dump the texture data into a fp array using glGetTexImage look for min and max values in the array normalize the texture values using a fragment shader based on the formula norm_value = (value - min) / (max - min);
Does it exist a better way to do this (maybe without dumping the texture data, so using just shaders)???
I need to normalize a floating point texture to the range [0.0, 1.0].
The technique I'm using is the following (more info in this post (http://www.m3xbox.com/GPU_blog/?p=20) from my blog):
dump the texture data into a fp array using glGetTexImage look for min and max values in the array normalize the texture values using a fragment shader based on the formula norm_value = (value - min) / (max - min);
Does it exist a better way to do this (maybe without dumping the texture data, so using just shaders)???