Skip to main content
GameDev.net gamedev.net
🔒 Locked

alpha textures

Started by Raloth Oct 18, 2003 at 9:03 PM 3 replies 400+ views
Original Post
Raloth
Raloth
From the MSDN: Each element is a single alpha component. It is converted to floating point format and assembled into an RGBA element by attaching 0.0 for red, green, and blue. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). That wastes way too much memory for what I will need (textures up to size 1024x1024). My original idea was to use a fragment program to extract rgba values from a texture and use them as an alpha value. This way I would be able to stick 4 alpha textures into 1 normal texture. Unfortunately, I don''t think the lower end of the video cards I want to support can run fragment programs. Is there any other way to make a texture with only alpha values?
____________________________________________________________AAAAA: American Association Against Adobe AcrobatYou know you hate PDFs...
Raloth
Raloth
Only 15 people have looked at this (one of them being me)?
____________________________________________________________AAAAA: American Association Against Adobe AcrobatYou know you hate PDFs...
TSwitch
TSwitch
What are you trying to do? Maybe if we knew what you were up to, we could help with some hackery.
Member of the Unban nes8bit or the White Rhino in my Basement Gets Sold to the Highest Bidder Association (UNWRBGSHBA - Not accepting new members.)Member of the I'm Glad Mithrandir Finally Found an Association that Accepts People with his Past History Association (IGMFFAAPPHA)
Raloth
Raloth
texture splatting

Each texture you want to splat needs a corrseponding alphamap, but it quickly eats up memory.
____________________________________________________________AAAAA: American Association Against Adobe AcrobatYou know you hate PDFs...
blizzard999
blizzard999
quote:
Original post by Raloth
texture splatting

Each texture you want to splat needs a corrseponding alphamap, but it quickly eats up memory.


Alpha map means a texture-image with a single component...in practice it''s common and simple to use 1BYTE alpha maps.
For example a big 1024x1024 alpha texture is 1MB.

Of course you need to store it somewhere (in system memory and/or video memory)...what you read about conversion from alpha to float RGBA color format is an internal algorithm performed by hardware to compute the fragment; I''m sure that OpenGL store the alpha texture in a more efficient way (but it depends by HW/drivers).
In other words...if you need ALPHA texture create a buffer of [w]x[h] BYTES and pass it to OpenGL with GL_ALPHA format. Then use GL_MODULATE to use the ALPHA channel in fragment computation.


Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.