[jitter] normalize shader
Joshua Kit Clayton
jkc at musork.com
Fri Oct 5 17:37:44 MDT 2007
- Previous message: [jitter] normalize shader
- Next message: [jitter] normalize shader
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Oct 5, 2007, at 4:03 PM, Wesley Smith wrote: > So here's the best I can think of: > > make a fragment shader that looks to the left of itself and above > itself (and make sure you set border color to (0, 0, 0, 0). At the > location you're at, take the max of top and left and current and > output the result. This should produce the max values at the bottom > right corner of the texture. You can use that to normalize in another > stage. FWIW, this is not guaranteed, since fragments can be processed asynchronously in any order. The only guaranteed fragment shader based implementation is to write an N pass shader, which folds the texture down in each step, taking the maximum value. N will be related to the logarithm of your image dimensions. The base on the logarithm will be the number of input samples you fold to each output sample. you will probably want to use the jit.gl.slab dimscale attribute to scale down the output but the same factor as your folding. However, this might not be any faster than a CPU based implementation. -Joshua
- Previous message: [jitter] normalize shader
- Next message: [jitter] normalize shader
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
