Jon
16-05-2007 18:45:57
This is sure a frustrating topic. Using fixed-sized textures even starts to look good.
However I have another working idea I would like to throw out for comment: changing the sampler state in a fragment program.
With code like:
one can in effect select the texture associated with state. I started looking into this in an attempt to perform dynamic array access of a state array. While state arrays are allowed, they need to be resolvable at compile time, so cannot be used for lookups. However changing these sampler states via if-then tests could still be performed.
With a binary search, the swap should be log(n) in time, and I think better performing than multiple passes.
I need to leave for an appointment in 15min, so I don't have time to think this through completely. But feedback would be appreciated.
However I have another working idea I would like to throw out for comment: changing the sampler state in a fragment program.
With code like:
float4 color = tex2D(state, coord);
one can in effect select the texture associated with state. I started looking into this in an attempt to perform dynamic array access of a state array. While state arrays are allowed, they need to be resolvable at compile time, so cannot be used for lookups. However changing these sampler states via if-then tests could still be performed.
With a binary search, the swap should be log(n) in time, and I think better performing than multiple passes.
I need to leave for an appointment in 15min, so I don't have time to think this through completely. But feedback would be appreciated.