Game Development Community

Advanced Lighting Feedback

by Tom Spilman · in Torque 3D Professional · 05/05/2009 (1:04 am) · 19 replies

Hey guys.

I'm looking for some initial feedback on Advanced Lighting with what you guys have seen so far. Its hard to judge fully in beta 1 as only one of the point light shadow types are working and spotlights are broken, but i'd appreciate anything you can comment on.

A couple of AL things that we're aiming for in beta 2.

- The spotlights work... finally.
- The other point light shadow types (cube, paraboloid, dualparaboloid).
- Optional spotlight gobos.
- Light animations (pulse,flicker,blink,etc).
- Light coronas/flares.
- HDR bloom and tonemapping PostFx.
- New light rays PostFx.

So a few specific topics for discussion...

1. What do you think of the shadow filtering method we're using... the randomized noise vs. smooth PCF. Crysis uses the randomized noise method mostly to save fillrate cost... PCF is more expensive. The noise also looks better as the penumbra gets wider.

2. The point lights try to do penumbra estimation... this means the shadow is harder where objects touch surfaces and softer at distance. Do you think that the penumbra effect is worth extra fillrate and lower quality shadow filtering?

3. Would you prefer PointLight and SpotLight as separate objects... or one Light type as it is now?

4. Any light features from other engines or tools you've used that you would like to see in Torque 3D?

Thanks!

About the author

Tom is a programmer and co-owner of Sickhead Games, LLC.


#1
05/05/2009 (3:50 am)
1. Generally I think the fillrate save is a good thing.
At any further distance the effect has no visual consequences.
Yet there are situations where I think it has too heavy visual consequences. Having the option to choose between noise or smooth PCF would be a good thing, to make it a quality option.

2. Have not even realized that yet actually. Sounds like a food for "optional"

3. Two objects when my suggested feature below would happen, otherwise 1

4. Optional Cube texture gobo for the point light
#2
05/05/2009 (5:30 am)
Light shaping is a nice feature for a deferred lighting system. Render a mesh into stencil for the light and only run the light shader where the stencil is set. Like a gobo/cookie but fast and more complex 3D shapes possible :)

Note: Very complex concave shapes may need stencil shadow techniques (region counting in and out).

Examples of usage :-
Point light that doesn't render too close to the light, render a donut like shape.
Complex spot lights, like a cop car roof light. Render 4 axial cones with a point light. Rotate the cones.

#3
05/05/2009 (5:39 am)
Attenuation textures.
Let be honest the classic attenuation (constant, linear, quadratic) model sucks... its almost impossible to get what you want.
Replace with a per light 1D texture and a max distance. Shader looks up distance from light / max distance into 1D texture.

Viola easy artist friendly attentuation + lots of crazy non-physical based effects possible.

Obviously in reality you pack all the 1D textures into a single 2D page for reducing state changes.
#4
05/05/2009 (10:16 am)
1. Seems good to me.
2. It might be something worth letting the user have control over when they generate the EXE in case they want to get a bit more performance out of it and don't care about soft shadows.
3. I actually think having them as 1 object would be more user-friendly as it would let the user change settings quickly and try out different lighting types that they feel might work best without having to create a second object and place at the same screen location as the first.
4. Volumetric light casting is always useful. It also looks like Unreal put in a feature recently to make a texture into a light emitting object (which I assume is directional based on the normals of the shape). This would be very handy for doing things like neon, stained glass or lighting from surface that doesnt coform to just a single point.

With regards to other things, have you guys looked at the Light Lister in 3DS Max? Its a pretty handy UI dialog for adjusting the basic settings (ie name, intensity, color, shadow type, shadow map size, attenuation) of any of the lights in your scene without having to actually select them and edit one by one. Having something like this in T3D would be very handy to say the least.
#5
05/05/2009 (11:46 am)
Optional spotlight gobos! And a texture projector that conforms to the target( unlike the TGE one what was just a drop plain argh i was disappointed when i found that out.)

With gobos and a projector a good designer can build the illusion of a far more complex scene, without largely impacting the holy FPS. Gobos and projectors are the only feature I truly miss from my Unreal days.
Think about stain glass window who's glass colors and image are shadowed onto the inside of the room by a projector. Or if it is a night scene a gobos to project the stain glass image into the surrounding countryside from the lit stain glass window.
#6
05/05/2009 (12:33 pm)
1. I'm all for saves in the fillrate, but maybe have an option for both.

2. Another possible option for the end-user to decide.

