Jump to content

  • Log In with Google      Sign In   
  • Create Account

Draw Textures as Lightflares


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 StanIAm   Members   -  Reputation: 208

Like
0Likes
Like

Posted 09 August 2014 - 05:07 PM

Hey guys Iam just wondering how to draw lightflare textures in a shader to the brightest specularreflection points. I think they are called anamorhic lightflares, something like that : http://img718.imageshack.us/img718/4577/screenshot0816.jpg

 

Iam not sure if it is done by just doing it like a bloom shader and just increase the number of samples in the horizontal way....I also saw people doing it with lightflare textures, positioning it to the brightest points of the image but how to do that within a shader ??

Thank you



Sponsor:

#2 MJP   Moderators   -  Reputation: 11347

Like
7Likes
Like

Posted 09 August 2014 - 07:05 PM

Most games will only draw lens flare sprites at hand-selected locations in their level (usually light sources). Some games will use a screen-space approach similar to bloom, where bright spots have a filter kernel applied to them and the result is composited over the screen (this is mostly likely what's being done in the screenshot that you posted). This is nice because it affects everything on the screen, but it can be difficult to achieve interesting shapes since you have to achieve them using filtering kernels. It also doesn't let you generate flares for off-screen features. In The Order we use a screen space approach, however we use FFT's to apply the filtering in the frequency domain. This lets you use arbitrary kernels from a texture, which is cool. However the FFT is expensive, so you pretty much have to do it at a low resolution. 

With D3D11-level hardware you could certainly try an approach where you analyze the screen, and spawn sprites at bright locations. Append buffers are useful for this, since you can analyze each pixel and throw the bright ones into your append buffer. Then you can use DrawIndirect to render all of the sprites in the buffer. I played around with this a long time ago and it's definitely workable, but at the time I had some trouble making it temporally stable while also keeping the amount of overdraw to a minimum.



#3 tonemgub   Members   -  Reputation: 1126

Like
-1Likes
Like

Posted 11 August 2014 - 02:38 AM

IMHO, that's a horrible effect...



#4 Kryzon   Prime Members   -  Reputation: 3039

Like
0Likes
Like

Posted 11 August 2014 - 03:31 AM

Masaki Kawase has done some work on that:
http://www.daionet.gr.jp/~masa/rthdribl/index.html
http://www.daionet.gr.jp/~masa/archives/GDC2003_DSTEAL.ppt

#5 Hodgman   Moderators   -  Reputation: 30384

Like
0Likes
Like

Posted 11 August 2014 - 03:28 PM

With D3D11-level hardware you could certainly try an approach where you analyze the screen, and spawn sprites at bright locations. Append buffers are useful for this, since you can analyze each pixel and throw the bright ones into your append buffer. Then you can use DrawIndirect to render all of the sprites in the buffer. I played around with this a long time ago and it's definitely workable, but at the time I had some trouble making it temporally stable while also keeping the amount of overdraw to a minimum.

I did a D3D9c/GL2-level version of this, but it's limited to one flare per 16x16 tile of the image :D
http://www.gamedev.net/topic/576380-real-time-lens-blur/




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS