Game Development Community

Lighting: lightDynamicGeometry - what is "Dynamic"

by Hewster · in Torque 3D Professional · 07/17/2009 (7:16 am) · 10 replies

Basically I am using PointLights to simulate local ambient lighting
for 'dynamic' models only, eg the Player Model

However, in T3Db3 when selecting lightDynamicGeometry, it also illuminates
the terrain , .dif's & .dts... unless they have a tone map applied,
in which case it doesn't, and the model seems to become a 'staticGeometry'
so far as the lighting is concerned.

So my question is, would it be possible to mark any model as a "static"
so as to allow using point lights to apply light to the diffuse of the
selected models only? (eg for faking ambient/reflected lighting for player models)

I should point out this is, I believe, quite important for people
intending to use pureLIGHT to apply high quality lightmaps to their models,
and yet not need to use pureLIGHT for every model in the level.

Cheers.

Hewster

#1
07/17/2009 (8:37 am)
Those should be renamed in Beta4 to make more sense, there will also be documentation. Until then, check out these temp docs: docs.google.com/View?id=dd8v49xb_3xqdcgqfw
#2
07/17/2009 (8:59 am)
Great stuff Pat, looks like you are well in front of me :)
#3
07/17/2009 (10:17 am)
Trying, hehe. I am really glad someone is mixing static and dynamic lighting since I don't really have great test cases for it :)

Like the docs say, I removed/renamed all of those silly boolean variables that I had in there at the beginning (I don't know what I was thinking...6 booleans? geez...), so hopefully it is much more clear in Beta 4.

The "Advanced lightmap support" option also needs more testing. It uses Multiple-Render Targets to pre-fill the deferred lighting buffer with the lightmapped data. This allows you to have specular reflections on lightmapped geometry, without having the diffuse lighting. So the lighting comes from the lightmap, and the specular is dynamic. This is a pretty cool feature but I am sure there are incompatibilities I have not run into yet.
#4
07/20/2009 (6:59 am)
@Pat, I am more than willing to try out 'mid-beta' to help get this
lighting nailed down :)


From my point of view, there are 3 reasons to use point / spot lights
within a lightmapped scene.

1) To represent the light sources within the lightmap, and cast shadows
of non-lightmapped meshes (player model) onto all meshes (inc lightmapped).
This method must occlude all geometry in its lighting calculations
(you don't want the player shadow to be seen in an adjoining room)

2) To represent the light sources within the lightmap, and calculate
the Normal & specular highlights on the lightmapped mesh, without
illuminating it, and must occlude all geometry in its lighting calculations
(you don't want too see spec & normal in adjoining rooms)

3) To represent 'fake' ambient lighting within the scene, the light must
simply illuminate all meshes, except lightmapped, and must occlude all
geometry in its lighting calculations.
(you don't want to see non-lightmapped meshes being illuminated in
adjoining rooms)

Having said the above, I think it looks nice when the sun illuminates
the lightmapped mesh, it adds some overbrightness, where as the
pure lightmapped model looks a little dull without it.
Perhaps an option in the sun entity to allow illumination, but NOT
shadow of lightmapped meshes would be a nice option.
I guess you could add that to all lights.. most of us like to
'play' with settings :)

Hewster
#5
07/20/2009 (7:04 am)
Post Script... I will go though what I'm seeing in beta4 with regards to
this, hopefully later this evening (5pm here GMT+2)
#6
07/20/2009 (8:47 am)
You are going to run into situations where the shadow of a non-lightmapped object "bleeds through" a lightmapped wall. You can fix this with Zones. I am also poking at how to fix this better.

The problem is that, if you don't want "double shadowing" than the lightmapped wall doesn't get drawn to the shadow map, which is what would actually prevent the shadow from going through the wall. So what I may need to do is just eat a bit in the shadow maps, and have it flag lightmapped/nonlightmapped geometry in the shadow map. That means (though) that I'll be drawing more geometry to the shadow maps than is really needed.
#7
07/20/2009 (9:15 am)
I understand that to get this 'perfect' lighting, will cost some
performance, but I think that so long as its an option for the
important lights, an artist can fudge around the problems..

Many 'fake' ambient lights could be 'light all except LM' if placed
and adjusted correctly. There will be some lights that must have this
higher functionality though, even at the expense of performance to
ensure we can achieve an overall realistically lit scene.

I'm sure you understand :)

I wish I was more of a GFX programmer, but its all magic to me !! hehe

Your all doing a fantastic job, and am sure by version 1.0 we'll be rockin'

As I said in previous post, I'm very willing to help with any mid-beta
stuff you need testing.

Cheers,

Hewster
#8
07/20/2009 (12:17 pm)
Hewster,

If I understand it right, I think we are talking about the same thing, and I agree. I am glad someone is using this mixing of static and dynamic lighting because all I really have for "test cases" is me messing around.

I will try to get this kind of shadowing in. After that, I think all of the lighting cases for mixing static/dynamic are supported, right?

-Pat
#9
07/20/2009 (12:38 pm)
It seems were singing from the same hymn sheet :)

What I'll do is package up my test level, and e-mail it to you,
along with some notes (might not be till tomorrow though).
#10
07/20/2009 (1:40 pm)
Resident Evil 5 does something very similar: the actual levels use lightmaps, the characters cast simple projected shadows on the static geometry but the static geometry casts shadows on the characters. This seems to help a great deal with saving fillrate since creating the depth buffers is cheap, but actually using them to perform shadowmapping is expensive.