Forum

Doom 3 engine release and game code

Discuss programming topics for any language, any source base. If it is programming related but doesn't fit in one of the below categories, it goes here.

Moderator: InsideQC Admins

Re: Doom 3 engine release and game code

Postby revelator » Wed Feb 05, 2014 5:20 pm

Nice work raynor :) been dabbling on off with it forever but newer quite got it working correctly.
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2527
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Doom 3 engine release and game code

Postby nbohr1more » Tue Feb 18, 2014 3:41 am

raynorpat wrote:Mini-bump

Got most of the BFG GLSL backend merged into standard Doom 3.

https://github.com/raynorpat/morpheus

It won't work on integrated Intel GPUs just yet, I think Intel's compatibility context is being ass, but should work once most of the deprecated calls go away and the compatibility context is migrated to a core OpenGL context.


Great stuff.

Are you going to get BFG style GPU Skinning working too?

GPU mesh deforms? :)
nbohr1more
 
Posts: 54
Joined: Fri Dec 09, 2011 7:04 am

Re: Doom 3 engine release and game code

Postby revelator » Tue Feb 18, 2014 4:40 am

Compiles fine but crashes instantly when i load the exe ?.

I noticed that you where in Progress of porting it to SDL2 as well though its not used atm, dhewm3 should be helpfull getting that part working.

Looked over the loaded glsl scripts an so far all but the gui stuff and splitscreen is used, i scratched my head a bit about it not using the glsl shaders in materials (its a 4 line change and its the only part of the code in bfg that differs there) Work in Progress maybe ?.

Atleast good that someone finally got around to try out this approach :)
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2527
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Doom 3 engine release and game code

Postby raynorpat » Tue Feb 18, 2014 10:18 am

nbohr1more wrote:Are you going to get BFG style GPU Skinning working too?

GPU mesh deforms? :)


I doubt it. Would be too much of a drastic change for now.

reckless wrote:Compiles fine but crashes instantly when i load the exe ?.


It will flatout run refuse to run on anything intel-related so far. Radeons have a 50-50 chance of working. Mostly because the BFG shaders were written with the OpenGL core context in mind, not the compatibility context. Still need to finish that part up.

Got most of the SDL2 port up and running from the dhewm3 fork. If you could be so kind as to pastebin your stdout.txt file, you should be able to see where in the init process your crashing at
raynorpat
 
Posts: 27
Joined: Tue Feb 26, 2008 12:21 am
Location: USA

Re: Doom 3 engine release and game code

Postby revelator » Tue Feb 18, 2014 4:00 pm

Not using Intel gfx :) i got 2 AMD R9 270X toxic and BFG runs fine on them if i rename them to something else, but maybe something snuck up.

Ill tinker a bit with it, if i get it running on those Cards ill post patches.
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2527
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Doom 3 engine release and game code

Postby anonreclaimer » Sat Apr 05, 2014 11:12 pm

reckless wrote:Not using Intel gfx :) i got 2 AMD R9 270X toxic and BFG runs fine on them if i rename them to something else, but maybe something snuck up.

Ill tinker a bit with it, if i get it running on those Cards ill post patches.


reckless did raynorpat glsl backend ever work for you?
anonreclaimer
 
Posts: 21
Joined: Tue Aug 28, 2012 4:36 am

Re: Doom 3 engine release and game code

Postby revelator » Mon Apr 07, 2014 4:51 am

Not the first versions no but he did some more Work on them i noticed.
Sadly i havent had time to check out the new sources.
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2527
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Doom 3 engine release and game code

Postby nbohr1more » Fri Jun 06, 2014 1:37 am

raynorpat wrote:Mini-bump

Got most of the BFG GLSL backend merged into standard Doom 3.

https://github.com/raynorpat/morpheus

It won't work on integrated Intel GPUs just yet, I think Intel's compatibility context is being ass, but should work once most of the deprecated calls go away and the compatibility context is migrated to a core OpenGL context.


How does this compare to:

https://github.com/revelator/MHDoom

?

Perhaps those folks should merge your changes?
nbohr1more
 
Posts: 54
Joined: Fri Dec 09, 2011 7:04 am

Re: Doom 3 engine release and game code

Postby revelator » Fri Jun 06, 2014 1:59 am

been toying a bit with it but it flat out refuses to work on my radeons :S instant crash.

code looks pretty solid though so not sure where it goes boom. Debugger not being to helpfull unfortunatly :(
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2527
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Doom 3 engine release and game code

Postby revelator » Mon Jun 09, 2014 1:07 pm

Compared the BFG code with Morpheus and it seems morpheus only intends to use the interaction shaders.
Moving the rest of the shader functionality would be a hefty chunk o work and not all of them would work.

For instance BFG moved matrix calculations to GLSL vanilla does it the old way by getting them from OpenGL itself.
Bink shaders are not needed on vanilla.
there are also a few other shaders that might need a heavy rewrite of the renderer before they work, some seem related to stereo rendering ???.

The shader lookup portion is pretty straight forward just replace all the old find arb program calls with the corresponding GLSL calls.
And then it gets hairy ... some functions like glasswarp have been removed and draw_common.cpp would need a rather hefty rewrite before it could use the GLSL functions for things like shadows etc.

Its doable though but im not up for the task without help.

I did perfect GLEW integration with vanilla though :) both WGL and GL functions work perfectly now.

these are the sad remnants of a once massive win_qgl.cpp

