Doom 3 engine release and game code
Moderator: InsideQC Admins
Re: Doom 3 engine release and game code
hmm with all the different types and methods out there for doing the same thing without copying there part i wonder ... so the khronos group's own example for doing it might actually tread on copyrighted grounds
had to do some guess work with your codepiece as the qglStencilOpSeparate seems to be an ATI extention i tried with standard two sided stencil but it needs some work.
its CT_TWO_SIDED when comming in here so face culling is off untill it hits this function.
had to do some guess work with your codepiece as the qglStencilOpSeparate seems to be an ATI extention i tried with standard two sided stencil but it needs some work.
- Code: Select all
if (external)
{
glDepthFunc (GL_LEQUAL);
glEnable (GL_STENCIL_TEST_TWO_SIDE_EXT);
// view outside the shadow volume
qglActiveStencilFaceEXT(GL_BACK);
qglStencilOp(GL_KEEP, tr.stencilIncr, tr.stencilIncr);
qglStencilFunc(GL_ALWAYS, 0, ~0);
// does the same as the GL_TwoSidedStencil functions part when checking for cull face.
GL_Cull( CT_BACK_SIDED );
qglActiveStencilFaceEXT(GL_FRONT);
qglStencilOp(GL_KEEP, tr.stencilDecr, tr.stencilDecr);
qglStencilFunc(GL_ALWAYS, 0, ~0);
// does the same as the GL_TwoSidedStencil functions part when checking for cull face.
GL_Cull( CT_FRONT_SIDED );
RB_DrawShadowElementsWithCounters (tri, numIndexes);
glDisable (GL_STENCIL_TEST_TWO_SIDE_EXT);
}
else
{
glDepthFunc (GL_GEQUAL);
glEnable (GL_STENCIL_TEST_TWO_SIDE_EXT);
// view inside the shadow volume
qglActiveStencilFaceEXT(GL_BACK);
qglStencilOp(GL_KEEP, tr.stencilDecr, tr.stencilDecr);
qglStencilFunc(GL_ALWAYS, 0, ~0);
// does the same as the GL_TwoSidedStencil functions part when checking for cull face.
GL_Cull( CT_FRONT_SIDED );
qglActiveStencilFaceEXT(GL_FRONT);
qglStencilOp(GL_KEEP, tr.stencilIncr, tr.stencilIncr);
qglStencilFunc(GL_ALWAYS, 0, ~0);
// does the same as the GL_TwoSidedStencil functions part when checking for cull face.
GL_Cull( CT_BACK_SIDED );
RB_DrawShadowElementsWithCounters (tri, numIndexes);
glDisable (GL_STENCIL_TEST_TWO_SIDE_EXT);
}
its CT_TWO_SIDED when comming in here so face culling is off untill it hits this function.
Productivity is a state of mind.
-

revelator - Posts: 2567
- Joined: Thu Jan 24, 2008 12:04 pm
- Location: inside tha debugger
Re: Doom 3 engine release and game code
hehe that might come in handy 
Productivity is a state of mind.
-

