Strange behaviour with static Texture background

Started by livingcode, December 18, 2010, 05:42:32 PM

Previous topic - Next topic

livingcode

Hello!
I want to make a static background (from picture) and to show a simple cube infront of it. I have modified the Hello World example - instead of using color for background, I used 512*512 big Texture. But when I rotate cube, something strange happens:

(when I load it and don't touch it)




(the more I touch/rotate it, the more it fades!)

Code modifications:
I load my texture into TextureManager from onCreate()
TextureManager.getInstance().addTexture("textureBG", new Texture(BitmapHelper.rescale(BitmapHelper.convert(getResources().getDrawable(R.drawable.garden)), 512, 512)));


And then in the onDrawFrame(GL10 gl)
fb.blit(TextureManager.getInstance().getTexture("textureBG"), 512, 512, 0, 0, 512, 512, false);
world.renderScene(fb);
world.draw(fb);
fb.display();


What am I doing wrong? How can I fix it?
Thank You!

Nick

Looks like the same problem as I have, there are some possibilities. You can look at the post I started a few days ago:

http://www.jpct.net/forum2/index.php/topic,1847.0.html

Hope it helps for you, it didn't that good for my project. It did only help for me a little bit when trying to edit the triangles.

EgonOlsen

Looks like as if you have removed the clear(), which prevents the zbuffer from being cleared. Try to add it back in and see if that helps.

BTW: I can't see the images in the post directly!?

livingcode

Omg, it works :) fb.clear() solves the problem. Thank You!

(I guess http://imageshare.web.id has some problems with displaying thumbs. It works ok, if you click on 'broken icon' :) )

EgonOlsen

If you think that not clearing the color buffer might be an option instead (there is a method called clearZBufferOnly() for this), you are actually right...but i don't recommend that either, because some phones with Qualcomm chips are having problems then and start to render minimized versions of the geometry multiple times per screen. Looks pretty funny though...

Edit: Firefox doesn't show a "broken icon"... ;)

livingcode

Heh if it works on my i7500, than it works anywhere ;) Heh (Google Chrome shows broken icon ;))

EgonOlsen


livingcode

Yes, I know ;)
Offtopic: I've seen here (http://www.jpct.net/forum2/index.php/topic,1853.0.html) that You still have 1.5 on Your Galaxy. Did You know that 2.2.1 is already possible on i7500? Works great, fast (as fast as i7500 can :D), only down side is that bluetooth doesn't work (im not sure about that, because I dont use it anyways..) Link: http://code.google.com/p/gaosp/

EgonOlsen

Yes, i know...but i'm somehow no friend of unofficial versions. Can't really say why, because it doesn't match my usual habbits. Might be because i want to use something that "real" people are using for development to be sure that it works for most "normal" phones. After all, the i7500 was pretty helpful (being the upper low end, incompatible device that it is) for optimizing things that might have remained untouched otherwise because current phones are fast enough anyway.

livingcode

That's true :) + I can be sure JPCT-AE works well on my i7500 :) Thank You!