Octree and camera problems

Started by xujiang, October 25, 2013, 06:26:19 PM

Previous topic - Next topic

AGP

Egon, you are a saint for decoding this. Does it help to know Germain? :- )

EgonOlsen

Quote from: AGP on November 01, 2013, 05:16:39 AM
Egon, you are a saint for decoding this. Does it help to know Germain? :- )
No, i don't think so... ;)

xujiang



xujiang

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

EgonOlsen

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...

xujiang

 To solve the canvas flicker?  Canvas double buffer?

EgonOlsen

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.

xujiang


xujiang

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?


EgonOlsen

Quote from: xujiang on December 02, 2013, 04:20:42 PM
Please provide reference URL
Reference to what? The example that i mentioned can be found in the jpct.zip.

xujiang

To solve the canvas flashing Liezi

EgonOlsen

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... ???