3. Multiple streamlined types seems like a good idea to me in order to allow for future modification and updating. An all-in-one solution has the potential for excess bulk, conflicts, and cumbersome options.

4. Light/texture projectors. Gobos sound good to me.
#7
05/05/2009 (1:33 pm)
Great feedback so far guys... keep it coming!

One thing to keep in mind is we cannot implement all variations on a feature and make them all optional. Not only does it make the system more complex but takes alot more time to implement, test, debug, document, support, and maintain two different options when one will suffice.

I'm looking for a single solution that covers the largest audience in almost every case... so if you do care which one is implemented... say so now or prepare to code it your self. ;)
#8
05/05/2009 (1:58 pm)
In that case, I would think that a combination of performance and the method with the most functionality would win out over options.
#9
05/05/2009 (2:12 pm)
An texture projector that conforms to the target is more flexible then a light emitting object gobos. Of course in essence the gobos IS a texture projector, but with a light attached. So they easily could be the same thing.

Penumbra estimation could be faked by the designer, be it projector, small static lights(could we have 'dark' or negative lights?), model design, whatever fit the case.

PointLight and SpotLight as separate objects? If one could set a target object by name for a Pointlight, or a distance to emit and falloff radius(at that emit distance) then configuring a spotlight from a Pointlight becomes possible.(now terminology is becoming scratchy...)


#10
05/05/2009 (3:43 pm)
They all sound good, but THE MOST IMPORANT THING IS TO BE ABLE TO CREATE INTERIOR LIGHTS WITHOUT THE LIGHT LEAKING INTO OTHER ROOMS OR ONTO THE LAND BELOW. Whatever the technique, I'd like to see that fixed!

Sorry for the capital letters but I wanted to be clear about what I've been wanting to see fixed.

#11
05/05/2009 (4:25 pm)
So that'd be portalling and a lower lightmap geometry scale then?
#12
05/05/2009 (4:32 pm)
@Sorin - the stencil technique I mentioned can easily solve that, simply set the room as the light inclusion volume and viola no leakage outside the room.
#13
05/05/2009 (4:55 pm)
@Tom:

1. I like the edges, it would look more realistic if they were soft, but they fit in very well with my project.

2. No opinion. I like the way it looks now, but I have little comparison.

3. Doesn't matter.

4. Yes - When the trees are completely in shadow, there is no shading on them, they look kind of flat. I'm sure this is more realistic - but is it possible to have a little bit of shading (not to the extent of basic lighting but just a bit) to simulate bounced light, and give them more of a 3D look?
#14
05/05/2009 (6:54 pm)
@Sorin - I read all the posts... you just have to say it... not yell it. ;)

We are planning on exposing the existing TGE/TGEA zoning functionality via a Zone and Portal objects you can place from the mission editor. At first it would be simple rectangular zones although we could support convex shapes at some point in the future. The portal object would need to overlap two zones to connect them.

@Dean - Its not that simple... it could work if the "room" was some sort of simple close shape... which typically its not.

@Jaimi - Having a flat look in shadows is a common issue in games. Another hidden gem that Pat left for us is trilights. Its currently implemented in...

shaders/common/lighting/advanced/vectorLightP.hlsl

... but it was bugged so i commented it out.

I think that would give you the extra definition you would like on the backside of the directional lighting.
#16
05/06/2009 (2:20 am)
@Tom Concave volumes aren't simple but the technology is tried and tested, its exactly the same issue as shadow stencil volumes. Its a counting volume problem, define the volume via enclosing planes, render front +1 back -1.

Obviously just like shadow volumes, there are the issues of near/far plane clipping but again all solved.

Light leaking is an artefact of incorrect shadowing, so using a shadow technique makes sense.

Now the question of is it worth it... depends on how much you notice light leaking...
#17
05/06/2009 (2:33 am)
@Dean - Don't think we'll be supporting that officially. Its like all the problems of stencil shadow volumes... no thanks. :)

Crysis and other engines use zoning to control light leaking with all the coders they have to throw at the problem. Seems like the right way for us to go and would also improve culling at the same time.

That said... you have all the code... give it a shot yourself and prove me wrong... i'd love to be proved wrong. :)
#18
05/06/2009 (3:14 pm)
@Tom - That sounds like a decent challenge and a good way of getting down and dirty with the new rendering architecture :)

BTW having had a quick look around the renderer, the architecture is looking very nice and also fairly easy to customise and expand, nice one :)

#19
05/06/2009 (3:21 pm)
@Dean - Thanks. I still feel its really rough around the edges and isn't as flexible as i would like... but i'm almost never perfectly happy with anything. ;)