jPCT - a 3d engine for Java > Support

How to create an Applet

<< < (2/3) > >>


Hi, I have a problem with my applet.

It works quite good but the lightning is different than the java version of my app : ambient light is at maximum (it should'nt) and I can't see specular lighting anymore.
Also, Bloom processor crashes, I get this message while trying to initialize it :
--- Quote ---"Warning: unable to initialize post processing textures due to: no opengl context found in the current thread"
--- End quote ---

I have disabled software renderer just after enabling canvas OpenGL renderer, so it should work exactly the same as the java version, right ?

Any idea of what's happening ?

Thanks in advance, cheers !

The bloom issue might be a threading problem. Try to implement an IPaintListener in do the initialization in one of it's methods instead. About the lighting...I'm not sure. Are you using the AWTGLRenderer in your application as well?

No in my app I use the GLRenderer.
I will try to init the Bloom process differently.

Thanks !

I tried to init bloom processor through an IPaintListener and I don't get the warning message anymore.

However, I now get an error during the rendering of the bloom :

--- Code: ---Exception in thread "AWT-EventQueue-1" java.lang.RuntimeException: No OpenGL context found in the current thread.
   at org.lwjgl.opengl.GLContext.getCapabilities(
   at org.lwjgl.opengl.GL11.glBindTexture(
   at com.threed.jpct.procs.BloomGLProcessor.snapshot(
--- End code ---

Here is basically what I do in my loop (remember the bloomProc.setDelayed(true) method you kindly introduced for me ?) :

--- Code: ---      // First render the actual world to fill the zbuffer and let the
      // processor take a snapshot of the result
         skybox.render(world, fb);
      // draw first world :
      if(displayNeons && nbNeons > 0) {
         bloomProcessor.snapshot(); ///////////////////////////// bug here

         // Then render the line world and apply the blur...but only to the
         // back buffer of the processor because it's delayed.
         // Make sure to clear the color but not the depth buffer.

         // Now combine the snapshot with the blurred image.
      // then draw picto world :
--- End code ---

What am I doing wrong ?


[0] Message Index

[#] Next page

[*] Previous page

Go to full version