Author Topic: LensFlare hidding behind object  (Read 2344 times)

Offline ggp

  • byte
  • *
  • Posts: 39
    • View Profile
LensFlare hidding behind object
« on: February 26, 2014, 12:44:28 pm »
The LensFlare hidding behind object
worked before, not now
why?

used jpct-ae 1.28

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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: LensFlare hidding behind object
« Reply #1 on: February 26, 2014, 03:32:19 pm »
The code for the lens flares hasn't changed in ages. Maybe some fix to the ray casting methods causes this in your case. It would help to know, what 'before' actually means in this context (which version...).
Also make sure that all objects that are supposed to hide the lenses are defined as colliders.

Offline ggp

  • byte
  • *
  • Posts: 39
    • View Profile
Re: LensFlare hidding behind object
« Reply #2 on: February 26, 2014, 03:55:55 pm »
jpct-ae 1.24 no work
jpct-ae 1.28 no work

without collision  and with collision

i don't know ???

this is my config
Code: [Select]
public MyRenderer() {
Config.maxPolysVisible = 500;
         Config.farPlane = 1500;
         Config.glTransparencyMul = 0.1f;
         Config.glTransparencyOffset = 0.1f;
         Config.useVBO=true;
         
         Texture.defaultToMipmapping(false);
         Texture.defaultTo4bpp(true);
}

There is some code example that works?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: LensFlare hidding behind object
« Reply #3 on: February 26, 2014, 04:02:59 pm »
....soooo there is no working version of this?

Offline ggp

  • byte
  • *
  • Posts: 39
    • View Profile
Re: LensFlare hidding behind object
« Reply #4 on: February 26, 2014, 04:19:28 pm »
Android 2.2

jpct-ae 1.24


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: LensFlare hidding behind object
« Reply #5 on: February 26, 2014, 04:21:17 pm »
I don't get it...in the post above, you state that 1.24 doesn't work either but in the last post, you state that it does?!?

Offline ggp

  • byte
  • *
  • Posts: 39
    • View Profile
Re: LensFlare hidding behind object
« Reply #6 on: February 26, 2014, 04:32:59 pm »
a long time ago work in 1.24,
 
but now no work in jpct-ae 1.24


Code: [Select]
                                        fb.clear(back);

LensF.render(fb);
LensF.update(fb, world);

world.renderScene(fb);
world.draw(fb);

fb.display();


sorry, my English is not very good

Offline ggp

  • byte
  • *
  • Posts: 39
    • View Profile
Re: LensFlare hidding behind object
« Reply #7 on: February 26, 2014, 04:53:29 pm »
SOLVED!! :D
i dont undestand,
before work the other way

Here was the error

Code: [Select]
                                        world.renderScene(fb);
world.draw(fb);
LensF.render(fb);
LensF.update(fb, world);
fb.display();

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: LensFlare hidding behind object
« Reply #8 on: February 26, 2014, 09:01:09 pm »
The lens flare relies on blitting images onto the screen. If you place it before the actual scene rendering, it will be overriden by the scene itself. I don't see, how this could have worked in the past. Anyway, if it's solved now, all is fine... :)

Offline ggp

  • byte
  • *
  • Posts: 39
    • View Profile
Re: LensFlare hidding behind object
« Reply #9 on: February 26, 2014, 09:50:47 pm »
Maybe i forget change comments lines of LensFlares

i think other question

fixed background

for day sun, blue sky(texture gradient)
Code: [Select]
                                       world.renderScene(fb);
                                       fb.blit(this.background, 0, 0, 0, 0, 512, 256, width, height, -1, false);
world.draw(fb);
LensF.render(fb);
LensF.update(fb, world);
fb.display();


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: LensFlare hidding behind object
« Reply #10 on: February 26, 2014, 10:52:12 pm »
...and the question is?

Offline ggp

  • byte
  • *
  • Posts: 39
    • View Profile
Re: LensFlare hidding behind object
« Reply #11 on: February 26, 2014, 10:58:00 pm »
put fixed background is the question

simple image backdrop screen

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: LensFlare hidding behind object
« Reply #12 on: February 26, 2014, 11:05:37 pm »
Just like what you already did. I would move the blit before the renderScene, but that shouldn't matter.

Offline ggp

  • byte
  • *
  • Posts: 39
    • View Profile
Re: LensFlare hidding behind object
« Reply #13 on: February 27, 2014, 05:45:07 pm »
in motorola moto g work fine

in htc wildfire s crash app

why?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: LensFlare hidding behind object
« Reply #14 on: February 27, 2014, 06:04:20 pm »
What does 'crash app' mean? Nobody can find a problem with such a vague description. Do you have an exception and/or some log output? I don't any reason why a simple blit should crash an app.