Doom 3 engine release and game code
Moderator: InsideQC Admins
Re: Doom 3 engine release and game code
Looks like it works well. But at the moment I can't speak about performance, my laptop is stuck in "power save" mode. 
-
qbism - Posts: 1236
- Joined: Thu Nov 04, 2004 5:51 am
Re: Doom 3 engine release and game code
Stuck in powersave
Performance wise it should be the same if not a little faster (better optimization in some parts of the code).
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
https://github.com/revelator/Revelator-Doom3
Comitted all changes.
Maybe better to just download the repo as the changes make the patch pretty freaking huge :S
Comitted all changes.
Maybe better to just download the repo as the changes make the patch pretty freaking huge :S
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
Forgot to mention i made wrapper executables for doom3 doom3 resurrection of evil including sikkmod and doom3 in hell.
Sikkmod's game code is also included in the neo\sikkmod folder. To use it just replace the files in neo with the ones in the sikkmod folder.
Remember to backup the old files so you can go back.
Im filtering out portalsky for ssao and it fixes someof the bugs the ssao mod has but i probably need to include heathaze and a few other things to make it look just right.
Sikkmod's game code is also included in the neo\sikkmod folder. To use it just replace the files in neo with the ones in the sikkmod folder.
Remember to backup the old files so you can go back.
Im filtering out portalsky for ssao and it fixes someof the bugs the ssao mod has but i probably need to include heathaze and a few other things to make it look just right.
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
Having a deep hard look at xreals render code and its kinda close to the doom3 renderer but its fully glsl
still have to port it to C++ but i bet if someone got that far
it would make for a nice upgrade. Only problem is that it would be 100% incompatible with Doom3's arb shaders ouch :S.
Best bet is to keep the old backend for compatibility atleast untill theres a full set of shaders for the xreal render backend.
it would make for a nice upgrade. Only problem is that it would be 100% incompatible with Doom3's arb shaders ouch :S.
Best bet is to keep the old backend for compatibility atleast untill theres a full set of shaders for the xreal render backend.
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 wonder if mh would like to add D3D rendering path into id Tech 4 ? 
- motorsep
- Posts: 231
- Joined: Wed Aug 02, 2006 11:46 pm
- Location: Texas, USA
Re: Doom 3 engine release and game code
Cant say but maybe 
Btw i tried the small codepice for vertex buffering function here.
Seems to work fine but not really noticing any speedup :/ though i guess thats why he mentioned that it needed a total rewrite.
Edit: heres the missing #define
// let's not have code stretching 4 miles across the screen
#define BUFFER_MAP_BITS (GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT | GL_MAP_INVALIDATE_BUFFER_BIT)
just yank it somewhere at the top of VertexCache.cpp
Btw i tried the small codepice for vertex buffering function here.
- Code: Select all
vertCache_t *idVertexCache::AllocFrameTemp( void *data, int size )
{
vertCache_t *block;
if ( size <= 0 )
{
common->Error( "idVertexCache::AllocFrameTemp: size = %i\n", size );
}
if ( dynamicAllocThisFrame + size > frameBytes )
{
// if we don't have enough room in the temp block, allocate a static block,
// but immediately free it so it will get freed at the next frame
tempOverflow = true;
Alloc( data, size, &block );
Free( block);
return block;
}
// this data is just going on the shared dynamic list
// if we don't have any remaining unused headers, allocate some more
if ( freeDynamicHeaders.next == &freeDynamicHeaders )
{
for ( int i = 0; i < EXPAND_HEADERS; i++ )
{
block = headerAllocator.Alloc();
block->next = freeDynamicHeaders.next;
block->prev = &freeDynamicHeaders;
block->next->prev = block;
block->prev->next = block;
}
}
// move it from the freeDynamicHeaders list to the dynamicHeaders list
block = freeDynamicHeaders.next;
block->next->prev = block->prev;
block->prev->next = block->next;
block->next = dynamicHeaders.next;
block->prev = &dynamicHeaders;
block->next->prev = block;
block->prev->next = block;
block->size = size;
block->tag = TAG_TEMP;
block->indexBuffer = false;
block->offset = dynamicAllocThisFrame;
dynamicAllocThisFrame += block->size;
dynamicCountThisFrame++;
block->user = NULL;
block->frameUsed = 0;
// copy the data
block->virtMem = tempBuffers[listNum]->virtMem;
block->vbo = tempBuffers[listNum]->vbo;
// mh code start
if ( block->vbo )
{
qglBindBufferARB (GL_ARRAY_BUFFER, block->vbo);
// use GL_ARB_map_buffer_range if availiable
if (glConfig.ARBMapBufferRangeAvailable)
{
void *dst = NULL;
if ((dst = qglMapBufferRange (GL_ARRAY_BUFFER, block->offset, (GLsizeiptr) size, BUFFER_MAP_BITS)) != NULL)
{
SIMDProcessor->Memcpy ((byte *) dst, data, size);
qglUnmapBufferARB (GL_ARRAY_BUFFER);
return block;
}
}
qglBufferSubDataARB (GL_ARRAY_BUFFER, block->offset, (GLsizeiptr) size, data);
return block;
}
// fall through to the temp buffer ?
SIMDProcessor->Memcpy ((byte *) block->virtMem + block->offset, data, size);
return block;
// mh code end
}
Seems to work fine but not really noticing any speedup :/ though i guess thats why he mentioned that it needed a total rewrite.
Edit: heres the missing #define
// let's not have code stretching 4 miles across the screen
#define BUFFER_MAP_BITS (GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT | GL_MAP_INVALIDATE_BUFFER_BIT)
just yank it somewhere at the top of VertexCache.cpp
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
What's with doom3world.org ? I can't get to it :/
- motorsep
- Posts: 231
- Joined: Wed Aug 02, 2006 11:46 pm
- Location: Texas, USA
Re: Doom 3 engine release and game code
Aye same here :/ seems the site is down for maintainance i guess.
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
Hmm still down :S wonder whats happened
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
Ok is back up 
And some updates to my code.
Removed deprecated functions light and specular caches (engine now requires vertex or fragment programs).
Upped to OpenGL3 requirement.
removed old slow virtualmem stuff from renderer everything is now handled with VBO's.
Fixed a number of functions which had some or the other defect according to pvs-studio.
Added mh's glMapBufferRange optimization (might need some more work in other places but atleast it does not break anything).
Upped a number of settings in the autodetect routine like LOD bias -3 for ultra (makes a huge difference in detail).
Fixed some NULL on int mistakes (int is 0 not NULL).
Added a number of missing detructors and fixed a few to delete[] on arrays.
Replaced a number of strlen(somestring) == 0 to somestring[0] == 0 for speed.
Ill upload changes later
And some updates to my code.
Removed deprecated functions light and specular caches (engine now requires vertex or fragment programs).
Upped to OpenGL3 requirement.
removed old slow virtualmem stuff from renderer everything is now handled with VBO's.
Fixed a number of functions which had some or the other defect according to pvs-studio.
Added mh's glMapBufferRange optimization (might need some more work in other places but atleast it does not break anything).
Upped a number of settings in the autodetect routine like LOD bias -3 for ultra (makes a huge difference in detail).
Fixed some NULL on int mistakes (int is 0 not NULL).
Added a number of missing detructors and fixed a few to delete[] on arrays.
Replaced a number of strlen(somestring) == 0 to somestring[0] == 0 for speed.
Ill upload changes later
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:Replaced a number of strlen(somestring) == 0 to somestring[0] == 0 for speed.
Did you really get any speed improvement from that?
Just admit you did it for programming aesthetics
- andrewj
- Posts: 133
- Joined: Mon Aug 30, 2010 3:29 pm
- Location: Australia
Re: Doom 3 engine release and game code
If it's in a loop, then yes, it will make a difference. Why test 2+ chars (with loop and maybe function call overhead) when one is enough?
Leave others their otherness.
http://quakeforge.net/
http://quakeforge.net/
- taniwha
- Posts: 399
- Joined: Thu Jan 14, 2010 7:11 am
Re: Doom 3 engine release and game code
Noticed a slight speedup but nothing earthshattering
biggest hurdle atm seems to be the vbo code (needs some optimizing badly).
Btw anyone noticed the r_vertexbuffermegs cvar ? i had kindof a chuckle from reading that setting it higher would speedup the game
the sad thing is that the block that should handle the memory amount set with this is disabled in code and it was unfinished so it newer worked lol.
I i tried removing it completely and no change at all xD Doom3 works just as before.
btw its somestring[0] == '\0' forgot the '\'
Btw anyone noticed the r_vertexbuffermegs cvar ? i had kindof a chuckle from reading that setting it higher would speedup the game
the sad thing is that the block that should handle the memory amount set with this is disabled in code and it was unfinished so it newer worked lol.
I i tried removing it completely and no change at all xD Doom3 works just as before.
btw its somestring[0] == '\0' forgot the '\'
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
other stuff pvs studio says might speed it up are using & on arrays unfortunatly that does not work atleast not with msvc idvec3 &somearray will not compute.
Productivity is a state of mind.
-

revelator - Posts: 2567
- Joined: Thu Jan 24, 2008 12:04 pm
- Location: inside tha debugger
Who is online
Users browsing this forum: No registered users and 1 guest