Author Topic: Depth buffer texture  (Read 19552 times)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: Depth buffer texture
« Reply #105 on: July 20, 2012, 05:37:38 pm »
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....

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: Depth buffer texture
« Reply #106 on: July 20, 2012, 05:46:52 pm »
I set Config.maxTextureLayers to 4 layers and it wrote to me this error. Default wrote, that I have to set higher value...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: Depth buffer texture
« Reply #107 on: July 20, 2012, 05:52:33 pm »
Has the object been rendered with with less texture layers before?

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: Depth buffer texture
« Reply #108 on: July 20, 2012, 06:13:50 pm »
No, it was invisible, added to world and at running showed.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: Depth buffer texture
« Reply #109 on: July 20, 2012, 08:00:19 pm »
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).

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: Depth buffer texture
« Reply #110 on: July 20, 2012, 08:19:17 pm »
Still crashes... Textures are NPOTTextures, object is created by addTriangle(...) methods, has VertexController and is compiled by compile(true)

this doesn't working:
Code: [Select]
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);
« Last Edit: July 20, 2012, 08:22:56 pm by Thomas. »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: Depth buffer texture
« Reply #111 on: July 20, 2012, 08:28:23 pm »
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...

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: Depth buffer texture
« Reply #112 on: July 20, 2012, 08:46:33 pm »
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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: Depth buffer texture
« Reply #113 on: July 20, 2012, 08:49:48 pm »
I'll see if i can reproduce this...if two work fine, actually three should do too...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: Depth buffer texture
« Reply #114 on: July 20, 2012, 08:52:22 pm »
BTW: You have changed the Config-setting before creating the object, have you?

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: Depth buffer texture
« Reply #115 on: July 20, 2012, 09:03:33 pm »
Yes, in constructor of MyRenderer

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: Depth buffer texture
« Reply #116 on: July 20, 2012, 09:04:00 pm »
I can't reproduce this...if nothing else helps, i need a test case. I did this and it works fine:

Code: [Select]
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);

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: Depth buffer texture
« Reply #117 on: July 21, 2012, 02:47:05 pm »
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 :-\

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: Depth buffer texture
« Reply #118 on: July 21, 2012, 03:36:25 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... ???

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: Depth buffer texture
« Reply #119 on: July 21, 2012, 03:44:31 pm »
Have you tried without calling strip()?