bsenftner
05-10-2001, 06:22 PM
I'm looking for links to information, sample implementations or what have you for something like the mip map generator in glu. I have the following situation that I'm trying to solve:
I have a two 24 bit diffuse textures, sized in a power of two in both the x & y dimensions. I have an alpha map, also sized in a power of two, but is not necessarially the same size as the two diffuse maps.
I need to generate mip maps for the first 24 bit diffuse map, but as the mip maps reduce in resolution I want the mip maps to grow progressively darker, with some mip map level that I specify to be completely black.
Then I need to generate mip maps for the 2nd diffuse texture, but I want to make the (possibly different sized) alpha map the alpha channel for this texture- converting the 24 bit map to a 32 bit map. Then I want to do the same thing with the mip maps as the 1st diffuse texture, ramp the lower level mips to black at some specified level.
Now I thought, at first, that I could use the OpenGL hardware to do all this mip map generation and alpha channel addition- but the maps could be larger than the resolution of the screen. So that won't work. So now I'm looking around for sample implementations of logic, or whatever aid that would allow me to perform this as a software process upon texture load. (I'll finally place the logic into a preprocess, off line step- so it won't affect the final run time.)
Okay, I know that what I'm asking about is elementary level math. I could just do it myself. But I'm sure that someone here knows of a simple software image compositor in library or source form that I would be able to use. It would save me the time to implement and debug, plus if someone has taken the time to do this well, it will be faster and probably use SMID and 3DNOW, which is better than what I would write.
Thanks for ANY suggestion.
-Blake
I have a two 24 bit diffuse textures, sized in a power of two in both the x & y dimensions. I have an alpha map, also sized in a power of two, but is not necessarially the same size as the two diffuse maps.
I need to generate mip maps for the first 24 bit diffuse map, but as the mip maps reduce in resolution I want the mip maps to grow progressively darker, with some mip map level that I specify to be completely black.
Then I need to generate mip maps for the 2nd diffuse texture, but I want to make the (possibly different sized) alpha map the alpha channel for this texture- converting the 24 bit map to a 32 bit map. Then I want to do the same thing with the mip maps as the 1st diffuse texture, ramp the lower level mips to black at some specified level.
Now I thought, at first, that I could use the OpenGL hardware to do all this mip map generation and alpha channel addition- but the maps could be larger than the resolution of the screen. So that won't work. So now I'm looking around for sample implementations of logic, or whatever aid that would allow me to perform this as a software process upon texture load. (I'll finally place the logic into a preprocess, off line step- so it won't affect the final run time.)
Okay, I know that what I'm asking about is elementary level math. I could just do it myself. But I'm sure that someone here knows of a simple software image compositor in library or source form that I would be able to use. It would save me the time to implement and debug, plus if someone has taken the time to do this well, it will be faster and probably use SMID and 3DNOW, which is better than what I would write.
Thanks for ANY suggestion.
-Blake