Game Development Community

Any chance to get more than 4 cuts in AL?

by Joshua Halls (Xerves) · in Torque 3D Professional · 03/15/2010 (1:08 pm) · 13 replies

Not sure if there has been any thought into this or if it is possible? Currently we are using 2048 on the quality for 3/4 cuts and as you can imagine that tends to melt video cards. Kind of a toss up from making it look good to making it run good. Hard to really get anything beyond 200 units of distance with any vertical structures and something fairly well defined like the foliage on a tree. 6 cuts would allow for a little more wiggle room in the further out cuts and making the closer cuts a bit nicer while using smaller resolutions. We put in manual distance settings for each cut as was mentioned awhile back and find the control and quality is much better than what is happening now.

About the author

Part of the team that works on The Repopulation, a SciFi based MMO using a heavily modified version of the Torque MMO Kit - T3D. I also take care of the T3D version of the Torque MMO Kit.


#1
03/23/2010 (11:38 am)
We've considered more splits in the sun PSSM shadow, but each split can cost alot more draw calls... especially if your not LODing your geometry.

I'll keep it in mind.

Looking at all the shipping games out there most have very short ranges for their PSSM or very noticable splits. Its mainly them hiding things by not giving you a wide open undecorated area where its very noticable.
#2
03/25/2010 (1:17 pm)
@Tom:

Also most games avoid having long shadows: the sun is often at relatively high elevations and the shadow angles are often at 45 degrees or more. This allows the shadow splits to use smaller areas focused around the camera.

We'd get better results by having an option to control the area size of each split. I find T3D's are too big for scenes without massive casters.

Example: in Just Cause 2, the terrain doesn't cast shadows even in the highest settings. Their sun is also often very high in the sky, and as result the shadows always have a very nice resolution at quite large distances.
#3
03/27/2010 (12:51 pm)
@Manoel

So we've always stuck to the automatic 'log weight' method for split selection that you see in most PSSM papers.

Do you think we should drop that in favor of explicit split distance selection? Like...

splitDists = "0.1 0.25 0.45 1";

I always avoided this because i thought things would be even more confusing. Should we just depreciate one in favor of the other?

#4
03/27/2010 (1:49 pm)
We are using that method (Did not use decimals but actual distance values). Set it to something like 8 20 45 for the splits. I would recommend actually having both and having one override the other. More options tend to be better IMO, but setting the actual distances I find to work much better than using the logWeight that was there. I would recommend putting in the debug option to turn on the split view as well from the GUI, would help with setting them and would be more apparent that the option exists than digging through the forum.

My 2 cents.
#5
03/27/2010 (4:45 pm)
Well... having options is nice, but i hate the mess it makes having 3 or 4 different knobs for controlling the PSSM splits.

Currently we have:

numSplits = "4";
shadowDistance = "400";
logWeight = "0.75";
overDarkFactor = "2000 1000 1000 500";
fadeStartDistance = "300";

I'd hate to just add to that... i want to make it simpler and more powerful.

The overDarkFactor i hope to improve soon thru "pancaking" which should allow us to have a single value over darkening value which works the same across all the splits instead of 4.

We could maybe change things to just this:

shadowSplitDist = "10 100 400 0";
shadowOverDark = "500";
shadowFadeDist = "350";

This would be a 3 split PSSM with the splits at 10 and 100 with the end of the shadow at 400 meters. The shadow would start to fade out at 350 meters.

I could also maybe do this:

shadowSplitDist[0] = "10";
shadowSplitDist[1] = "100";
shadowSplitDist[2] = "400";
shadowSplitDist[3] = "0";
shadowOverDark = "500";
shadowFadeDist = "350";

By changing the split distance into a fixed array it might be clearer to the user in the inspector and easier to edit.

