jPCT-AE - a 3d engine for Android > Support

Strange behaviour with static Texture background

(1/2) > >>

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()

--- Code: ---TextureManager.getInstance().addTexture("textureBG", new Texture(BitmapHelper.rescale(BitmapHelper.convert(getResources().getDrawable(R.drawable.garden)), 512, 512)));

--- End code ---

And then in the onDrawFrame(GL10 gl)

--- Code: ---fb.blit(TextureManager.getInstance().getTexture("textureBG"), 512, 512, 0, 0, 512, 512, false);
world.renderScene(fb);
world.draw(fb);
fb.display();
--- End code ---

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"... ;)

Navigation

[0] Message Index

[#] Next page

Go to full version