A simple, robust and extendible postprocessing class
Lens flare behind objects
hello,
i added the lens flare in my game project.
it looks great, but i have a problem that the lens flare is everytime in front of objetcs.
in the demo, when a model is in front of the sun, the lens flare is disabled.
in my game not. i have everytime the lensflare.
i use the blureffect to.
do you have an idea why the lens flare is everytime visible and not hidden, when an object is in front of the sun?
thanx
edwart
i added the lens flare in my game project.
it looks great, but i have a problem that the lens flare is everytime in front of objetcs.
in the demo, when a model is in front of the sun, the lens flare is disabled.
in my game not. i have everytime the lensflare.
i use the blureffect to.
do you have an idea why the lens flare is everytime visible and not hidden, when an object is in front of the sun?
thanx
edwart
You could do that, although it's not terribly physically accurate because the flare will completely pop-in and pop-out. The better way to do it would be to render a billboard in the position of the sun with an occlusion query around it, then modulate the intensity of the flare given how many fragments were visible.Dorth wrote:Dunno, but can't you raytrace from camera to "Sun", and disable the effect if the ray collides a non-transparent object in-between?
TheQuestion = 2B || !2B
Edwart; the class uses 2 possible methods to check sun visibility. Set the quality to CRUDE and it will do bounding-box checks in the direction of the sun. NORMAL (default) will check the colour at the sun. If it's above 0.9 (i.e ~240) in brightness, the sun is visible, otherwise not.
Both have limitations, and if you look back in this thread you'll see several discussions about better methods which will be added later.
For best results now (easy method), make sure that your obstructing object is dark and your sun is bright, and use normal quality. Also note that it will cause some slowdown.
As Dorth & Halifax said, you may be better off doing the checks yourself and disabling / enabling the effect manually (and change the colour to change the intensity of the flare). Though this is a bit more difficult.
Both have limitations, and if you look back in this thread you'll see several discussions about better methods which will be added later.
For best results now (easy method), make sure that your obstructing object is dark and your sun is bright, and use normal quality. Also note that it will cause some slowdown.
As Dorth & Halifax said, you may be better off doing the checks yourself and disabling / enabling the effect manually (and change the colour to change the intensity of the flare). Though this is a bit more difficult.
Can't get it to work on 1.7.1.
Changed dimension2di to dimension2du in:
and TextureWrap in some sources:
to:
and I get nothing, only cleared background.
Did anyone test PP on newest version of engine?
Changed dimension2di to dimension2du in:
Code: Select all
IPostProc* ppRenderer = new CRendererPostProc( smgr, dimension2du( 1024, 512 ), true, true, SColor( 255u, 100u, 101u, 140u ) );
// When setting up the effect, the parameters are:
// Input, size of output, effect ID (see CEffectPostProc.h for full list), effect parameters (in this case, blur size)
CEffectPostProc* ppBlur = new CEffectPostProc( ppRenderer, dimension2du( 1024, 512 ), PP_BLUR, 0.01f );
// Change to a better quality - not all shaders will respect these, but they can be used to hint the rendering standard required.
ppBlur->setQuality( PPQ_GOOD );
Code: Select all
mat.TextureLayer[ 1u ].TextureWrap = irr::video::ETC_CLAMP_TO_EDGE;
Code: Select all
mat.TextureLayer[ 1u ].TextureWrapU = irr::video::ETC_CLAMP_TO_EDGE;
mat.TextureLayer[ 1u ].TextureWrapV = irr::video::ETC_CLAMP_TO_EDGE;
Did anyone test PP on newest version of engine?
-
- Posts: 194
- Joined: Thu Mar 18, 2010 3:31 am
- Contact:
I've patched and tested this to run on Irrlicht 1.7.2 SVN.
Download on mediafire: http://www.mediafire.com/?hfnzc289rm49h4v
P.S:
Sorry to bring up an old thread, I just thought others might be interested in using this as well.
Download on mediafire: http://www.mediafire.com/?hfnzc289rm49h4v
P.S:
Sorry to bring up an old thread, I just thought others might be interested in using this as well.
LazerBlade
When your mind is racing, make sure it's not racing in a circle.
3d game engine: http://sites.google.com/site/lazerbladegames/home/ray3d
lazerBlade blog: http://lazerbladegames.blogspot.com/
When your mind is racing, make sure it's not racing in a circle.
3d game engine: http://sites.google.com/site/lazerbladegames/home/ray3d
lazerBlade blog: http://lazerbladegames.blogspot.com/
-
- Competition winner
- Posts: 117
- Joined: Wed Jun 30, 2010 8:44 am
- Location: Portugal
- Contact:
Re:
Url is dead, can someone update the url? Thankyou!lazerblade wrote:I've patched and tested this to run on Irrlicht 1.7.2 SVN.
Download on mediafire: http://www.mediafire.com/?hfnzc289rm49h4v