Hey Joran,

I've just made a very simple scene with one cube with a diffuse map and an opacity map, and it doesn't work. I don't see the opacity map (aaargh.png) but only the texture (blue hills.png). This is what the materials in the OSG file look like:

Material {
            DataVariance STATIC
            ColorMode OFF
            ambientColor 0.588235 0.588235 0.588235 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\Blue hills.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_IMAGE_DATA_FORMAT
              resizeNonPowerOfTwo TRUE
            }
          }
          textureUnit 1 {
            GL_TEXTURE_2D ON
            Texture2D {
              DataVariance STATIC
              file "images\aaargh.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_IMAGE_DATA_FORMAT
              resizeNonPowerOfTwo TRUE
            }
            TexEnvCombine {
              DataVariance STATIC
              combine_RGB REPLACE
              combine_Alpha INTERPOLATE
              source0_RGB PREVIOUS
              source1_RGB PREVIOUS
              source2_RGB CONSTANT
              source0_Alpha TEXTURE
              source1_Alpha PREVIOUS
              source2_Alpha CONSTANT
              operand0_RGB SRC_COLOR
              operand1_RGB SRC_COLOR
              operand2_RGB SRC_ALPHA
              operand0_Alpha SRC_ALPHA
              operand1_Alpha SRC_ALPHA
              operand2_Alpha SRC_ALPHA
              scale_RGB 1
              scale_Alpha 1
              constantColor 1 1 1 1
            }

If it's a similar code to your example, could it have something to do with the video card..?

// Jan


From: "A.J. Jessurun" <[EMAIL PROTECTED]>
Reply-To: osg users <[email protected]>
To: osg users <[email protected]>
Subject: Re: [osg-users] Problem with Opacity map in OSG model
Date: Mon, 22 May 2006 13:19:52 +0200

Hello,

Made a simple scene with an object with an opacity and diffuse map. Exported it with OSGExp and it worked fine. So, opacity maps work.

Greetings, Joran.

Jan Waterman wrote:

Anyone??


From: "Jan Waterman" <[EMAIL PROTECTED]>
Reply-To: osg users <[email protected]>
To: [email protected]
Subject: [osg-users] Problem with Opacity map in OSG model
Date: Wed, 17 May 2006 15:13:51 +0200

Hi everybody,
 
I've exported a scene from 3DS Max with several objects on a floor. I've added a light above it so I can see the shadows of the objects. I made a lightmap texture for the floor by using Render to Texture. I chose this texture as an opacity map for the floor and it seemed to work fine.
 
Next thing. I used the exporter OSGExp to get the OSG file format. The lightmap was succesfully exported as a new .tif file. However, when viewing the OSG model, the lightmap doesn't seem to work... But when I look at the model in OSGEdit, I do notice a geode with a drawable that contains a StateSet. This StateSet consists of a Material, a BlendFuc and two tex unit 0's with a Texture2D attached. One tex unit 0 contains the texture of the floor, the other one contains the lightmap and has a TexEnvCombine attached as well. The BlendFunc source is set to Source alpha and the Destination is set to One minus source alpha.
 
Can anyone tell me what I'm doing wrong here? I'm really running out of ideas now. Is it even possible to use opacity maps in OSG?
 
Greets,
Jan

>_______________________________________________
>osg-users mailing list
>[email protected]
>http://openscenegraph.net/mailman/listinfo/osg-users
>http://www.openscenegraph.org/


_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/


>_______________________________________________
>osg-users mailing list
>[email protected]
>http://openscenegraph.net/mailman/listinfo/osg-users
>http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to