Code: Select all
/*
===========================================================================

Doom 3 GPL Source Code
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.

This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).

Doom 3 Source Code is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Doom 3 Source Code is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Doom 3 Source Code.  If not, see <http://www.gnu.org/licenses/>.

In addition, the Doom 3 Source Code is also subject to certain additional terms.
You should have received a copy of these additional terms immediately following
 the terms and conditions of the GNU General Public License which accompanied the
Doom 3 Source Code.  If not, please request a copy in writing from id Software
at the address below.

If you have questions concerning this license or the applicable additional terms,
you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120,
Rockville, Maryland 20850 USA.

===========================================================================
*/

#include "precompiled.h"
#include "win_local.h"
#include "../../renderer/tr_local.h"

void QGL_Shutdown( void )
{
   common->Printf( "...shutting down QGL\n" );
   
   if( win32.hinstOpenGL )
   {
      common->Printf( "...unloading OpenGL DLL\n" );
      FreeLibrary( win32.hinstOpenGL );
   }
   win32.hinstOpenGL = 0;
}

bool QGL_Init( const char *dllname )
{
   assert( win32.hinstOpenGL == 0 );
   
   common->Printf( "...initializing QGL\n" );
   common->Printf( "...calling LoadLibrary( '%s' ): ", dllname );
   
   // check that we loaded the correct OpenGL dll.
   if ( ( win32.hinstOpenGL = LoadLibrary( dllname ) ) != 0 )
   {
      GLenum err = glewInit();

      // Check if glew has been initialized properly,
      // and if not print out why.
      if ( err != GLEW_NO_ERROR || err != GLEW_OK )
      {         
         common->Printf( "GLEW failed %s!\n", glewGetErrorString( err ) );
         return false;
      }
      common->Printf( "Using OpenGL driver %s\n", dllname );
   }
   common->Printf( "Status: Using GLEW %s\n", glewGetString( GLEW_VERSION ) );
   
   return true;
}


And heres the function for finding WGL extentions

Code: Select all
/*
==================
GLW_GetWGLExtensionsWithFakeWindow

The Devil wrote this 666
==================
*/
void GLW_CheckWGLExtensions( HDC hDC )
{
   GLenum err = glewInit();

   // kinda stupid that glew needs to be initialized
   // for both standard gl and wgl extentions.
   if( err != GLEW_NO_ERROR || err != GLEW_OK )
   {
      common->Printf("WGLEW failed %s!\n", glewGetErrorString(err));
   }
   else
   {
      if (wglewIsSupported("WGL_ARB_extensions_string"))
      {
         common->Printf("...initializing WGL_ARB_extensions_string\n");
      }
      else
      {
         common->Printf("WGL_ARB_extensions_string returned %s!\n", glewGetErrorString(err));
      }

      if (wglewIsSupported("WGL_EXT_swap_control"))
      {
         common->Printf("...initializing WGL_EXT_swap_control\n");
      }
      else
      {
         common->Printf("WGL_EXT_swap_control returned %s!\n", glewGetErrorString(err));
      }

      if (wglewIsSupported("WGL_ARB_pixel_format"))
      {
         common->Printf("...initializing WGL_ARB_pixel_format\n");
      }
      else
      {
         common->Printf("WGL_ARB_pixel_format returned %s!\n", glewGetErrorString(err));
      }

      if (wglewIsSupported("WGL_ARB_pbuffer"))
      {
         common->Printf("...initializing WGL_ARB_pbuffer\n");
      }
      else
      {
         common->Printf("WGL_ARB_pbuffer returned %s!\n", glewGetErrorString(err));
      }

      if (wglewIsSupported("WGL_ARB_render_texture"))
      {
         common->Printf("...initializing WGL_ARB_render_texture\n");
      }
      else
      {
         common->Printf("WGL_ARB_render_texture returned %s!\n", glewGetErrorString(err));
      }
   }
}


Kinda odd though that both need to initialize GLEW before they work Oo.
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2527
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Doom 3 engine release and game code

Postby motorsep » Tue Jun 17, 2014 1:55 am

Storm Engine 2 video is up: check this out: https://www.youtube.com/watch?v=0r-SOxXFM3c
motorsep
 
Posts: 231
Joined: Wed Aug 02, 2006 11:46 pm
Location: Texas, USA

Re: Doom 3 engine release and game code

Postby toneddu2000 » Tue Jun 17, 2014 6:38 pm

SuperCool motorsep! I'm glad you're still working on Storm Engine 2! All the best and keep up the great work! I imagine that rebuilding Flash UI should have been a HUGE amount of work!

@reckless. I think motorsep could lighten few of your doubts: first AMD bug and second the debugger! ;)
toneddu2000
 
Posts: 1305
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: Doom 3 engine release and game code

Postby motorsep » Tue Jun 17, 2014 10:12 pm

toneddu2000 wrote:SuperCool motorsep! I'm glad you're still working on Storm Engine 2! All the best and keep up the great work! I imagine that rebuilding Flash UI should have been a HUGE amount of work!


Thanks. Yeah, it took me 6 month or so to crack down on Flash.
motorsep
 
Posts: 231
Joined: Wed Aug 02, 2006 11:46 pm
Location: Texas, USA

Re: Doom 3 engine release and game code

Postby toneddu2000 » Tue Jun 17, 2014 10:42 pm

Thanks. Yeah, it took me 6 month or so to crack down on Flash.

wow. I never imagined was so hard. I really liked the shadow projection too! Very realistic
toneddu2000
 
Posts: 1305
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: Doom 3 engine release and game code

Postby motorsep » Tue Jun 17, 2014 10:54 pm

Well, for once I am no programmer. Also comments are scarce in that code.
motorsep
 
Posts: 231
Joined: Wed Aug 02, 2006 11:46 pm
Location: Texas, USA

Previous

Return to General Programming

Who is online

Users browsing this forum: No registered users and 1 guest