LensFlare Hiding Android

Started by MikeFR, October 09, 2011, 08:06:00 PM

Previous topic - Next topic

MikeFR

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 :)

EgonOlsen

What's your setup code for the lens flare. I assume that you've enabled hiding by using setHiding(true)?

MikeFR

#2
yes :


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





EgonOlsen

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?

MikeFR

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

EgonOlsen

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?

MikeFR

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

EgonOlsen

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

MikeFR

Magic ! It's working !!! :)

Thank you so much ! :)