jPCT - a 3d engine for Java > Support

How to create an Applet

<< < (2/3) > >>

sushobhit:
kewl

atreyu64:
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 !

EgonOlsen:
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?

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

Thanks !

atreyu64:
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(GLContext.java:124)
   at org.lwjgl.opengl.GL11.glBindTexture(GL11.java:651)
   at com.threed.jpct.procs.BloomGLProcessor.snapshot(BloomGLProcessor.java:362)
--- 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
      world.renderScene(fb);
      if(enableSkyBox)
         skybox.render(world, fb);
      pictoWorld.renderScene(fb);
     
      // draw first world :
      world.draw(fb);
     
      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.
         fb.clearColorBufferOnly(Color.BLACK);
         bloomWorld.renderScene(fb);
         bloomWorld.draw(fb);
         fb.runPostProcessors();

         // Now combine the snapshot with the blurred image.
         bloomProcessor.render();
      }
     
      // then draw picto world :
      pictoWorld.draw(fb);
     
      fb.update();
     
      blitting();
     
      fb.displayGLOnly();
--- End code ---


What am I doing wrong ?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version