Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - atreyu64

#1
The new beta jar did not change anything, that said I have found the solution.
Actually I use a skybox, and I was calling the skybox.render() method after world.renderScene().
After switching this call order, everything works fine.

Thanks again and sorry for bothering you, cheers !
#2
Ok I'll give it a try tonight, thanks a lot Helge.

So what you're saying is that I should move the renderScene calls out of the "if" block ? Like this :


if(displayNeedsUpdate) {
cameraChanged();
displayNeedsUpdate = false;
}

world.renderScene(fb);
world2.renderScene(fb);

world.draw(fb);
world2.draw(fb);

blitting();

fb.display();
#3
Well actually it's like if glIgnoreNearPlane was not taken into account, but sometimes the display is ok, only when I don't call the renderScene method, which happens here  when "displayNeedsUpdate" is set to false :


if(displayNeedsUpdate) {
cameraChanged();
displayNeedsUpdate = false;

world.renderScene(fb);
world2.renderScene(fb);
}

world.draw(fb);
world2.draw(fb);

blitting();

fb.display();


I'm doing this to avoid rendering again the scene when nothing has changed in the scene.
If I try to call renderScene evry time, it is like glIgnoreNearPlane was ignored.
#4
Sorry to bother you again, but it seems like setting Config.glIgnoreNearPlane to false does not work properly on Android.

Have you ever noticed anything wrong with it ?
#5
Ok thanks a lot !
I don't use any shadows so it should be ok.

Cheers,

Sylvain
#6
Hi, have you upload the fixed jpct-ae jar yet ?
#7
Yes I would need it, but no worries, I'm not in a hurry.
#8
Everything works perfectly now. Thanks a lot !
Do you plan to report the corrections on jpct-AE ?

Cheers, thanks again for your precious time.
#9
The reprojection function now works great, thanks a lot !

But I still have a problem : the method Interact2D.project3D2D returns wrong values.
#10
Hi boys and boys,

I've noticed a strange behaviour when I modify the near plane value.
In my apps I have two types of camera controls (and I can switch from one to another at any time) : orbit camera and "walk camera" meaning that the camera is very close to the ground, which of course leads to some "frustum" effects.
Here is basically what I do to avoid this problem when I change the camera control type :

if(walkMode) {
Config.nearPlane = 0.25f;
Config.farPlane = 10000000000f; // yes I want to see everything...
}
else { // orbit camera settings :
Config.nearPlane = 1f;
Config.farPlane = 1000f;
}
cam.setFOVtoDefault();
cam.adjustFovToNearPlane();


I thought that adjustFovToNearPlane function would be enough but I also had to call setFOVtoDefault to avoid zoom-in/zoom-out effets, but this is not a problem, it solves my frustum problem very well.

The problem is that when the near plane value is different than the default value, the calcMinDistanceAndObject3D method returns wrong results.
Indeed, when I call the following method, I get wrong results :

// cursor projection on terrain :
protected SimpleVector getCursorProjection(int x, int y) {
SimpleVector cursorProjection = null;
SimpleVector dir = Interact2D.reproject2D3DWS(cam, fb, x, y).normalize();
Object[] res = world.calcMinDistanceAndObject3D(cam.getPosition(), dir, 1000000);
Object3D pickedObject = (Object3D) res[1];
if(pickedObject == terrain) {
float distance = (Float) res[0];
cursorProjection = dir;
cursorProjection.scalarMul(distance);
cursorProjection.add(cam.getPosition());
}

return cursorProjection;
}


The method still returns something, but it's like if the coordinate system of the frame buffer was different. Maybe the near plane value is not taken into account in the reproject2D3DWS method. Or maybe I'm doing something wrong ?...

Thanks in advance for your answers, cheers,


Sylvain
#11
Support / Re: How to create an Applet
August 11, 2015, 03:33:09 PM
Ok, I see...
Well I will disable the bloom effect in my applet for now, not a big deal.

What about the specular light not showing ? Any idea ?

Thanks, cheers !
#12
Support / Re: How to create an Applet
August 05, 2015, 11:51:08 PM
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 :
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)


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

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



What am I doing wrong ?
#13
Support / Re: How to create an Applet
August 05, 2015, 03:40:43 PM
No in my app I use the GLRenderer.
I will try to init the Bloom process differently.

Thanks !
#14
Support / Re: How to create an Applet
August 05, 2015, 11:58:52 AM
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"

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 !
#15
Thanks a lot !

We have sold 145 apps for now, had 3 articles in local papers and will soon be on local TV news.
Also, we have had a few propositions to develop other apps based on the same concept.

:)