Tremulous Forum
General => General Discussion => Topic started by: tomek-k on September 26, 2006, 06:28:59 pm
-
Just wondering how many elements of the Trem's gfx engine use hardware acceleration - I have some doubts about some elements.
I read that the engine uses some kind of bytecede compiler (or sth. like that) which is compatible only with 32bit systems and on the 64bit ones it runs slower (in software mode or sth.). I've compiled the trem for 64bits and noticed a little performance degradation, but does it have anything to do with the 3D hardware acceleration?
For example the stencil shadows - I've read about them on the forum recently, so I've enabled 'em and it turned out that the game slows down noticeably. My card supports hardware stencill buffering, but does the Trem's engine use the hardware buffer or some software one?
Moreover the stencil shadows work only when the color buffer is set to 32 bits. But the color buffer shouldn't have anything to do with the stencil buffer (on some cards the stencil buffer is somehow combined with the depth buffer, but never with the color buffer).
I know that this topic may seem more suitable for some Q3 engine's forum, but I think that this is also a good place to ask as it is also Trem's engine.
-
The Q3 engine was released quite some time ago, and back then, the CPU did some of the work that the GPU can do nowadays. If Tremulous were rendered completely by the GPU, people with higher-end hardware would have no problem at all.
-
I see you know what I meant, but I'll make my question more precise.
The Q3 engine uses OpenGL. The OpenGL specification tells that OpenGL drivers use 3D acceleration always when available.
That means for example that if some OpenGL application was written before the so called T&L era (when there were no commercial GPU's but only graphics chips, and geometry transformations and lighting were done by CPU - that was before the first GeForce) it does not mean that the app cannot use the GPU features.
It is true only for Direct3D applications - an D3D application written for D3D v6.0 (for example) will never be able to use hardware transform and lighting. It would have to be rewritten to support a newer version of D3D (7.0 or 8.0 - don't remember now).
But an app written even for OpenGL 1.0 will use hardware T&L when the graphics card's driver supports this in hardware (if the gfx card has a GPU).
So what I mean is: does the engine use OpenGL to draw all the stuff (including the shadows). If it does and if the shadows are stencil shadows they should be drawn using the hardware when available (in my case the hardware stencil buffer and operations are available).
So if the engine does not use OpenGL to render everything so maby it should be changed to some that does.
The suggestion about changing the engine already apeared on the forum. The answer was that not everybody has new hardware and the Q3 engine will run on most of the hardware.
But if the engine used the OpenGL to draw everything then this would not be a problem - look again at what I wrote at the begining - OpenGL is smarter than D3D (OGL was created by SGI - a company that has a lot more in common with graphics hardware than M$ will ever have) and if there is no hardware support for some feature, it uses the CPU instead of the gfx card (in this so-called softwre mode). You don't have to pass those D3D_PURE_HW flags (don't remember their exact names - long time ago it was when I wrote DX apps) to D3DInit() function if you want to use the hardware T&L, and check if the gfx driver supports 'em (with a mass of functions) if you want to make the game compatible with all the hardware.
But this post is not another suggestion to change the engine. It's just a quiestion about the current one.
The decision about the engine belongs to the Trem's developers.
-
But if the engine used the OpenGL to draw everything then this would not be a problem - look again at what I wrote at the begining - OpenGL is smarter than D3D (OGL was created by SGI - a company that has a lot more in common with graphics hardware than M$ will ever have) and if there is no hardware support for some feature, it uses the CPU instead of the gfx card (in this so-called softwre mode). .
You r obvasely just anther linax zeelot thats so in luv with sgi and other linax os companys that you hav no idea what a D3D and othar mircosoft technoly is about!
D3d is the enterprise software that all xbox games come with. It is way much further that old opangl from the 80s n terms of gaming preformance. It supports all T&L tecnology and more.
I am planing on making tremulas use all Direc3d so it run SO FASTER plus visualstudio is way bettar and even writes all code for you.
-
stencil shadows are slow, what card do u have?
-
"]
But if the engine used the OpenGL to draw everything then this would not be a problem - look again at what I wrote at the begining - OpenGL is smarter than D3D (OGL was created by SGI - a company that has a lot more in common with graphics hardware than M$ will ever have) and if there is no hardware support for some feature, it uses the CPU instead of the gfx card (in this so-called softwre mode). .
You r obvasely just anther linax zeelot thats so in luv with sgi and other linax os companys that you hav no idea what a D3D and othar mircosoft technoly is about!
D3d is the enterprise software that all xbox games come with. It is way much further that old opangl from the 80s n terms of gaming preformance. It supports all T&L tecnology and more.
I am planing on making tremulas use all Direc3d so it run SO FASTER plus visualstudio is way bettar and even writes all code for you.
You are obviously just another windows user that is so in love with the M$ and all it's products that you have no idea what OpenGL and other free software is about!
D3D was invented long time before M$ built xbox. And xbox uses D3D only because both of these products are from M$ (and keep in mind that Sony is thinking about implementing OpenGL in their next console).
I know it supports all hardware features that today's commercial GPUs provide - what I wrote is that OpenGL uses them in a better way.
D3D is faster than OpenGL? Youre right, but this is only because windows does not give the OpenGL the direct access to the gfx hardware (guess why - yes, because it is concurent to D3D). On all systems where OGL is a standard (not only linux) it has a direct access to the hardware.
Yes, that means that every OpenGL game runs slower on windows than on any other OS. If you cannot stand it that on my system Tremulous runs faster that on yours then it is your beloved M$'s fault, and if you want to make Trem using DX then do as you will - it's your right.
As for the VS - a real programmer writes the code himself - when the code is generated by some IDE then the code is a work of those people who created the IDE.
And if you want to make Trem faster on the windows then you should write yourself - a generated code is always slower then the written one.
And the most imprtant thing that I want to tell you:
If you did not intend to answer my question then why the fuck you wrote at all?
stencil shadows are slow, what card do u have?
GeForce 6600LE. I think it should be enough...
EDIT: many bugfixes (that windows user just pissed me off with his ignorant and arogant post... :evil: )
-
Actually, Direct3D isn't faster than OpenGL in quite a few situations because Direct3D uses kernel level code which needs a context change each time you execute Direct3D code. On the other hand, OpenGL is mostly in userland :)
Anyway, let's stop the pointless OpenGL vs Direct3D war here. It is obvious OpenGL is much better than that buggy Direct3D that doesn't work correctly on my Linux box!
-
lol tomek-k, don't get self-pwned by replying to an obvious Troll :)
-
hehe...
Just to be clear - i don't want to argue aboud 3D programming APIs.
I used D3D only as an example. Just because apps written in this API behave similarly to apps that use 3D hardware acceleration for only some of 3D rendering (via OGL, D3D, 3Dfx, or any other API that gives access to 3D hardware), but also implement their own software-only algorithms to do some other things.
My point was that using OpenGL API (for everything that is 3D (even 2D) rendering related, and is supported by OpenGL) one is able to write an engine that will use 3D hardware always when available (contrary to other APIs).
And my question (again) was "does the Trem's engine use OpenGL API to render everything that is possible to be rendered by OpenGL? Or does it implement some software algorithms to render things that were not supported by hardware when the engine was written, although they could be written using OpenGL API (which supported 'em at that time, yet still in software mode)?"
-
Tomek-k, you seem obnoxious, arrogant and ignorant, i dont feel inclined to attempt to answer your question.
If you want to know whats going on in the "trem" engine then take a look at the source code, here (http://www.icculus.org/quake3/).[/url]
-
Well I know for a fact that particles are rendered by the CPU.
-
tomek-k, don't feed the troll who can't even write the Minesweeper Consultant and Solitaire Expert abbreviation right.
And about your questions:
1) The bytecode compiler is used when the engine loads QVM files. It simply takes the platform-independent QVM data and turns them into CPU-usable instructions. It's still a bit less effective than using a native dynamically linked library but a lot better than interpreting each QVM instruction on the fly (which is the only option if you don't have a working bytecode compiler for your platform). It has nothing to do with rendering, it just affects how fast the game code itself runs. Lower framerates are caused by higher CPU usage during game code execution.
2) John Carmack did replace a lot of standard functions with his own stuff that runs faster (the sqrt() function is a perfect example). However, I'm not sure whether he replaced OpenGL stuff as well or not. You should ask ioq3 people about that.
-
Tomek-k, you seem obnoxious, arrogant and ignorant, i dont feel inclined to attempt to answer your question
:o :-?
Anyway thx for the link :wink:
Also thx for other answers