>
> ---------- Mensaje reenviado ----------
> From: "Robert Osfield" <[EMAIL PROTECTED]>
> To: "OpenSceneGraph Users" <[email protected]>
> Date: Fri, 28 Nov 2008 10:54:14 +0000
> Subject: Re: [osg-users] Texture2D rendering problem
> Hi Arisonova,
>
> There isn't enough info about how you are setting up your scene graph
> to know precisely what the problem, and the image's aren't clear
> enough. So best I can do is make general suggestions. First up is
> learn about anisotropic filtering and clamp modes as these may well be
> part of the answer to your problem. The osgtexture2D examples shows
> these in action.
>
> Robert.
>
>
Hi Robert,
Is a basic osgViewer::Viewer with a simple scene graph with one light. The
object is loaded from a osg file, and I mofify a StateSet to add thre more
texture unit, these is the original stateSet:
StateSet {
UniqueID StateSet_2
DataVariance STATIC
rendering_hint TRANSPARENT_BIN
renderBinMode USE
binNumber 10
binName DepthSortedBin
GL_CULL_FACE ON
GL_LIGHTING OVERRIDE|OFF
0xba1 ON
GL_BLEND ON
Material {
DataVariance STATIC
ColorMode OFF
ambientColor 0.941177 0.941177 0.941177 1
diffuseColor 1 1 1 1
specularColor 0 0 0 1
emissionColor 0 0 0 1
shininess 0
}
BlendFunc {
DataVariance STATIC
source SRC_ALPHA
destination ONE_MINUS_SRC_ALPHA
}
textureUnit 0 {
GL_TEXTURE_2D ON
Texture2D {
DataVariance STATIC
file "images\estudioCompleteMap.png"
wrap_s CLAMP_TO_EDGE
wrap_t CLAMP_TO_EDGE
wrap_r CLAMP_TO_EDGE
min_filter LINEAR_MIPMAP_LINEAR
mag_filter LINEAR
maxAnisotropy 1
borderColor 0 0 0 0
borderWidth 0
useHardwareMipMapGeneration TRUE
unRefImageDataAfterApply FALSE
internalFormatMode USE_ARB_COMPRESSION
resizeNonPowerOfTwo TRUE
}
}
}
, then I add three decal textuers in this way:
stateSet.setTextureAttributeAndModes(texId, new osg::Texture2D(image),
osg::StateAttribute::ON);
stateSet.setTextureAttribute(texId, new osg::TexEnv(osg::TexEnv::DECAL));
Anyway, I'm going to play around with anisotropic filtering and the clamp
modes as you suggest me.
Best regards,
Iván.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org