www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: ggp on February 26, 2014, 12:44:28 pm

Title: LensFlare hidding behind object
Post by: ggp 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);
Title: Re: LensFlare hidding behind object
Post by: EgonOlsen 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.
Title: Re: LensFlare hidding behind object
Post by: ggp 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?
Title: Re: LensFlare hidding behind object
Post by: EgonOlsen on February 26, 2014, 04:02:59 pm
....soooo there is no working version of this?
Title: Re: LensFlare hidding behind object
Post by: ggp on February 26, 2014, 04:19:28 pm
Android 2.2

jpct-ae 1.24

Title: Re: LensFlare hidding behind object
Post by: EgonOlsen 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?!?
Title: Re: LensFlare hidding behind object
Post by: ggp 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
Title: Re: LensFlare hidding behind object
Post by: ggp 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();
Title: Re: LensFlare hidding behind object
Post by: EgonOlsen 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... :)
Title: Re: LensFlare hidding behind object
Post by: ggp 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();

Title: Re: LensFlare hidding behind object
Post by: EgonOlsen on February 26, 2014, 10:52:12 pm
...and the question is?
Title: Re: LensFlare hidding behind object
Post by: ggp on February 26, 2014, 10:58:00 pm
put fixed background is the question

simple image backdrop screen
Title: Re: LensFlare hidding behind object
Post by: EgonOlsen 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.
Title: Re: LensFlare hidding behind object
Post by: ggp on February 27, 2014, 05:45:07 pm
in motorola moto g work fine

in htc wildfire s crash app

why?
Title: Re: LensFlare hidding behind object
Post by: EgonOlsen 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.
Title: Re: LensFlare hidding behind object
Post by: ggp on February 28, 2014, 01:01:01 pm
No errors in emulator log output   ???
in emulator work fine

curious

comment this line and works fine in htc wildfire s 

Code: [Select]
//fb.blit(cieloazul, 0, 0, 0, 0, 256, 256, fb.getWidth(), fb.getHeight(), 1000, false, null);
I have decided to remove this line.
--

is not possible to make a gradient code?

similar to css
background: -webkit-linear-gradient(#8BC0EE, #33BCEE);



Title: Re: LensFlare hidding behind object
Post by: EgonOlsen on February 28, 2014, 05:58:19 pm
No, it's not. But that's not the point. I can't help, if you provide no information on WHAT doesn't work. If it crashes, there has to be some output about it. Most likely it's a memory issue. That particular device is old and really really low end. It might not be able to handle what you throw at it. What's the size of the texture that you are using for this?