5 ms·
Wouldn't it be possible to apply a pixel shader that does the tiling even though there is a texture atlas? Then tiling would be possible in both directions! The
by atesti 13y ago
Wouldn't it be possible to apply a pixel shader that does the tiling even though there is a texture atlas? Then tiling would be possible in both directions! The pixel shader would have to do the wrapping of u and v.
Fabian Giesen (rygblog) wrote at
http://fgiesen.wordpress.com/2011/07/01/a-trip-through-the-graphics-pipeline-2011-part-1/ http://fgiesen.wordpress.com/2011/07/01/a-trip-through-the-g...
"Some of the API state may actually end up being compiled into the shader – to give an example, relatively exotic (or at least infrequently used) features such as texture borders are probably not implemented in the texture sampler, but emulated with extra code in the shader"
- picomancer 13y agoYou certainly could, but this trades off fill cost against polygon count. I.e. you're using more complex calculations per-pixel for a smaller number of per-vertex/per-polygon computations. It'd be interesting to look into the question empirically of whether this optimization would be worthwhile. Also it depends somewhat on the specifics of the application. Two factors come to mind: (1) Draw distance (drawing many faraway polys that are only a few pixels on-screen probably favors poly-count reduction more) (2) Extra pixel shader complexity. If you're doing fancy per-pixel stuff with lighting or shadows or whatever, your optimization should become more attractive, because starting with your optimization and adding that extra stuff reduces the percentage of the per-pixel computation that's spent on your optimization.