Archived

This topic is now archived and is closed to further replies.

Ahkron

Texture formats

Recommended Posts

Is it possible to have a texture format that has the format Red-Green-Alpha? I''m wanting to use a texture for passing in a 2-dimensional offset to a fragment shader (Stored in the first two components) along with the Alpha value for the pixel. I could use an RGB texture, but I''m wanting to do early Alpha Test before the shaders run (as its a damn site quicker and I''m using it a LOT). If there is no way of having a ?-?-A texture, could I change the Alpha Test to check against the B component instead of A?

Share this post


Link to post
Share on other sites
NV_Fragment_Program2 has conditional jumps. use those to abort...

older nvidia cards can emulate nvfp2... and if you have an ati ... well... be creative

Share this post


Link to post
Share on other sites
But aborting during a fragment shader is considerably slower than early rejection by alpha test (Unless I''ve been informed incorrectly, although my tests do seem to confirm this is true)

I really need to do it first as my fragment shader is EXTREMELY heavy.

Is there no possible way to do this??

Share this post


Link to post
Share on other sites
What''s wrong with an RGBA texture? The alpha test should still be at the same point in the pipline no matter how many colour channels your texture has.

Share this post


Link to post
Share on other sites
Monder is right. Even if you have only two texture components, the context will convert it into the graphic chip''s format, and that is usually rgba ( or argb or ... however 4 components ). So it''s no waste of memory to have the fourth component...

Share this post


Link to post
Share on other sites