Author Topic: Octree and camera problems  (Read 8145 times)

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Octree and camera problems
« Reply #15 on: November 01, 2013, 05:16:39 am »
Egon, you are a saint for decoding this. Does it help to know Germain? :- )

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Octree and camera problems
« Reply #16 on: November 01, 2013, 07:30:30 am »
Egon, you are a saint for decoding this. Does it help to know Germain? :- )
No, i don't think so... ;)

Offline xujiang

  • byte
  • *
  • Posts: 16
    • View Profile
Re: Octree and camera problems
« Reply #17 on: November 28, 2013, 06:38:18 pm »
Excuse me, can display text?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net

Offline xujiang

  • byte
  • *
  • Posts: 16
    • View Profile
Re: Octree and camera problems
« Reply #19 on: December 01, 2013, 05:26:59 pm »
Screen flicker ,How to solve? The following code



private Canvas canvas = null;
...

buffer = new FrameBuffer(GanmeConfig.WIDTH, GanmeConfig.HEIGHT, FrameBuffer.SAMPLINGMODE_NORMAL);
buffer.disableRenderer(IRenderer.RENDERER_SOFTWARE);
buffer.enableRenderer(IRenderer.RENDERER_OPENGL, IRenderer.MODE_OPENGL);

canvas = buffer.enableGLCanvasRenderer();
canvas.setBounds(0, 0, GanmeConfig.WIDTH, GanmeConfig.HEIGHT);
frame.add(canvas);

...
while(flag){
....
   buffer.clear();
   sh.updateShadowMap();
   sh.drawScene();
   skybox.render(world, buffer);
   buffer.clearZBufferOnly();
   world.renderScene(buffer);
   world.draw(buffer);
   buffer.update();
   buffer.displayGLOnly();
   //////////////////
   canvas.repaint(); 
   Thread.sleep(14);
   }
   buffer.dispose();
   frame.dispose();

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Octree and camera problems
« Reply #20 on: December 01, 2013, 07:20:40 pm »
You have two renderers active with this setup. They to leave out the enableRenderer for the GLRenderer to see if that helps.
Apart from that, i don't get your render loop...why are you using drawScene in the ShadowHelper and in addition, you are also rendering the world itself? That doesn't make any sense exception if the ShadowHelper uses a different world. If not, this is just wrong...

Offline xujiang

  • byte
  • *
  • Posts: 16
    • View Profile
Re: Octree and camera problems
« Reply #21 on: December 02, 2013, 10:15:16 am »
 To solve the canvas flicker?  Canvas double buffer?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Octree and camera problems
« Reply #22 on: December 02, 2013, 03:55:58 pm »
I don't think so. Just have a look at the AWTGL example what comes with the distribution. Apart from that, you seem to ignore my former post, which contains some ideas on how to fix this.

Offline xujiang

  • byte
  • *
  • Posts: 16
    • View Profile
Re: Octree and camera problems
« Reply #23 on: December 02, 2013, 04:20:42 pm »
Please provide reference URL

Offline xujiang

  • byte
  • *
  • Posts: 16
    • View Profile
Re: Octree and camera problems
« Reply #24 on: December 02, 2013, 04:28:21 pm »
I want to use the OpenGL window, but many controls need to write their own. For example, I need a text input China text whether to support the input method?

Offline xujiang

  • byte
  • *
  • Posts: 16
    • View Profile
Re: Octree and camera problems
« Reply #25 on: December 02, 2013, 04:33:09 pm »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Octree and camera problems
« Reply #26 on: December 02, 2013, 05:33:20 pm »
Please provide reference URL
Reference to what? The example that i mentioned can be found in the jpct.zip.

Offline xujiang

  • byte
  • *
  • Posts: 16
    • View Profile
Re: Octree and camera problems
« Reply #27 on: December 02, 2013, 05:51:46 pm »
To solve the canvas flashing Liezi

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Octree and camera problems
« Reply #28 on: December 03, 2013, 07:41:53 am »
As said: There's an example in the distribution that doesn't flicker. You can build upon that and see what's wrong with your code. And i mentioned that your render loop is most likely wrong. I don't see how i'm supposed to provide a kind of "reference url" to anything... ???