java - Textures are not displayed on the sphere for Samsung Galaxy SL -
i studying rajawali framework android. tried first basic tutorial follows:
public class rrenderer extends rajawalirenderer { private directionallight mlight; private baseobject3d msphere; public rrenderer(context context) { super(context); setframerate(60); } protected void initscene() { mlight = new directionallight(1f, 0.2f, 1.0f); // set direction mlight.setcolor(1.0f, 1.0f, 1.0f); mlight.setpower(2); bitmap bg = bitmapfactory.decoderesource(mcontext.getresources(), r.drawable.earthtruecolor_nasa_big); diffusematerial material = new diffusematerial(); msphere = new sphere(1, 18, 18); msphere.setmaterial(material); msphere.addlight(mlight); msphere.addtexture(mtexturemanager.addtexture(bg)); addchild(msphere); mcamera.setz(-4.2f); } public void onsurfacecreated(gl10 gl, eglconfig config) { super.onsurfacecreated(gl, config); } public void ondrawframe(gl10 glunused) { super.ondrawframe(glunused); msphere.setroty(msphere.getroty() + 1); } } all doing creating sphere , adding earth image texture it. size of image 1024x512.
when run code on samsung galaxy sl, sphere not having texture instead in dark gray color. when run code on other devices (nexus 7 , sony xperia), texture displayed correctly. if utilize texture 512x512, texture displayed correctly on samsung galaxy sl.
i found hint dont know how proceed: opengl es 2.0 texture not showing on device
the min filters provided opengl are
gles20.gl_linear_mipmap_linear, gles20.gl_nearest_mipmap_nearest, gles20.gl_linear, gles20.gl_nearest
the texture seems rendering next line of code gles20.gltexparameteri(gles20.gl_texture_2d, gles20.gl_texture_min_filter, gles20.gl_linear);
i came conclusion device not render texture when mipmapping on.
java android opengl-es rajawali
No comments:
Post a Comment