Author Topic: Lensflare help  (Read 3556 times)

Offline dectar

  • byte
  • *
  • Posts: 21
    • View Profile
Lensflare help
« on: November 19, 2011, 09:50:03 pm »
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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Lensflare help
« Reply #1 on: November 20, 2011, 11:27:27 pm »
In that order, your world might be painted over the lens flare...try to change the order to see if that helps.

Offline dectar

  • byte
  • *
  • Posts: 21
    • View Profile
Re: Lensflare help
« Reply #2 on: November 21, 2011, 03:31:00 pm »
I will try that tonight after work.. thanks :)

Offline dectar

  • byte
  • *
  • Posts: 21
    • View Profile
Re: Lensflare help
« Reply #3 on: November 21, 2011, 11:05:59 pm »
yep, that worked perfectly. thanks Egon.
The images you used for the flare in the benchmark app - have you made these available anywhere?

Offline dectar

  • byte
  • *
  • Posts: 21
    • View Profile
Re: Lensflare help
« Reply #4 on: November 22, 2011, 12:20:00 pm »
I managed to create my own lensflare images that are relatively believable so I should be ok with these. Thanks again

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Lensflare help
« Reply #5 on: November 22, 2011, 01:00:06 pm »
The ones that i have used are these: http://www.jpct.de/download/net/misc/lens.zip