Lensflare help

Started by dectar, November 19, 2011, 09:50:03 PM

Previous topic - Next topic

dectar

Hi,
Im having trouble getting a simple lensflare to work and Im hoping somebody can help me since I must be missing something simple...

I initialize my flare when im setting up my world (adding objects, lightsources etc). I use the following line

flare = new LensFlare(sun.getPosition(), "test", "test", "test", "test");

Then in my method to render my scene, I am calling two different things on the lensflare

private void renderScene() {

      frameBuffer.clear();
      world.renderScene(frameBuffer);
      flare.update(frameBuffer, world);
      flare.render(frameBuffer);
      world.draw(frameBuffer);

      renderBlits();
      frameBuffer.display();
}

I have added a texture called test to the texturemanager so I can just test this lensflare before i go worrying about using nice images.

I am however seeing nothing! The camera is always moving so thats why im calling update on the flare. The camera itself is always approximately 40 units away from the flare position and Im calling no other methods on the flare - just what you see above.

Any ideas?

Thanks.

EgonOlsen

In that order, your world might be painted over the lens flare...try to change the order to see if that helps.

dectar

I will try that tonight after work.. thanks :)

dectar

yep, that worked perfectly. thanks Egon.
The images you used for the flare in the benchmark app - have you made these available anywhere?

dectar

I managed to create my own lensflare images that are relatively believable so I should be ok with these. Thanks again

EgonOlsen