Page 53 of 53

Re: Doom 3 engine release and game code

Posted: Wed Feb 05, 2014 5:20 pm
by revelator
Nice work raynor :) been dabbling on off with it forever but newer quite got it working correctly.

Re: Doom 3 engine release and game code

Posted: Tue Feb 18, 2014 3:41 am
by nbohr1more
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? :)

Re: Doom 3 engine release and game code

Posted: Tue Feb 18, 2014 4:40 am
by revelator
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 :)

Re: Doom 3 engine release and game code

Posted: Tue Feb 18, 2014 10:18 am
by raynorpat
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

Re: Doom 3 engine release and game code

Posted: Tue Feb 18, 2014 4:00 pm
by revelator
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.

Re: Doom 3 engine release and game code

Posted: Sat Apr 05, 2014 11:12 pm
by anonreclaimer
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?

Re: Doom 3 engine release and game code

Posted: Mon Apr 07, 2014 4:51 am
by revelator
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.

Re: Doom 3 engine release and game code

Posted: Fri Jun 06, 2014 1:37 am
by nbohr1more
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?

Re: Doom 3 engine release and game code

Posted: Fri Jun 06, 2014 1:59 am
by revelator
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 :(

Re: Doom 3 engine release and game code

Posted: Mon Jun 09, 2014 1:07 pm
by revelator
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.

Re: Doom 3 engine release and game code

Posted: Tue Jun 17, 2014 1:55 am
by motorsep
Storm Engine 2 video is up: check this out: https://www.youtube.com/watch?v=0r-SOxXFM3c

Re: Doom 3 engine release and game code

Posted: Tue Jun 17, 2014 6:38 pm
by toneddu2000
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! ;)

Re: Doom 3 engine release and game code

Posted: Tue Jun 17, 2014 10:12 pm
by motorsep
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.

Re: Doom 3 engine release and game code

Posted: Tue Jun 17, 2014 10:42 pm
by toneddu2000
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

Re: Doom 3 engine release and game code

Posted: Tue Jun 17, 2014 10:54 pm
by motorsep
Well, for once I am no programmer. Also comments are scarce in that code.