Game Development Community

SimulateFences

by Larry Jeannette · in Torque X 2D · 05/26/2009 (2:44 pm) · 11 replies

I have searched the site but I am unable to find out exactly what the SimulateFences (in torquesettigns.xml) option does. I can find posts that recommend setting it to True or False depending on which graphics card you are using but no explanations for what exactly this setting is for.

I have also found comments on how to set this option in code but can find nothing on when it should be True and when it should be False. Is there any way to detect (via code) which value this option should be set to for any particular system?

About the author

Recent Threads


#1
06/03/2009 (11:18 pm)
I can't tell you exactly what simulatefences does (other than speed things up greatly in many cases), but I can tell you that it's not bad to leave on, other than in situations with intel graphics cards. (which is why Microsoft removed it from stock XNA)

This is per an unfinished conversation with one of the original TX programmers Clark Fagot, about a year or so ago. Maybe I should finish this conversation with him and post back here, eh? ;)
#2
06/04/2009 (3:23 pm)
Ok, I spoke a little more with Clark on the subject. Basically, SimulateFences is used to keep your graphics card from getting to far ahead in its rendering.. think of it along the same lines as the force VSNYC option most 3D accelerators give you.

With SimulateFences on, you will often get a faster and smoother experience in the game, due to the video card not being allowed to get too far ahead before finishing rendering earlier frames. (It wrangles the texture memory of the card to achieve this)

With it off, you can experience much different results, depending on the video card you are running.. in some cases a fast card can be rendering so far ahead that the simulation will actually be running slower and/or very jerkily due to missed frames.

SimulateFences is used to keep this in check, and is fine to leave enabled.

Hope this answers your questions!
#3
06/05/2009 (5:49 am)
Thanks a bunch Kenneth for your replies. This really cleared things up with me, and I bet the OP feels the same way!
#4
06/05/2009 (8:36 am)
You're welcome.
#5
06/05/2009 (5:00 pm)
Sweet! Added a link to this in the TDN Community links section.

Brian
#6
06/05/2009 (6:04 pm)
@Ken
Question... kinda related. I noticed there is an <AutoEnableFences>true</AutoEnableFences> tag in the torqueSettings.xml that is on the TankBuster demo. Does this do something similar?

Brian
#7
06/08/2009 (3:12 am)
I'm glad that's been resolved. I believe stock standard XNA tries to do something similar, but the result is a jerk every few seconds.
#8
06/14/2009 (9:03 pm)
@Brian
This is the only place I could find in the source (TX Pro 2.0) that references AutoEnableFences:
// turn on fence simulation if we are running on a challenged video card
//  the ATI X300
if (_settings.AutoEnableFences && adapterDescription.IndexOf("nvidia") == -1
    && adapterDescription.IndexOf("x300") != -1)
        _settings.SimulateFences = true;
So it turns it on if the description does not contain "nvidia" but does contain "x300". I guess that's all there is to that Field.
#9
06/15/2009 (2:55 pm)
Sweet, thanks Scott. I'm thinking when I get home I'll add a section to TDN for listing cards that do and don't have the issue. Maybe this code could be expanded in later versions of TX or maybe even have a resource that it reads the different cards out of an XML file. Cool stuff.

Brian
#10
06/15/2009 (3:59 pm)
I have a GeForce 7900, and I need fences on.
#11
06/15/2009 (7:07 pm)
Hey all,
I went ahead and added that TDN page I was talking about. I already included your information Trent, though you might want to update it with notes or if your GeForce 7900 is a specific variant like a GT or GS. Page is here:

tdn.garagegames.com/wiki/TX/Tutorials_and_Guides/Other/SimulateFencesReference

Brian