Help in blending

Started by
15 comments, last by fazekaim 19 years, 8 months ago
glubuildmipmaps or GL_SGIS_GENERATE_MPIPMAPS is the problem,

BEST SOLUTION
--u will need to create the mipmap levels yourself (*.dds textures let u store the mipmaps with the texture)

NOT SO GOOD
--enable alpha testing AND blending so the edges fade out

Advertisement
I read, that the NVidia has a .dds photoshop plugin.
It generates and stores the mipmaps too?

it will generate the mipmaps but they will be wrong just like GENERATE_MIPM_MAP_SGIS + gluBuildMipMaps, u need to create each mipmap level yourself, and then save them together in a texture eg *.dds or ALTERNATIVELY u can load multiple textures
eg
leave_size64x64.tga
leave_size32x32.tga
..
1x1.tga
and when u construct the mipmaps use these texture data for the mipmap levels
How opengl generates mimaps exactly?

If I make mipmaps my own, I will see leaves from high distance with GL_EQUAL alpha test?

As You asked, here is my leaf's texture:

http://delfin.klte.hu/~fazekaim/leaf3.tga

How do you make mipmaps? Not simply scaling, I think :)
>>How opengl generates mimaps exactly?<<

basically glubuildmipmaps, SGIS_GENERATE_MIPMAP and the nvidia dds plugin (i assume) all use some sort of boxfilter thus say for the 4 pixels
10
10
if they downsize these 4 pixels into one pixel u will be left with (1+1+0+0)/4 = 0.5
which normally is what u want BUT not in your alpha channel for the leaves, here u want either 1 or 0 aterwise u are gonna see the white borders which u see.
thus u will have to generate the mipmaps yourself, making sure each mipmap level down to 1x1 contains alpha values of either 1 or 0 + not 0.123, 0.5, 0.876 etc which u will get if u use glubuildmipmaps, SGIS_GENERATE_MIPMAP and the nvidia dds plugin

>>If I make mipmaps my own, I will see leaves from high distance with GL_EQUAL alpha test?<<

i dont understand
OK. Thanks, a lot. :))

This topic is closed to new replies.

Advertisement