Archived

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

Texture formats

This topic is 5020 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
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
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