Depth buffer texture

Started by Thomas., June 30, 2012, 01:58:21 AM

Previous topic - Next topic

EgonOlsen

Try to set Config.maxTextureLayers to a higher value. Default on Android is 2 IIRC. If that helps, i should add a check to that method to provide better feedback than an array out of bounds....

Thomas.

I set Config.maxTextureLayers to 4 layers and it wrote to me this error. Default wrote, that I have to set higher value...

EgonOlsen

Has the object been rendered with with less texture layers before?

Thomas.

No, it was invisible, added to world and at running showed.

EgonOlsen

That's strange...i've an idea what might cause it, but i'm not sure...i've updated the beta-jar. Could you please download it and give it a try? If it doesn't help, try without calling strip() on the object (in case you are doing that).

Thomas.

#110
Still crashes... Textures are NPOTTextures, object is created by addTriangle(...) methods, has VertexController and is compiled by compile(true)

this doesn't working:
TextureInfo ti = new TextureInfo(tm.getTextureID(getTextureName(texture)));
ti.add(tm.getTextureID("PPH_image_buffer_first"), TextureInfo.MODE_ADD);
ti.add(tm.getTextureID("PPH_depth_buffer"), TextureInfo.MODE_REPLACE); // <- comment this and everything are fine !!!
object.setTexture(ti);

EgonOlsen

Have you tried to use the TextureInfo in the addTriangle()-call instead? Or at least a TextureInfo with the same number of layers? I think it's not possible to change the number of layers on an already created object that way...

Thomas.

Original texture layers count is one, increase to two is fine, to three not.  For me will be better, if I can change texture layers during the game for changing details without restart or rebuilding. But I going to try use the TextureInfo in the addTriangle() method tomorrow.

EgonOlsen

I'll see if i can reproduce this...if two work fine, actually three should do too...

EgonOlsen

BTW: You have changed the Config-setting before creating the object, have you?

Thomas.

Yes, in constructor of MyRenderer

EgonOlsen

I can't reproduce this...if nothing else helps, i need a test case. I did this and it works fine:


Object3D test2=new Object3D(10);
test2.addTriangle(new SimpleVector(0,0,0), new SimpleVector(1,0,0), new SimpleVector(0,1,0));
test2.addTriangle(new SimpleVector(0,1,0), new SimpleVector(-1,0,0), new SimpleVector(0,-1,0));
test2.setCulling(false);

TextureInfo ti2=new TextureInfo(TextureManager.getInstance().getTextureID("grassy"));
ti2.add(TextureManager.getInstance().getTextureID("leaves"), TextureInfo.MODE_BLEND);
ti2.add(TextureManager.getInstance().getTextureID("rock"), TextureInfo.MODE_REPLACE);

test2.setTexture(ti2);

Thomas.

I have no idea, where is problem, I also can't reproduce this. And even stranger is, that object with the TextureInfo is in another World, than the one, that causes the error :-\

EgonOlsen

Quote from: Thomas. on July 21, 2012, 02:47:05 PM
...that object with the TextureInfo is in another World, than the one, that causes the error :-\
Makes no sense to me. The crashing part references the texture coordinates of the current object. I don't see any chance how this should happen on some different object... ???

EgonOlsen

Have you tried without calling strip()?