Torque3D OpenGL Status
by Luis Anton Rebollo · in Torque 3D Professional · 02/24/2013 (1:33 pm) · 175 replies
I am working with BeamNG in port Torque3D to OpenGL. When finished there will be a merge with GG repository.
I will be updating this thread at least once a week.
Repository: Github.com/BeamNG/Torque3D/tree/dev_linux_opengl
* On Windows you need to check TORQUE_OPENGL option.
The problems of speed it was a few months ago were due to drivers. Sounds like a good OpenGL performance is linked to new cards/drivers. NVidia of Kepler architectures (Geforce 600-700) not sure on AMD.
I appreciate any donation to help the project.
.




I will be updating this thread at least once a week.
Repository: Github.com/BeamNG/Torque3D/tree/dev_linux_opengl
Status:
- Is a research & learn branch, lots of unfinised and ugly code. It will check and clean all code before repo merge with GG
- Basic Lighting & Advanced Lighting render correctly (more or less) all effects.
- There may be errors or differences with other implementations of OpenGL. They will be corrected later.
- No Oculus rift port to glsl.
How to compile:
* Use this manual.* On Windows you need to check TORQUE_OPENGL option.
Reporting bugs:
If possible, Github is a great place to post issues to a forum.Torque 3D Version:
This branch is based on Torque3D 3.5 development.OpenGL performance:
I check the code in a new Gerforce 750ti and T3D works just as fast in Opengl/Directx9.The problems of speed it was a few months ago were due to drivers. Sounds like a good OpenGL performance is linked to new cards/drivers. NVidia of Kepler architectures (Geforce 600-700) not sure on AMD.
I appreciate any donation to help the project.
.



