Light halos, lens flares, volumetric stuff

Started by
13 comments, last by lipsryme 11 years ago

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

Advertisement

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

I haven't studied that demo either, but from what I remember, it's just a screen-space effect.

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.

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

My journals: dustArtemis ECS framework and Making a Terrain Generator

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.

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

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...

You might want to take a look at the page linked below, it might be what you are looking for (specifically the smoke and rain demos)

https://developer.nvidia.com/nvidia-graphics-sdk-directx

******************************************************************************************
Youtube Channel

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

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

This topic is closed to new replies.

Advertisement