PointLight/SpotLight shadows & equator accuracies
by Hewster · in Torque 3D Professional · 07/17/2009 (5:01 am) · 9 replies
I guess all of us that have been playing with the point and spot
lights have been aware of the limitations of the 'equator' effect,
and the bleeding of the light through geometry (walls)
Since I started using the beta pureLIGHT add-on, the need for more
accurate point lights has become more obvious to me, and so started
on researching if I could improve them... I have, details are below.
Ok, I was gona write a small essay, but I'll get straight to the point...
It seems the dynamic light accuracy in both the shadows and the
equator are directly dependant on the poly density of the object being
lit, this would also seem to apply to the sun object.
My experiments are as follows:
Worse case scenario = a large object (plane) with just 2 polygons
making up its surface. The model I used in the below vids are made
from 'sheets' of 10m x 5m x 0.05m blocks (assuming 1 unit = 1 meter)
NOTE: Models are DTS exported from Max2009, also, when working
out density I have taken both sides of the block into consideration,
as it seems back facing polys affect the light calculations too.
OK, first vid, worse case... poly's per meter square is just 0.08
Second is made from a medium density blocks 1.28 Poly's per meter square
Third is from very high density blocks 23.04 Poly's per meter square
It is quite obvious to see that high density polys = good shadows &
well defined equator.
I have experimented with making 'light blocking' single sided, med
density models to place in the walls of my buildings that are
having light bleeding problems, and this technique will suffice,
however, this is my question....
Would it be possible to have a per model point/spot light setting,
to allow control over the way the lighting system deals with
each model (defaults to 1) so we can instruct the light engine
to apply more accurate shadows on low poly density, but yet
physically large models?
^^ hope you get what I mean.
Cheers,
Hewster
lights have been aware of the limitations of the 'equator' effect,
and the bleeding of the light through geometry (walls)
Since I started using the beta pureLIGHT add-on, the need for more
accurate point lights has become more obvious to me, and so started
on researching if I could improve them... I have, details are below.
Ok, I was gona write a small essay, but I'll get straight to the point...
It seems the dynamic light accuracy in both the shadows and the
equator are directly dependant on the poly density of the object being
lit, this would also seem to apply to the sun object.
My experiments are as follows:
Worse case scenario = a large object (plane) with just 2 polygons
making up its surface. The model I used in the below vids are made
from 'sheets' of 10m x 5m x 0.05m blocks (assuming 1 unit = 1 meter)
NOTE: Models are DTS exported from Max2009, also, when working
out density I have taken both sides of the block into consideration,
as it seems back facing polys affect the light calculations too.
OK, first vid, worse case... poly's per meter square is just 0.08
Second is made from a medium density blocks 1.28 Poly's per meter square
Third is from very high density blocks 23.04 Poly's per meter square
It is quite obvious to see that high density polys = good shadows &
well defined equator.
I have experimented with making 'light blocking' single sided, med
density models to place in the walls of my buildings that are
having light bleeding problems, and this technique will suffice,
however, this is my question....
Would it be possible to have a per model point/spot light setting,
to allow control over the way the lighting system deals with
each model (defaults to 1) so we can instruct the light engine
to apply more accurate shadows on low poly density, but yet
physically large models?
^^ hope you get what I mean.
Cheers,
Hewster
#2
My point isn't about that though, its the fact that the higher the
poly density, the better it is for both shadow accuracies and
'equater' mimimalization.
I am looking for a way to get these better accuracies, Without
tessellating all my models :)
07/17/2009 (7:53 am)
Yes Steve, otherwise known as the 'equator' :)My point isn't about that though, its the fact that the higher the
poly density, the better it is for both shadow accuracies and
'equater' mimimalization.
I am looking for a way to get these better accuracies, Without
tessellating all my models :)
#3
07/17/2009 (8:30 am)
equator - ah, gotcha.
#4
Please please reserve judgement on this, or at least re-test, once these are fixed. Single-pass dual paraboloid, I am not sure how or why that was picked as the only implementation I wrote to get working, is not only an un-published experemental technique...but it was a DX10 class feature which I wanted to see if I could get working in DX9 "just for fun". (Check out what it actually does sometime, it's a cool feature).
The artifacts on single-pass dual paraboloid are TERRIBLE, especially for -low res geometry, but they are very, very fast to draw and update. That is why I did multiple shadow types in the research code; it is just that only one of them is working in T3D right now.
07/17/2009 (8:35 am)
That's a great writeup, but both cube map shadows and multi-pass Dual parabolid shadows are not working, currently, and those do exactly what you describe. Invest more time, for better shadow quality.Please please reserve judgement on this, or at least re-test, once these are fixed. Single-pass dual paraboloid, I am not sure how or why that was picked as the only implementation I wrote to get working, is not only an un-published experemental technique...but it was a DX10 class feature which I wanted to see if I could get working in DX9 "just for fun". (Check out what it actually does sometime, it's a cool feature).
The artifacts on single-pass dual paraboloid are TERRIBLE, especially for -low res geometry, but they are very, very fast to draw and update. That is why I did multiple shadow types in the research code; it is just that only one of them is working in T3D right now.
#5
07/17/2009 (9:09 am)
Quote:Buy huge present in huge box for small child -> small child plays with box
I am not sure how or why that was picked as the only implementation I wrote to get working
#6
any software is in beta.
For a "just for fun" experiment it works pretty dam well !
I am quite happy to make use of my 'light blocks' for now :)
07/17/2009 (9:10 am)
Thanks for your answer Pat, I am quite happy to not pass judgement whileany software is in beta.
For a "just for fun" experiment it works pretty dam well !
I am quite happy to make use of my 'light blocks' for now :)
#7
Just as a quick comparison of the 3 different point light shadow techniques:
Single Pass Dual-Paraboloid: Draws each object within the radius of the point light one additional time.
Dual-Paraboloid: Draws each object within the radius of the point light two additional times.
Cube Map: Draws each object within the radius between 1 and 5 additional times.
I don't know if you have taken a look at the "Toggle Shadow Vis" option in the Lighting menu, but if you open that window, and click on a light, it will show you the shadowmap for that light. If you change the shadow type of a point light to dual parabaloid (click on a different light, then click back on that light to make shadow vis update, kind of buggy) you can see that there are big differences in how it looks. All of the black areas which are kind of "cut out" from the single-pass map are causing those effects. In the regular dual-pass map, you will notice those don't exist.
07/17/2009 (10:33 am)
It is a fantastic experement and you designed that geometry super well...in fact, I think you have accurately shown the drawbacks of the Single Pass Dual Paraboloid, especially with triangle density.Just as a quick comparison of the 3 different point light shadow techniques:
Single Pass Dual-Paraboloid: Draws each object within the radius of the point light one additional time.
Dual-Paraboloid: Draws each object within the radius of the point light two additional times.
Cube Map: Draws each object within the radius between 1 and 5 additional times.
I don't know if you have taken a look at the "Toggle Shadow Vis" option in the Lighting menu, but if you open that window, and click on a light, it will show you the shadowmap for that light. If you change the shadow type of a point light to dual parabaloid (click on a different light, then click back on that light to make shadow vis update, kind of buggy) you can see that there are big differences in how it looks. All of the black areas which are kind of "cut out" from the single-pass map are causing those effects. In the regular dual-pass map, you will notice those don't exist.
#8
A testament to your experiment that its working this well for this long. :)
In beta 4 i was able to get some refactors in place that would finally allow the different shader combinations needed for the other types of shadows without needing to write a crap ton of TorqueScript glue code.
The other types are now selectable from the shadow type dropdown and they render... but render incorrectly. It will be fixed by the next code drop.
07/18/2009 (1:32 pm)
Quote:I am not sure how or why that was picked as the only implementation I wrote to get workingIt wasn't chosen... it was what the #defines in the shader were hard coded to and one of the only ones that worked properly after it was moved into T3D from the research branch.
A testament to your experiment that its working this well for this long. :)
In beta 4 i was able to get some refactors in place that would finally allow the different shader combinations needed for the other types of shadows without needing to write a crap ton of TorqueScript glue code.
The other types are now selectable from the shadow type dropdown and they render... but render incorrectly. It will be fixed by the next code drop.
#9
If you would like me to test any mid-beta stuff on my models, I'm
only too happy to help.
Same goes for the support for lightmapped models, as talked about in this
thread:
www.garagegames.com/community/forums/viewthread/97273
07/19/2009 (7:08 pm)
Hey guys, thanks for the responses :)If you would like me to test any mid-beta stuff on my models, I'm
only too happy to help.
Same goes for the support for lightmapped models, as talked about in this
thread:
www.garagegames.com/community/forums/viewthread/97273
Associate Steve Acaster
[YorkshireRifles.com]