• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
spek

Light halos, lens flares, volumetric stuff

14 posts in this topic

Any advice on anno-2013 light/lens flares?

 

I'm trying to beautify the scene a bit with volumetric lighting. There are many different ways to do, and one I'm planning to implement is to make 3D textures that contain (pre baked) radiance per cell, and local fog densities. Pretty much how the "Humus" demo on volumetric fog worked.

 

However, that is way too rough for fine halo's around lamps, and neither does it produce lens flares or other post effects. So far I've always been using simple 2D sprites that either rotate with the camera or keep on place. Effective, but when looking from nearby, you can often detect the flat quad shape somehow.

 

I guess modern engines still use all kinds of (cheap) tricks combined to get a result, but maybe I missed some cool techniques from the last X years?

 

Rick

0

Share this post


Link to post
Share on other sites

I like the crosses glares in "HDRLightning" demo from dx sdk, but never get time to study it and try to reproduce it myself.

0

Share this post


Link to post
Share on other sites
I haven't studied that demo either, but from what I remember, it's just a screen-space effect.
0

Share this post


Link to post
Share on other sites

STALKER Clear Sky had pretty nice volumetric fog (smoke actually) that collided with other objects. Though I dunno if GSC ever published how they did it.

Edited by TheChubu
0

Share this post


Link to post
Share on other sites

Lens flares and lenticular halos don't really have to do anything with volumetric lighting, that's phenomena that results from light refracting and reflecting inside of a lens enclosure. Producing a physically-plausible result in a game would require some attempt at simulating the path of light through the various lenses, for instance by using the ray-tracing approach taken by this paper. Just about all games crudely simulate these effects using screen-space blur kernels combined with sprites controlled by occlusion queries.
 

Volumetrics is mostly concerned with the scattering and absorption of light as it travels through participating media. Most games don't come anywhere close to simulating this, since it's complex and expensive. I don't think you will get very far with pre-computing anything, since you typically want to simulate the fog so that it moves about the level. You also usually want to attenuate the density with noise, to produce more realistic-looking cloud shapes.

2

Share this post


Link to post
Share on other sites

Thanks for that movie/paper, really useful!

 

The "flare" sprites indeed aren't volumetric in terms of what causes them. But so far my simple sprites (not post image FX as explained in the link) show their sprite behavior by intersecting the geometry when rotating with the camera. Anyway, volumetric lighting, flares and halo's have to complement each other some way. But as you explain, it seems all three are still different (fakish) systems.

 

Not sure if it's much different than what the link explains, but I came accross UDK 4 lens/flares & blooming which looks pretty cool as well:

http://www.unrealengine.com/files/misc/The_Technology_Behind_the_Elemental_Demo_16x9_(2).pdf

Though I'm not sure how they implement that "dirt" map. Just adding some "random" sprites may look nice once, but gets tiring quickly if not applied smartly.

 

 

As for (low frequency) realtime lighting, I liked the possibilities Crytek's LPV technique introduced. While filling 3D textures, you can measure the radiance at any given point. At least nearby the camera. Now I already have a different realtime GI technique so adding LPV would kill the performance, but baking radiance into a low resolution grid could help lighting local dust, fog or smoke sprites. Far from accurate, but better than having nothing or needing heavier per-light computations while 90% of the lamps never change or move in ,my scenes.

 

Greets

0

Share this post


Link to post
Share on other sites

Yeah, this topic seemed kinda dissonant when I first read it. I think the original poster is looking for some sort of per-pixel lense flares. I'm not exactly sure about how a volumetric effect fits into such a topic. Despite how I believe the original poster seems confused, maybe they're on to something, like beginners' luck ? ... happy.png

 

Edit:

Well, participating media can strongly influence how lense flares look...

Edited by Reflexus
0

Share this post


Link to post
Share on other sites

Well, I'm not confused, though lens flares and volumetric lighting are two different things indeed (so the title is misleading). But with a halo around a lamp, I refer to particles in the air making the light visible. Smoke, fog, dust, rain, et cetera. That actually is a volumetric effect (but maybe halo is the wrong word), although many games still fake this complex effect by simply putting a sprite around the lightsource. This is where several techniques overlap a bit. Sprites, HDR bloom, volumetric lighting, particles, and eventually lens flare to improve the effect some more.

 

@LancerSolurus

