Author Topic: AdditionalVisiblityList Problems  (Read 1160 times)

Offline AGP

  • quad
  • ******
  • Posts: 1518
    • View Profile
AdditionalVisiblityList Problems
« on: June 25, 2011, 11:28:36 pm »
I'm getting WAY too many visibility lists created. I'm loading the OBJ model on the here copied loadModel method. It's a very simple 1k poly model, but I'm getting no animation whatsoever. The whole thing seems fairly straightforward, so what might I be doing wrong?
CONSOLE:
Object 'Hair_jPCT6' created using 395 polygons and 252 vertices
Additional visibility list (2) created with size: 4096
...
Additional visibility list (61) created with size: 4096

LOADING METHOD:
Code: [Select]
      private void loadModel() {
TextureManager.getInstance().addTexture("LindyModelBellybutton.png", new Texture("LindyModelBellybutton.png"));
TextureManager.getInstance().addTexture("Lindy_HighResHair.png", new Texture("Lindy_HighResHair.png"));
lal3d = Object3D.mergeAll(Loader.loadOBJ("Head.obj", "Head.mtl", 1f));
// lal3d.getMesh().compress();
Object3D openMouth = Object3D.mergeAll(Loader.loadOBJ("MouthOpen.obj", null, 1f));
Object3D blinks = Object3D.mergeAll(Loader.loadOBJ("Blink.obj", null, 1f));
lal3d.build();
openMouth.build();
blinks.build();
Animation animation = new Animation(6);
animation.createSubSequence("Talks");
animation.addKeyFrame(lal3d.getMesh().cloneMesh(false));
animation.addKeyFrame(openMouth.getMesh());
animation.addKeyFrame(lal3d.getMesh().cloneMesh(false));
animation.createSubSequence("Blinks");
animation.addKeyFrame(lal3d.getMesh().cloneMesh(false));
animation.addKeyFrame(blinks.getMesh());
animation.addKeyFrame(lal3d.getMesh().cloneMesh(false));
animation.setInterpolationMethod(Animation.LINEAR);
lal3d.setAnimationSequence(animation);
Object3D hair = Object3D.mergeAll(Loader.loadOBJ("Hair.obj", "Hair.mtl", 1f));
hair.build();
lal3d.addChild(hair);
lal3d.rotateAxis(lal3d.getXAxis(), (float)Math.toRadians(160));
world.addObject(lal3d);
world.addObject(hair);
      }

Afterwards, I attempt to play the animation with:
Code: [Select]
     if (keepTalking) {
lal3d.animate((currentFrame+=Time.deltaTime()), TALKS);
if (currentFrame >= 1.00f)
     currentFrame = 0.00f;
     }
     else if (blinking) {
lal3d.animate((currentFrame+=Time.deltaTime()), BLINKS);
if (currentFrame >= 1.00f)
     blinking = false;
     }
     if (!keepTalking && Math.random() > .9 && System.currentTimeMillis() > timeSinceBlinked+4000) {
blinking = true;
currentFrame = 0.00f;
     }

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: AdditionalVisiblityList Problems
« Reply #1 on: June 25, 2011, 11:32:16 pm »
That's usually the symptom of your render loop causing some exception that you just swallow. In that case, each iteration causes a new visibility list being created because the former one has never been rendered. See if you swallow any exception and...don't do that... ;)

Offline AGP

  • quad
  • ******
  • Posts: 1518
    • View Profile
Re: AdditionalVisiblityList Problems
« Reply #2 on: June 25, 2011, 11:35:08 pm »
Not that I can tell. The entire loop consists of the animation bit and the following three lines:
Code: [Select]
     draw();
     paint(this.getGraphics());
     Thread.yield();

By the way, I'm only using the software renderer.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: AdditionalVisiblityList Problems
« Reply #3 on: June 25, 2011, 11:56:41 pm »
If there's no exception, you are omitting the actual draw call. None of these methods in the code snippet is from jPCT, so i've no idea what draw() or paint() are actually doing.

Offline AGP

  • quad
  • ******
  • Posts: 1518
    • View Profile
Re: AdditionalVisiblityList Problems
« Reply #4 on: June 26, 2011, 12:29:05 am »
OK, I solved the matter of the visibility lists by switching back to AWT components (I had a reason for going with Swing, but not anymore). But my animate() call (above) is not producing any animation. Any clue why (the models themselves are right and should work)?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: AdditionalVisiblityList Problems
« Reply #5 on: June 26, 2011, 12:32:15 am »
What's Time.getDeltaTime() returning?