revelator - Posts: 2567
- Joined: Thu Jan 24, 2008 12:04 pm
- Location: inside tha debugger
Re: Doom 3 engine release and game code
reckless wrote:qglStencilOpSeparate seems to be an ATI extention
Not if you've got OpenGL 2.0 or better, it's not even an extension in this case. You can just get the function pointer and use it.
- Code: Select all
glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC) GLimp_ExtensionPointer ("glStencilOpSeparate");
if (glStencilOpSeparate)
{
// do stuff...
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
-

mh - Posts: 2292
- Joined: Sat Jan 12, 2008 1:38 am
Re: Doom 3 engine release and game code
ok game crashes when using this atm which is imo weird since my card is opengl 4.1 capable :/ ill try again tomorrow.
the twosided version works but produces huge shadows (i think i need to turn of the last part of the old stencil code whoops).
ongoing work on widescreen formats and doing away with low res modes like 320x200 (heh ye its actually possible). lowest supported res will be 800x600 and upto the largest supported resolution today.
the twosided version works but produces huge shadows (i think i need to turn of the last part of the old stencil code whoops).
ongoing work on widescreen formats and doing away with low res modes like 320x200 (heh ye its actually possible). lowest supported res will be 800x600 and upto the largest supported resolution today.
Productivity is a state of mind.
-

revelator - Posts: 2567
- Joined: Thu Jan 24, 2008 12:04 pm
- Location: inside tha debugger
Re: Doom 3 engine release and game code
I don't see the point of dropping low res. The FX5200 actually benefits alot from 320x240 in idtech4...
i should not be here
- leileilol
- Posts: 2783
- Joined: Fri Oct 15, 2004 3:23 am
Re: Doom 3 engine release and game code
Damn AND i just gave my fx5200 to the garbage man to use as a wedge to get the dumpster door open! Grr....
that card sucks more arse than a liposuction machine!
that card sucks more arse than a liposuction machine!
- r00k
- Posts: 1110
- Joined: Sat Nov 13, 2004 10:39 pm
Re: Doom 3 engine release and game code
Don't underestimate the large amount of self-entitled openBSD/freeBSD users that can't get a proper accelerated driver or even use modern video hardware
i should not be here
- leileilol
- Posts: 2783
- Joined: Fri Oct 15, 2004 3:23 am
Re: Doom 3 engine release and game code
mh wrote:Not if you've got OpenGL 2.0 or better, it's not even an extension in this case.
qglDisable(GL_CULL_FACE);
qglStencilOpSeparate(GL_BACK, GL_KEEP, GL_INCR_WRAP_EXT, GL_KEEP);
qglStencilOpSeparate(GL_FRONT, GL_KEEP, GL_DECR_WRAP_EXT, GL_KEEP);
RB_DrawShadowElementsWithCounters (tri, numIndexes);
qglEnable(GL_CULL_FACE);
-

Barnes - Posts: 226
- Joined: Thu Dec 24, 2009 2:26 pm
- Location: Russia, Moscow
Re: Doom 3 engine release and game code
There are downsides to ripping out stuff that was originally there for a reason.
For example the built-in editor's functionality is much better than standard Radiant. Anyone who makes Doom3 maps is going to use that editor. To be clear, GTK/Netradiant do NOT make the built in editor obsolete. If you rip it out, perhaps consider releasing a standalone Doom3 editor?
And why should people not run Doom3 in 640x480 windowed?
For example the built-in editor's functionality is much better than standard Radiant. Anyone who makes Doom3 maps is going to use that editor. To be clear, GTK/Netradiant do NOT make the built in editor obsolete. If you rip it out, perhaps consider releasing a standalone Doom3 editor?
And why should people not run Doom3 in 640x480 windowed?
-

goldenboy - Posts: 924
- Joined: Fri Sep 05, 2008 11:04 pm
- Location: Kiel
Re: Doom 3 engine release and game code
Barnes wrote:mh wrote:Not if you've got OpenGL 2.0 or better, it's not even an extension in this case.
qglDisable(GL_CULL_FACE);
qglStencilOpSeparate(GL_BACK, GL_KEEP, GL_INCR_WRAP_EXT, GL_KEEP);
qglStencilOpSeparate(GL_FRONT, GL_KEEP, GL_DECR_WRAP_EXT, GL_KEEP);
RB_DrawShadowElementsWithCounters (tri, numIndexes);
qglEnable(GL_CULL_FACE);
That's the one.
The original used standard depth pass for cases where the view wasn't inside the volume (so that it could skip drawing the caps) so you need a test for that too, and you also need to flip the front and back faces if it's a mirror view.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
-

mh - Posts: 2292
- Joined: Sat Jan 12, 2008 1:38 am
Re: Doom 3 engine release and game code
a schematic representation of the z-fail volumes (with caps)
z-pass (w/o caps) if i current remember
qglStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_INCR_WRAP_EXT);
qglStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_DECR_WRAP_EXT);
z-pass (w/o caps) if i current remember
qglStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_INCR_WRAP_EXT);
qglStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_DECR_WRAP_EXT);
-

Barnes - Posts: 226
- Joined: Thu Dec 24, 2009 2:26 pm
- Location: Russia, Moscow
Re: Doom 3 engine release and game code
goldenboy wrote:There are downsides to ripping out stuff that was originally there for a reason.
For example the built-in editor's functionality is much better than standard Radiant. Anyone who makes Doom3 maps is going to use that editor. To be clear, GTK/Netradiant do NOT make the built in editor obsolete. If you rip it out, perhaps consider releasing a standalone Doom3 editor?
And why should people not run Doom3 in 640x480 windowed?
I know quite a few mappers have used our Dark Radiant to build D3 maps rather than D3Edit, but then again Dark Radiant has been heavily rewritten compared to what it was when we started working with the old GTK Radiant source code. It's a completely different beast now.
- New Horizon
- Posts: 6
- Joined: Sat Nov 26, 2011 3:24 am
Re: Doom 3 engine release and game code
- Code: Select all
if (external)
{
qglDepthFunc (GL_LEQUAL);
// view outside the shadow volume
qglStencilOpSeparate (backEnd.viewDef->isMirror ? GL_FRONT : GL_BACK, GL_KEEP, GL_KEEP, tr.stencilIncr);
qglStencilOpSeparate (backEnd.viewDef->isMirror ? GL_BACK : GL_FRONT, GL_KEEP, GL_KEEP, tr.stencilDecr);
RB_DrawShadowElementsWithCounters (tri, numIndexes);
}
else
{
qglDepthFunc (GL_GEQUAL);
// view inside the shadow volume
qglStencilOpSeparate (backEnd.viewDef->isMirror ? GL_FRONT : GL_BACK, GL_KEEP, GL_KEEP, tr.stencilDecr);
qglStencilOpSeparate (backEnd.viewDef->isMirror ? GL_BACK : GL_FRONT, GL_KEEP, GL_KEEP, tr.stencilIncr);
RB_DrawShadowElementsWithCounters (tri, numIndexes);
}
was the latest i tried before going to bed.
in regards to ripping out low res modes i could easily leave them in but i doubted anyone with recent hardware would see them as anything but an annoyance if thats not the case ill just leave them and then addd high res modes.
Productivity is a state of mind.
-

revelator - Posts: 2567
- Joined: Thu Jan 24, 2008 12:04 pm
- Location: inside tha debugger
Re: Doom 3 engine release and game code
Is already possible to compile doom3 under Linux? And if yes, how? Little tutorial for newbiez? t*h*a*n*k*s! 
Meadow Fun!! - my first commercial game, made with FTEQW game engine
- toneddu2000
- Posts: 1352
- Joined: Tue Feb 24, 2009 4:39 pm
- Location: Italy
Re: Doom 3 engine release and game code
Instructions are in the Readme. I can't say any more as I don't use Linux.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
-

mh - Posts: 2292
- Joined: Sat Jan 12, 2008 1:38 am
Who is online
Users browsing this forum: No registered users and 1 guest