Thanks for the link. Never really looked at the smoke and rain demo's yet. The "volumetric light" demo on that same page is what I currently have implemented for some lights, but it's quite an expensive effect so it can't be used on large scales (at least in my case the performance would get a big hit).

 

Greets

0

Share this post


Link to post
Share on other sites

Yeah, I realized what you meant and applied an edit to my post:

"Well, participating media can strongly influence how lense flares look..."

smile.png

 

Green Beets

Edited by Reflexus
0

Share this post


Link to post
Share on other sites
Lens flare sprites should never intersect with the world, as they're simulating something "inside the camera". Simply turn off depth testing for these.
"Glow sprites" that represent the halo that occurs in our eyes are the same deal -- no depth testing. However, both these effects do need some form of occlusion testing so they fade/disappear as the light is hidden by closer geometry. I like to do this by sampling the depth buffer at the light's position.

In my last game we used old-school sprite based lens flares and image based lens flares, with both effects modulated by an artist-drawn 'dirty lens' mask texture. To determine the sun's occlusion (for fading out the sprite-based lens flare), I did a Boolean depth comparison on a 16x16 area of the depth buffer where the sun should be, and then downsampled these results to a single 8-bit visibility fraction.

For "glow sprites" that represent fog around the light, you need to use "soft depth testing" ("soft particles", "soft billboards", etc might turn up some material). Instead of clipping against the world at intersections, these will then fade out as they approach an intersection, which almost completely hides the fact that they're a sprite (the remaining problem is when the camera enters the "volume").
1

Share this post


Link to post
Share on other sites

Sprites could work for fog if you're targeting low power systems. If you're targeting high power systems (the new consoles/high end PCs) you'll want atmospheric scattering EG: http://www.cs.berkeley.edu/~ravir/papers/singlescat/scattering.pdf and for godrays something like: http://download-software.intel.com/sites/default/files/LightScatteringGDC2013_final.pdf

Edited by Frenetic Pony
0

Share this post


Link to post
Share on other sites

Using a mini depth buffer to approximate visibility sounds smart, got to keep that in mind instead of doing traditional culling.

 

Hmmm, I tried soft particles before, but usually in narrow crowded spots they wouldn't be visible much, because they would always (almost) collide and therefore fade out. Well, that could be a matter of tweaking.

 

The biggest problem I had with glow-sprites, soft or not, were rectangular shaped lights such as fluorescent "tubes". The sprite can't rotate with the camera in this case, unless it scales itself depending on the view vector or something. Keep it a fixed rotation did the job for most angles, but as soon as you stand in a 90 degree angle, you still notice the flatness, if you can see the sprite at all.

 

That's why I was thinking about defining a 3D shape (such a sphere or cube) around lamps and then render a view dependant sprite in it. But I didn't implement anything yet, neither do I have a battle plan. But maybe someone else has experience?

 

 

@Frenetic Pony

That's a lot of formula's, usually my brains crash then :) But I'll give it a try and read, I always thought that Atmospheric Scattering, at least in games, was more for bigger scaled (outdoor) fog and skies, rather than doing glow sprites which are a very local effect? Either how, it needs to be a relative cheap effect as in my case I have many lights that can appear everywhere.

 

Anyway, thanks for the links!

 

 

Btw, maybe useful for others, I found this about implementing lens-flares

http://john-chapman-graphics.blogspot.nl/2013/02/pseudo-lens-flare.html

1

Share this post


Link to post
Share on other sites

@Frenetic Pony

That's a lot of formula's, usually my brains crash then smile.png But I'll give it a try and read, I always thought that Atmospheric Scattering, at least in games, was more for bigger scaled (outdoor) fog and skies, rather than doing glow sprites which are a very local effect? Either how, it needs to be a relative cheap effect as in my case I have many lights that can appear everywhere.

 

Works for unlimited lights, err, and highlights, and it's basically what the sprites would be approximating in the first place. But if you need cheap, better atmospheric scattering might not be the way to go.

Edited by Frenetic Pony
0

Share this post


Link to post
Share on other sites

I think the technique john chapman is describing is exactly the same as the one being used in UE4 (and a few other recent games I've noticed).

It works quite nicely as a post effect on every light source (or rather bright spots like bloom). Needs a bit of fine tuning though...like making the texture look good, plus you might not want to have half of the screen full of lens flares xD

Edited by lipsryme
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0