Hi Koduri,

There are many things that could be happening.

First, I've seen that the file that your trying to load as texture is: "
images\\Concrete.Cast-In-Place.Exposed Aggregate.Medium.jpg", so you need
to check if you have the "osgdb_jpeg.a" plugin correctly built, if not then
you need to build it first.

Next, you need to set the plugin (jpeg) in the Android.mk file, so the
example will link with the jpeg plugin. Please, check the Android.mk file
in the android GLES1 example and add it if it's not there.

Finally, you must add the USE_OSGPLUGIN(jpeg) macro in your
osgAndroidExampleGLES1/jni/OsgMainApp.hpp file. This is completely
necessary because the current android solution uses static linking.

In case you decide to use the osgAndroid(https://gitorious.org/osgandroid)
project, then you will need to add use a similar approach, but the place to
add the macro is in the JNIosgDB.cpp file. I'm still thinking how to select
this things in runtime.

Hope this helps,
Rafa.

2012/9/10 Koduri Lakshmi <[email protected]>

> Hi,
>
> I build OSG3.0.1 on android with OpenGLES1.
> I red that Environmental mapping is not working on Android.
> So I created a simple box.osg with simple texture mapping. When I load
> this the box it rendered as white only. There is texture.
>
> When I saw OBJ folder in Install directory I have libjpeg.a, libpng.a and
> libtiff.a files. I think these are the plug ins.
>
> Here I am giving the box.osg
>
>
> Code:
> MatrixTransform {
>   DataVariance STATIC
>   name "__VIZARD_NODE__"
>   nodeMask 0xffffffff
>   cullingActive TRUE
>   description "# osgmaxexp material data
> Name    01 - Default
> Map     Diffuse 0       1       images\\Concrete.Cast-In-Place.Exposed
> Aggregate.Medium.jpg
> "
>   StateSet {
>     UniqueID StateSet_0
>     rendering_hint DEFAULT_BIN
>     renderBinMode INHERIT
>     GL_LIGHTING ON
>   }
>   referenceFrame RELATIVE
>   Matrix {
>     1 0 -0 0
>     0 1 -0 0
>     -0 -0 1 0
>     0 0 -0 1
>   }
>   num_children 1
>   MatrixTransform {
>     DataVariance STATIC
>     name "Box01"
>     nodeMask 0xffffffff
>     cullingActive TRUE
>     referenceFrame RELATIVE
>     Matrix {
>       0.364764 0 -0 0
>       0 0.364764 -0 0
>       -0 -0 0.364764 0
>       0 0 -0 1
>     }
>     num_children 1
>     Geode {
>       UniqueID Geode_1
>       DataVariance STATIC
>       name "Box01-GEODE"
>       nodeMask 0xffffffff
>       cullingActive TRUE
>       num_drawables 1
>       Geometry {
>         name "01 - Default"
>         StateSet {
>           UniqueID StateSet_2
>           name "01 - Default"
>           rendering_hint DEFAULT_BIN
>           renderBinMode INHERIT
>           GL_CULL_FACE ON
>           GL_LIGHTING ON
>           GL_NORMALIZE ON
>           Material {
>             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
>           }
>           textureUnit 0 {
>             GL_TEXTURE_2D ON
>             Texture2D {
>               UniqueID Texture2D_3
>               file "images\\Concrete.Cast-In-Place.Exposed
> Aggregate.Medium.jpg"
>               wrap_s REPEAT
>               wrap_t REPEAT
>               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 TRUE
>               internalFormatMode USE_IMAGE_DATA_FORMAT
>               resizeNonPowerOfTwo FALSE
>               shadowComparison FALSE
>               shadowCompareFunc GL_LEQUAL
>               shadowTextureMode GL_LUMINANCE
>             }
>           }
>         }
>         useDisplayList TRUE
>         useVertexBufferObjects FALSE
>         PrimitiveSets 1
>         {
>           DrawArrays TRIANGLES 0 36
>         }
>         VertexArray Vec3Array 36
>         {
>           -15 0 15
>           15 0 15
>           -15 0 -15
>           15 0 -15
>           -15 30 15
>           15 30 15
>           -15 30 -15
>           15 30 -15
>           15 0 -15
>           -15 0 15
>           15 30 -15
>           -15 30 15
>           -15 0 15
>           15 0 15
>           15 30 15
>           15 30 15
>           -15 30 15
>           -15 0 15
>           15 0 15
>           15 0 -15
>           15 30 -15
>           15 30 -15
>           15 30 15
>           15 0 15
>           15 0 -15
>           -15 0 -15
>           -15 30 -15
>           -15 30 -15
>           15 30 -15
>           15 0 -15
>           -15 0 -15
>           -15 0 15
>           -15 30 15
>           -15 30 15
>           -15 30 -15
>           -15 0 -15
>         }
>         VertexIndices UniqueID UShortArray_4 UShortArray 36
>         {
>           0 2 3 8 1 9 4 5 7 10
>           6 11 12 13 14 15 16 17 18 19
>           20 21 22 23 24 25 26 27 28 29
>           30 31 32 33 34 35
>         }
>         NormalBinding PER_VERTEX
>         NormalArray Vec3Array 36
>         {
>           0 -1 -0
>           0 -1 -0
>           0 -1 -0
>           0 -1 -0
>           0 1 0
>           0 1 0
>           -0 1 -0
>           0 1 0
>           0 -1 -0
>           0 -1 -0
>           -0 1 -0
>           -0 1 -0
>           0 0 1
>           0 0 1
>           0 0 1
>           0 0 1
>           0 0 1
>           0 0 1
>           1 -0 -0
>           1 -0 -0
>           1 -0 -0
>           1 0 0
>           1 0 0
>           1 0 0
>           0 0 -1
>           0 0 -1
>           0 0 -1
>           0 0 -1
>           0 0 -1
>           0 0 -1
>           -1 0 -0
>           -1 0 -0
>           -1 0 -0
>           -1 -0 0
>           -1 -0 0
>           -1 -0 0
>         }
>         NormalIndices Use UShortArray_4
>         ColorBinding OVERALL
>         ColorArray Vec4Array 1
>         {
>           1 1 1 1
>         }
>         TexCoordArray 0 Vec2Array 36
>         {
>           0 0
>           1 0
>           0 1
>           1 1
>           0 0
>           1 0
>           0 1
>           1 1
>           0 0
>           1 0
>           0 1
>           1 1
>           0 1
>           1 0
>           0 0
>           1 0
>           1 1
>           1 1
>           0 1
>           0 0
>           1 1
>           0 0
>           1 1
>           0 0
>           0 0
>           1 0
>           1 1
>           1 1
>           0 1
>           0 0
>           0 0
>           1 0
>           1 1
>           1 1
>           0 1
>           0 0
>         }
>         TexCoordIndices 0 UShortArray 36
>         {
>           9 11 10 12 8 13 14 15 16 17
>           18 19 4 5 7 20 6 21 0 1
>           3 22 2 23 24 25 26 27 28 29
>           30 31 32 33 34 35
>         }
>       }
>     }
>   }
> }
>
>
>
>
>
> Why the texture is not displaying.
>
> ...
>
> Thank you!
>
> Cheers,
> Koduri
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=49887#49887
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
Rafael Gaitán Linares
CTO at Mirage Technologies S.L - http://www.mirage-tech.com
gvSIG3D Developer - http://gvsig3d.blogspot.com
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to