Thoughts?
#6
03/27/2010 (5:09 pm)
We ended up using flat shadowOverDark values (otherwise they don't blend well at least IMO as one cut is darker/lighter than the other). We use the array split like you have there, but with the shadow distance (no real point of keeping it though as it should be part of the split). We also exposed those as a client values that can be manipulated from the base, but that is another thread.

My thoughts at least, worked out well and was easy enough to get it to look like you wanted it depending on how the scene was laid out.
#7
04/09/2010 (5:38 pm)
Ok... so i have this working now:

shadowDistance = "5 40 150 1000";
overDarkFactor = "400";
fadeStartDistance = "500";

It feels pretty nice editing it using real distances vs. using the log weight formula and it should allow for alot more flexibility in how to setup your splits.

My first concern is should i make these fractional based to the far clip plane instead of a physical distance? This would allow you to change your far clip and get some reasonable results in your shadows instead of wasted shadow space. In particular i see how that would help with cut scenes... but is it important for other needs as well?
#8
04/09/2010 (6:38 pm)
I like the idea of having it fractional based on the far clip plane. I always like anything that makes it easier to adjust the overall graphics easier for the enduser.

That said, maybe put in a simple boolean to enable the 'fractional' setting which overrides the shadow distance splits with a set of 0.0 to 1.0 splits?

I know it would mean increasing the complexity of the controls but I think it would be nice to have either way available.

Something like:
01.shadowDistance = "5 40 150 1000";
02.overDarkFactor = "400";
03.fadeStartDistance = "500";
04.fractionalFarClip = "true";
05.fractionalFarClipFactors = "0.05 0.15 0.45 1.0";
06.fractionalFadeStartFactor = "0.5";
#9
04/10/2010 (10:09 am)
@Aaron

In general i avoid having two different ways to do the same thing... it just complicates things with usually little benifit.

Thinking about this a little more... a custom lighting rig or animation of parameters would be the best way to deal with the shadow distances in a cut scene.

Any other thoughts?
#10
04/10/2010 (10:59 am)
I am happy to see the ability to line up the splits manually as opposed to the log weight formula, all else is just icing on the cake :) I certainly like the simple approach. I'm new to this engine and not exactly experienced as a programmer and I appreciate the ease of use provided.
#11
06/14/2010 (9:00 pm)
Quote:Ok... so i have this working now:

view plainprint?

1. shadowDistance = "5 40 150 1000";
2. overDarkFactor = "400";
3. fadeStartDistance = "500";

shadowDistance = "5 40 150 1000";
overDarkFactor = "400";
fadeStartDistance = "500";


It feels pretty nice editing it using real distances vs. using the log weight formula and it should allow for alot more flexibility in how to setup your splits.

My first concern is should i make these fractional based to the far clip plane instead of a physical distance? This would allow you to change your far clip and get some reasonable results in your shadows instead of wasted shadow space. In particular i see how that would help with cut scenes... but is it important for other needs as well?

Ouch, this is going to break our nice shadow system for our isometric RPG... Currently we have 2 splits (fixed) and the shadow distance that changes depending on the distance the camera is from the terrain, which allows us to have crisp shadows up close and they do not disappear when you zoom out. Also with great performance... Oh, well, I guess we'll have to re-work the system.
#12
06/14/2010 (9:52 pm)
@Oscar - Well you still have some code which executes when your camera moves. You could totally do the same math we used to do in PSSMLightShadowMap::_calcSplitPos() and assign those values to the split distances.

Shouldn't be too bad to hook up.
#13
06/15/2010 (7:10 am)
Thanks Tom. A couple of doubts about this... I see that there is no numSplits parameter. How do I tell the sun to use only 2? Place zeros in shadowDistance, like this: shadowDistance = "20 200 0 0";?

Is the lastSplitTerrainOnly parameter still there? I assume it is, but just asking to be sure :)

Thanks! And we also need to check this thing Manoel pointed out to further optimize our sun shadows: http://www.torquepowered.com/community/forums/viewthread/115993/1#comment-751381