T2D 1.0.2 DirectX Fix
by Ken Paulson · in Torque Game Builder · 04/22/2005 (6:01 pm) · 30 replies
In guiCanvas.cc, line 1079, uncomment this bit:
PROFILE_START(glFinish);
glFinish();
PROFILE_END();
Haven't dug into the code to see what the implications are, but it fixed things perfectly here. From a slow flickery mess to wonderful smoothness.
PROFILE_START(glFinish);
glFinish();
PROFILE_END();
Haven't dug into the code to see what the implications are, but it fixed things perfectly here. From a slow flickery mess to wonderful smoothness.
#22
All I can say for now is that you will be seeing changes to the rendering layer but this isn't exclusive to T2D.
The need for a better GFX layer is well understood and doesn't require anyones opinion/stats to convinced anybody really. All good things come to those who wait and come they will. :)
- Melv.
07/04/2005 (4:26 am)
Let me clarify what T2D is a little. T2D is running on-top of the TGE platform and it won't be breaking away from its platform anytime soon. Any improvements to the platform layer will come from TGE, driven by both TGE and T2D needs. The improvements to not only the D3D layer but the whole graphics-layers have been on the cards for quite a while and TSE as laid a path for it. The D3D layer is old and no amount of tweaking will revive it.All I can say for now is that you will be seeing changes to the rendering layer but this isn't exclusive to T2D.
The need for a better GFX layer is well understood and doesn't require anyones opinion/stats to convinced anybody really. All good things come to those who wait and come they will. :)
- Melv.
#23
07/05/2005 (12:54 am)
Fair enough. Thanks for the reply. :)
#24
- Melv.
07/05/2005 (3:33 am)
No problem. A new GFX layer similar to TSE is something that's essential to taking these products forward.- Melv.
#25
at least it is a generic interface and it works (and by this i mean once OGL support is in as well ;)
Perhaps just move the current glXXX stuff into a GFX wrapper class with the same interface as
TSE GFX class that calls the current stuff so when the time comes to update the gfx layer there
will be little or no changes needed to T2D code?
I'll play around a bit and see how much of an impact it will have code wise...
layder
neo
07/05/2005 (6:12 am)
Why not just USE the GFX interface from TSE? I know shaders et al might be overkill butat least it is a generic interface and it works (and by this i mean once OGL support is in as well ;)
Perhaps just move the current glXXX stuff into a GFX wrapper class with the same interface as
TSE GFX class that calls the current stuff so when the time comes to update the gfx layer there
will be little or no changes needed to T2D code?
I'll play around a bit and see how much of an impact it will have code wise...
layder
neo
#26
@Kevin: when you say :
In OpenGL2D3D.cc, line 5798:
comment out the call to BeginScene.
In my code folder I found the code without comments:
GLAPI void GLAPIENTRY glFinish (void)
{
g.m_d3ddev->BeginScene();
}
Did you mean, comment the call to BeginScene?
09/28/2005 (4:17 pm)
This thread seems pretty interesting (specially because I own a lower end machine :)@Kevin: when you say :
In OpenGL2D3D.cc, line 5798:
comment out the call to BeginScene.
In my code folder I found the code without comments:
GLAPI void GLAPIENTRY glFinish (void)
{
g.m_d3ddev->BeginScene();
}
Did you mean, comment the call to BeginScene?
#27
Not that I have anything against 'vi', but it's Ken. :)
09/28/2005 (7:42 pm)
"Comment out" as in remove by adding comments. BeginScene shouldn't be called in glFinish.Not that I have anything against 'vi', but it's Ken. :)
#28
(I'm a little puzzled by your first post that says uncomment the block of code and your posterior post that says comment out glfinish)
guiCanvas.cc: (1080)
-----------------
PROFILE_START(glFinish);
//glFinish();
PROFILE_END();
opengl2d3d.cc: (5801 - 6914)
--------------------
GLAPI void GLAPIENTRY glFinish (void)
{
//g.m_d3ddev->BeginScene();
}
....
g.m_d3ddev->EndScene();
while (g.m_pD3DX->UpdateFrame(g.m_doFlip ? 0 : D3DX_UPDATE_NOVSYNC) ==
DERR_SURFACEBUSY) {}
g.m_d3ddev->BeginScene();
Regards.
09/29/2005 (9:31 am)
@Ken: Oh sorry Ken :). Thank you. So if I inderstand well this is how the code looks at the end:(I'm a little puzzled by your first post that says uncomment the block of code and your posterior post that says comment out glfinish)
guiCanvas.cc: (1080)
-----------------
PROFILE_START(glFinish);
//glFinish();
PROFILE_END();
opengl2d3d.cc: (5801 - 6914)
--------------------
GLAPI void GLAPIENTRY glFinish (void)
{
//g.m_d3ddev->BeginScene();
}
....
g.m_d3ddev->EndScene();
while (g.m_pD3DX->UpdateFrame(g.m_doFlip ? 0 : D3DX_UPDATE_NOVSYNC) ==
DERR_SURFACEBUSY) {}
g.m_d3ddev->BeginScene();
Regards.
#29
The changes in opengl2d3d.cc are the fix for D3D. Removing the call to glFinish in guiCanvas.cc can improve performance when using OpenGL. So they're 2 related, but different things.
BTW, you can actually comment out this whole block:
//PROFILE_START(glFinish);
//glFinish();
//PROFILE_END();
There's no point in profiling a call that never happens. :)
09/29/2005 (9:41 am)
The first post was a "quick fix", later followed up by a good and proper fix.The changes in opengl2d3d.cc are the fix for D3D. Removing the call to glFinish in guiCanvas.cc can improve performance when using OpenGL. So they're 2 related, but different things.
BTW, you can actually comment out this whole block:
//PROFILE_START(glFinish);
//glFinish();
//PROFILE_END();
There's no point in profiling a call that never happens. :)
#30
I'm going to improve my D3D && OGL skills sometime in the future...
T2D source code is going to help me ;)
09/29/2005 (12:09 pm)
OK Ken, thakyou very much.I'm going to improve my D3D && OGL skills sometime in the future...
T2D source code is going to help me ;)
Torque Owner Jason McIntosh
2D games are less likely to be played by "cutting edge" gamers who have all the latest drivers etc to make OpenGL work 100% of the time (more realistically it's more like 70% of the time). IMHO D3D is more important to T2D than to TGE since there needs to be a fallback option for someone without the latest 3d card and new drivers.