About the author
I'm working on a port of Torque3D to OpenGL and Linux/SteamOS
#42
Thanks again for the update AGAIN you are awesome luis. I am sure that your openGL port will be encouragement for mac and Linux users, as well us the windows fanbase that doesn't like Dx9
12/04/2013 (1:33 pm)
Please do stick with glsl and hlsl please. Thanks again for the update AGAIN you are awesome luis. I am sure that your openGL port will be encouragement for mac and Linux users, as well us the windows fanbase that doesn't like Dx9
#43
12/04/2013 (1:47 pm)
Looks like it's mostly knocked out at this point. Put the material system through it's paces, and only observed cubemaped mats not showing, and the colorpicker dialogue being red and black. (Haven't had time to attempt a 3.5 merge yet.)
#44
I will spend part of the time on porting more effects to OpenGL. Possibly tomorrow uploads a new update to github.
Thanks to the donations I can devote more time to the project and speedup development.
12/05/2013 (9:23 am)
Thanks to the donators I can spend one more day to the project.I will spend part of the time on porting more effects to OpenGL. Possibly tomorrow uploads a new update to github.
Thanks to the donations I can devote more time to the project and speedup development.
#45
Updated header post and Github project wiki
First of all thank you for the time you have dedicated to test and report an issue.
I would like to remember that you can use OpenGL on Windows if you want to try the brach.
If you report an issue, please include the following information:
12/06/2013 (5:04 am)
A new update on Gitgub:github.com/LuisAntonRebollo/Torque3D/tree/dev_linux_opengl- OpenGL: ShaderGen fixes
- OpenGL: ShaderData BasicCloudsShader and CloudLayerShader, check HLSL and port to OpenGL/GLSL
- OpenGL: port to OpenGL/GLSL foliage.glsl file
- OpenGL: Allow ShaderGen GLSL to simulate IN STRUCT on procedural vertex shader, similar to HLSL.
Updated header post and Github project wiki
First of all thank you for the time you have dedicated to test and report an issue.
I would like to remember that you can use OpenGL on Windows if you want to try the brach.
Reporting issues
If possible, Github is a great place to post issues.If you report an issue, please include the following information:
- SO with number version and 32/64bit.
- Graphic card and driver version.
- Add the appropriate Tags.
- Explanation on how to reproduce the issue.
- If errors in console log, include a copy of console.log.
- If visual errors, include a screenshot.
- If errors on compilation:
- Compiler and version.
- Fullpath for Torque3D instalation.
- Include link to archive with project files (makefiles or Code::Blocks).
- A log with errors during compiler.
#46
12/11/2013 (6:18 am)
New updage on Github github.com/LuisAntonRebollo/Torque3D/tree/dev_linux_opengl:- OpenGL: Some small GLSL fixes.
- OpenGL: PostEffect( BL_ShadowFilterPostFx ) check HLSL and port to OpenGL/GLSL
- OpenGL: ShaderData( ScatterSkyShaderData ) check HLSL and port to OpenGL/GLSL
- OpenGL: ShaderData don't need to define rtParams (samplerNames[N] are linked to rtParamsN)
- Undo changes on PostEffect declarations. Now ShaderData are used for get sampler names.
#47
you might wanna take a look at regal a opensource OpenGL compatibility layer which targets iOS and Android platforms, and a couple of others.
github.com/p3/regal/
this could eventually path the way for ios/android
anyways keep up the great work
12/12/2013 (4:20 pm)
@Luisyou might wanna take a look at regal a opensource OpenGL compatibility layer which targets iOS and Android platforms, and a couple of others.
github.com/p3/regal/
this could eventually path the way for ios/android
anyways keep up the great work
#48
I want to finish the port OpenGL this month and start Torque3D upgrade to 3.5 in January.
I'm also working on the performance branch (need a lot of work), possibly within weeks write a blog explaining the project status.
12/16/2013 (4:32 am)
@J0linar, seems like an interesting option. I'll have to make time next year, for a port to android.I want to finish the port OpenGL this month and start Torque3D upgrade to 3.5 in January.
I'm also working on the performance branch (need a lot of work), possibly within weeks write a blog explaining the project status.
#49
Ahsan might be interested aswell - maybe even some others from the community? or outside of it ;)
and if we can support you in this endeavour, we will do for sure!
Regarding the port to 3.5, thanks for doing it especially since its holliday season, i imagine it will be much easier to get
some stuff done when its ported to 3.5.
Thanks
12/16/2013 (6:46 am)
Sounds great mate,Ahsan might be interested aswell - maybe even some others from the community? or outside of it ;)
and if we can support you in this endeavour, we will do for sure!
Regarding the port to 3.5, thanks for doing it especially since its holliday season, i imagine it will be much easier to get
some stuff done when its ported to 3.5.
Thanks
#50
12/16/2013 (12:38 pm)
@Luis - Just barely got around to reading your description. You have made me a very happy man. Linux/SteamOS FTW! Expect a donation soonish. :)
#51
I tried to get it compiled and run on FreeBSD as an dedicated sever. With some small quick hacks ( most for the libraries )it compiles fine.
I'am not sure but I think the dedicated build is broken in your source. It get an null pointer exception on PlatformWindowManager::get()->_processCmdLineArgs(argc, argv);
because CreatePlatformWindowManager returns NULL in x86UNIXStub.dedicated.cpp. First I thought it's because of my changes for freebsd but I get the same problem on linux.
greetings
tom
12/17/2013 (2:50 am)
Hello Luis amazing work :)I tried to get it compiled and run on FreeBSD as an dedicated sever. With some small quick hacks ( most for the libraries )it compiles fine.
I'am not sure but I think the dedicated build is broken in your source. It get an null pointer exception on PlatformWindowManager::get()->_processCmdLineArgs(argc, argv);
because CreatePlatformWindowManager returns NULL in x86UNIXStub.dedicated.cpp. First I thought it's because of my changes for freebsd but I get the same problem on linux.
greetings
tom
#52
@Benjamin, any help is greatly appreciated.
@Thomas, thx for test. Added a issue on github.
12/18/2013 (12:14 pm)
@J0linar, still have to wait a bit. But when the port is more solid, we need to advertise!!! :D@Benjamin, any help is greatly appreciated.
@Thomas, thx for test. Added a issue on github.
#53
I think in January and I can talk about a possible pull request.
In a few days will update the branch to T3D 3.5
New update on Github: github.com/LuisAntonRebollo/Torque3D/tree/dev_linux_opengl
12/20/2013 (7:55 pm)
Finally OpenGL renders all graphics effects.I think in January and I can talk about a possible pull request.
In a few days will update the branch to T3D 3.5
New update on Github: github.com/LuisAntonRebollo/Torque3D/tree/dev_linux_opengl
- OpenGL Fix: PostEffect::EffectConst::setToBuffer corrupt GFXShaderConstBuffer when EffectConst type are not implemented
- OpenGL: Add support for GL_ARB_texture_float and GL_ARB_half_float_pixel
- OpenGL: CustomMaterial( AL_SpotLightMaterial ) check HLSL and port to OpenGL/GLSL
- Assert ShaderData correct samplerNames declaration.
- OpenGL Change: GLSL PostEffect shader files include "PostFX.glsl" possible.
- OpenGL Fix: ParticlesShaderData / OffscreenParticleCompositeShaderData check HLSL and port to OpenGL/GLSL
- OpenGL Fix: PostEffect( LightRayPostFX ) check HLSL and port to OpenGL/GLSL
- OpenGL Fix: PostEffect( FlashFx ) check HLSL and port to OpenGL/GLSL
- OpenGL Fix: PostEffect( ChromaticLensPostFX ) check HLSL and port to OpenGL/GLSL
- OpenGL Fix: PostEffect( EdgeAAPostEffect ) check HLSL and port to OpenGL/GLSL
- OpenGL Fix: PostEffect( CausticsPFX ) check HLSL and port to OpenGL/GLSL
- OpenGL Fix: PostEffect( MotionBlurFX ) check HLSL and port to OpenGL/GLSL. (Too much blurry on openGL, need recheck)
- OpenGL Fix: PostEffect( MLAAFx ) check HLSL and port to OpenGL/GLSL
- OpenGL Fix: False assert on PostEffect::_checkRequirements()
- PostEffect for Oculus check HLSL. OpenGL/GLSL NOT FIXED
- OpenGL Fix: PostEffect( DOFPostEffect ) check HLSL and port to OpenGL/GLSL
- OpenGL: PostEffect( SSAOPostFx ) check HLSL and port to OpenGL/GLSL
- OpenGL Fix: ScatterSkyShaderData has no samplers defined
- OpenGL: Revert change on PostEffect
- HLSL: Revert changes.
- OpenGL: Shader samplers registers are in same order of ShaderData.
- OpenGL Fix: PostEffect::mEffectConsts are invalid after a shader reload.
- OpenGL: Increase number of samplers defined in ShaderData to 8.
- OpenGL Fix: Bug when shader has no uniforms.
- OpenGL: PostEffect( HDRPostFX ) check HLSL and port to OpenGL/GLSL.
- OpenGL: Fix some TORQUE_DEBUG_GFX in code.
#54
personally i would like to escape directx9 for more portability and improved graphics but dx9 is good for possible console porting too, did torque not previously advertise portability to xbox?
anyway, what version of OpenGL does this use?
12/20/2013 (10:45 pm)
well i'm excited about that, it would be nice if this had more support :)personally i would like to escape directx9 for more portability and improved graphics but dx9 is good for possible console porting too, did torque not previously advertise portability to xbox?
anyway, what version of OpenGL does this use?
#55
12/21/2013 (2:59 am)
I'll be getting Ubuntu on its own HDD when I get back from holidays, so I'll be trying to dive back into this, time permitting. Thanks for all your hard work on this - it's fantastic!
#56
ToDo for OpenGL:
I may not upload more code to Github until mid-January, but I will continue to work when I can.
@Billy, it is OpenGL 2.1 with extensions, this make easy a OpenGL ES2 port (Android/iOS)
We'll skip OpenGL 3 as many engines have do with DX10.
Later there will be a port to OpenGL 4.
@Daniel, If you have any problems you can send me a mail, I will try to help and solve the problems you have.
12/21/2013 (3:16 pm)
Branch updated to T3D 3.5: github.com/LuisAntonRebollo/Torque3D/tree/dev_linux_openglToDo for OpenGL:
- Implement instancing
- Port Oculus shaders
- Remove all OpenGL fixed function pipeline
- Clean an recheck all code changes
- Pull request/ Merge with GG
- Add GLEW
- Add support for some interesting extensions
- Resolve perfomance problems
I may not upload more code to Github until mid-January, but I will continue to work when I can.
@Billy, it is OpenGL 2.1 with extensions, this make easy a OpenGL ES2 port (Android/iOS)
We'll skip OpenGL 3 as many engines have do with DX10.
Later there will be a port to OpenGL 4.
@Daniel, If you have any problems you can send me a mail, I will try to help and solve the problems you have.
#57
I'm away from my regular computer visiting relatives for the holidays and I grabbed my macbook and decided to try compiling on OSX 10.9.1. I've tried Xcode 5 with LLVM compiler and Code::Blocks with GCC thinking LLVM was just being picky but both compilers are complaining about the same lines:
2535: return R( reinterpret_cast< FunctionType* >( mFn )( mThis ) );
2541: return R( reinterpret_cast< FunctionType* >( mFn )( mThis, a ) );
2547: return R( reinterpret_cast< FunctionType* >( mFn )( mThis, a, b ) );
The error in question:
../../../../../Engine/source/console/engineAPI.h|2547|error: reinterpret_cast from 'const void *' to 'FunctionType *' (aka 'void (*)(EngineObject *, const char *, const char *)') casts away qualifiers|
I'm hoping you may be able to shed some light on this as it's a bit over my head.
12/24/2013 (12:36 pm)
Hey Luis,I'm away from my regular computer visiting relatives for the holidays and I grabbed my macbook and decided to try compiling on OSX 10.9.1. I've tried Xcode 5 with LLVM compiler and Code::Blocks with GCC thinking LLVM was just being picky but both compilers are complaining about the same lines:
2535: return R( reinterpret_cast< FunctionType* >( mFn )( mThis ) );
2541: return R( reinterpret_cast< FunctionType* >( mFn )( mThis, a ) );
2547: return R( reinterpret_cast< FunctionType* >( mFn )( mThis, a, b ) );
The error in question:
../../../../../Engine/source/console/engineAPI.h|2547|error: reinterpret_cast from 'const void *' to 'FunctionType *' (aka 'void (*)(EngineObject *, const char *, const char *)') casts away qualifiers|
I'm hoping you may be able to shed some light on this as it's a bit over my head.
#58
From Working Draft, Standard for Programming Language C++ 11/2012
Try add a const_cast:
It seems a valid error, but I have not seen in Linux with gcc
12/25/2013 (3:33 am)
@Andrew, thx for testing on MacFrom Working Draft, Standard for Programming Language C++ 11/2012
Quote:
The reinterpret_cast operator shall not cast away constness
Try add a const_cast:
return R( reinterpret_cast< FunctionType* >( const_cast<void*>(mFn) )( mThis ) );
It seems a valid error, but I have not seen in Linux with gcc
#59
Rather than using const_cast you can also just stick (void*) before the mFn, e.g.
12/26/2013 (8:19 am)
@andrew,Rather than using const_cast you can also just stick (void*) before the mFn, e.g.
template< typename R, typename A, typename B, typename C, typename D, typename E, typename F >
R call( A a, B b, C c, D d, E e, F f ) const
{
typedef R( FunctionType )( EngineObject*, A, B, C, D, E, F );
return R( reinterpret_cast< FunctionType* >( (void*)mFn )( mThis, a, b, c, d, e, f ) );
}
#60
#if defined(TORQUE_OS_MAC)
# include <OpenAL/al.h>
# include <OpenAL/alc.h>
Both includes are not found. Nor are their alternatives. The OpenAL portion seems to have compiled fine, and produced OpenAL.framework which is referenced in the Xcode project with correct path. I'm definitely a fish out of water on this one, any assistance would be much appreciated, though I suspect this is a very mac/xcode-specific issue.
12/26/2013 (2:10 pm)
Okay, after correcting that I ran into a series of random issues with deprecated functions, etc. After correcting as many as I can I got stuck on the following:#if defined(TORQUE_OS_MAC)
# include <OpenAL/al.h>
# include <OpenAL/alc.h>
Both includes are not found. Nor are their alternatives. The OpenAL portion seems to have compiled fine, and produced OpenAL.framework which is referenced in the Xcode project with correct path. I'm definitely a fish out of water on this one, any assistance would be much appreciated, though I suspect this is a very mac/xcode-specific issue.
Torque 3D Owner Luis Anton Rebollo
@ahsan, change to CG it's a lot of work. It's preferible to finish the port with hlsl/glsl. Yes.
@Kyle, thank you very much for the log. It has helped me a lot.
error: `discard' may only appear in a fragment shader this bug is already known, but is silently ignored in my old Nvidia 9800 :(
A new update on Github: github.com/LuisAntonRebollo/Torque3D/tree/dev_linux_opengl
Updated header post with info about report errors.