Jump to content

Lens Flare Shader for Leandwerks


ParaToxic
 Share

Recommended Posts

Hei today I had some time to implement a lens flare effect to the engine.

Now it supports Halos, ghost features, chromatic disperation and a lensdirt texture.

I uploaded a video, but I have to say, that the contrast is very low and you can't really see the effect ( let's say not so good ).

 

I have a problem to implement it in the framework, because it needs multiple passes :

-Downsample + Threshold ( the threshold has to be adjusted for the sky brightness )

-Add the Lens flare features

-Blur the Image

-Multiply the resulted image with a lensdirt texture like in BF3 used and blend this with the original rendered image---> Finished

 

I know you can pack some steps together , like the 2nd, 3rd step, but then I need to make 3 passes.

Maybe somebody can tell me how to add that to the framework...

 

Here is the video:

http://www.youtube.com/watch?v=pQb_EAnsp3w

 

I hope you like it

  • Upvote 3
Link to comment
Share on other sites

You might dont have a idea how awfull that sounds - at first glance it makes me think that you copy some shader code from a random game and are trying to add it to your game ... the way they implemented it in there game ... thats quit confusing, not very much legal and aint getting you there.

 

I most likely would use something like the day/night script shader, load the lense textures + a sun flare, draw the sun flare at the sunPos, get a vector from the screen center to the sunflare and draw the lenses depending on that - then fade the lense texture alpha to full alpha ,if looking at the sunflare ... i dont see a reason to filter these flares however, since the god rays will eat them away and the textures used should be good enough in the first place.

AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3

zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5

 

adv_banner-april2012_720x150_tex01.png

 

Xxploration FPS in progress ...

Link to comment
Share on other sites

Actually, I really like that ParaToxic, it looks very subtle! Can't help you really with the integration into the framework other than using framewerk (where you have the code at your disposal and access to all the buffers). The problem with framewerk is it's not been kept up to data so lacks some of the current features.

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

First that isn't stolen. There is a realy cool guy, I contact him throug e-mail and asked how he has made this lens flare effect in his video.Then he showed me his idea and I made it similar like he.

 

You can't see it on the video very good because of the contrast and the unoptimized values inside the shaders.But now I'm trying to do it better and the result is better than the video.

Link to comment
Share on other sites

Abnormal exit.

Error: Failed to compile fragment shader object.
0(29) : error C7532: global function texture requires "#version 130" or later

Source:
#version 120
#define LW_MAX_PASS_SIZE 64
#define LW_INSTANCED
#define LW_SM4
varying vec4 fragcolor;
varying vec4 fragcoord;
uniform sampler2D texture0; //color

uniform float apptime;
uniform vec2 buffersize;

AMD3600+/2GB DDR3 SDRAM / GeForce 8600 GTS

I3 530/2GB DDR3/GF GT240 DDR5

Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...