Author Topic: LensFlare Hiding Android  (Read 3613 times)

Offline MikeFR

  • byte
  • *
  • Posts: 5
    • View Profile
LensFlare Hiding Android
« on: October 09, 2011, 08:06:00 pm »
Hello there :)

Firstly, Congratulations for your framework :) it's very amazing ! :)

Meanwhile (:p) I have a problem to deal with the "auto-hide" feature of lensFlare.

I'm using a terrain (with COLLISION_CHECK_OTHERS) which is configured with an octree (with COLLISION_DETECTION_OPTIMIZED) for optimize collision with my character ...

i have also configured camera to check collisions with the terrain ...

Collisions works fine between the character (the camera too) and the terrain but when the terrain is between the camera and the lens flare, the flare is still shown ...

i have read different posts and docs ... but i can't resolve my problem :(

Any idea or working example ?

Thanks in advance :)
« Last Edit: October 09, 2011, 08:07:44 pm by MikeFR »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: LensFlare Hiding Android
« Reply #1 on: October 09, 2011, 08:11:47 pm »
What's your setup code for the lens flare. I assume that you've enabled hiding by using setHiding(true)?

Offline MikeFR

  • byte
  • *
  • Posts: 5
    • View Profile
Re: LensFlare Hiding Android
« Reply #2 on: October 09, 2011, 08:16:18 pm »
yes :


Code: [Select]
LensF=new LensFlare(sun.getPosition(), "burst", "halo1", "halo2", "halo3");
LensF.setHiding(true);
LensF.setMaximumDistance(-1f); // i have also tried that in case of distance pb ...
LensF.setTransparency(2);
LensF.setGlobalScale(1.0f);



« Last Edit: October 09, 2011, 08:23:00 pm by MikeFR »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: LensFlare Hiding Android
« Reply #3 on: October 09, 2011, 09:18:57 pm »
How far away is the light source that causes the lens flare? Could you please try if it helps if you move it closer to the camera?

Offline MikeFR

  • byte
  • *
  • Posts: 5
    • View Profile
Re: LensFlare Hiding Android
« Reply #4 on: October 09, 2011, 10:32:48 pm »
i've tried with the light source (the "sun" in my code) at 10 world units distance and it's doing the same issue ...

I'm certainly doing something wrong grrr .. but i have checked each thing i've read in topics and docs ... i don't see :(

I will try with a simpler object than the terrain (without octree) and will care about the collision mode of it ..

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: LensFlare Hiding Android
« Reply #5 on: October 09, 2011, 10:35:48 pm »
I'm not sure if it's you who's doing something wrong...it could as well be a bug in either the engine or the LensFlare class. It's just that i can't reproduce this problem. Maybe you have a little test case for this?

Offline MikeFR

  • byte
  • *
  • Posts: 5
    • View Profile
Re: LensFlare Hiding Android
« Reply #6 on: October 09, 2011, 10:57:04 pm »
I've tried with a simple 3DS mesh (the rock.3ds you used in samples) and it's the samething ...

Wow a test case .... My project is a little dirty with a lot of dependancies on SDCard (manually arranged by hand for the moment)

But do you have an eclipse project which works perfectly for you or some snippets code which works with flares hiding ?

meanwhile I will try to recreate a little test case to see ...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: LensFlare Hiding Android
« Reply #7 on: October 09, 2011, 11:30:55 pm »
Don't bother with the test case. I've found the problem and hopefully fixed it in this jar: http://jpct.de/download/beta/jpct-ae.jar

Offline MikeFR

  • byte
  • *
  • Posts: 5
    • View Profile
Re: LensFlare Hiding Android
« Reply #8 on: October 09, 2011, 11:42:29 pm »
Magic ! It's working !!! :)

Thank you so much ! :)