[osg-users] Mip Maps
David Heitbrink
david-heitbrink at uiowa.edu
Wed Jan 18 16:22:51 PST 2017
I having an issue with rendering models with mip maps, when I render my scene I get some strange aliasing on text in the texture.
I am mostly using DDS files, some texture have mip maps, some do not. If they do not have a mip map defined I am setting:
texture->allocateMipmapLevels();
So to test this I added some test code to my shaders to manualy cycle through the mip map levels (FrameNum is a uniform that is incremented every frame):
Code:
vec4 texel = texture2D(TextureId,TexCoord[0]);
int txtLvl = textureQueryLevels(TextureId);
int lvl ;
if (txtLvl > 1){
lvl = (FrameNum/10) % txtLvl;
texel = textureLod(TextureId,TexCoord[0],float(lvl));
if (lvl == 0 ) texel.r+=0.5;
}
In most of my scene I am getting the red flashing every couple of seconds or so. But the texture does not blur out. In a handful of cases I have some textures that do blur out, but most do not.
Does any one have any ideas on what could be causing this issue?
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=69997#69997
More information about the osg-users
mailing list