Game Development Community

Advanced lighting and OpenGL renderer inside T3D

by Dusan Jocic · in Torque 3D Professional · 07/21/2013 (4:46 pm) · 8 replies

It took me some time until I fixed some of sweet and sour and broken code and .GLSL files inside T3D, until I got this what is shown on picture.

While working on this I saw more leftovers from (I believe) TGE era, and some really nonsenses inside lighting code.



Advanced lighting - picture #1.
i218.photobucket.com/albums/cc300/Drago85/AdvancedLightingOpenGLT3D_zpsd45d35d2.jpg~original


EDIT - added better picture
Basic lighting - picture #2
i218.photobucket.com/albums/cc300/Drago85/BasicLightingOpenGLT3D_zpsb2ec3c90.jpg~original


EDIT - added another picture
Basic lighting - picture #3
i218.photobucket.com/albums/cc300/Drago85/BasicLightingOpenGLT3D2_zpsa454c344.jpg~original

Visual Studio 2012 attached on debug build showing both advanced and basic lighting on OpenGL renderer
console.log



As you can see on picture some GLSL files are compiled and linked, just shaders what are important for "Advanced lighting" are not. Now just some sweet guy need to rewrite/update rest of .GLSL and code inside engine in order to get it on DirectX 9 level :)

#1
07/21/2013 (6:17 pm)
I was just wondering - is this for Linux or Mac? I don't really know anything about this sort of thing ...

[edit]
VS2012 - ah, it's openGL for Windows I take it.
#2
07/21/2013 (6:27 pm)
Great work! This is really exciting.
#3
07/21/2013 (6:36 pm)
Sweet. Opengl was something people asked for.
#4
07/21/2013 (8:19 pm)
"Visual Studio 2012 attached on debug build showing both advanced and basic lighting on OpenGL renderer
console.log"

dustin,
is that mean it is windows?

want to do some test and digging into opengl code for windows.
can you update your gitthub repo?
#5
07/25/2013 (10:06 pm)
Is Advanced Lighting via OpenGL even possible? My understanding was that OGL lacked support for certain texture formats required to render AL at any kind of decent framerate.

Edit: Here's a quote by Alex Scarborough, the guy responsible for a lot of T3D's OGL/GLSL code, regarding Advanced Lighting via OpenGL/on Macs:

Quote:
Not supporting Advanced Lighting is driven primarily by the technical limitations of OpenGL and the subsequent performance penalties Advanced Lighting suffered. Advanced Lighting performs best with single channel 32 bit floating point textures, and dual channel 16 bit integer textures. OpenGL lacks native support for either of these formats, forcing Advanced Lighting to use much less efficient four channel 32 bit floating point textures andfour channel 16 bit floating point textures. The latter is not a typo, due to various implementation oddities 16 bit integer textures in any form are not reliable in OpenGL. Using these less efficient texture formats has an extreme impact on Advanced Lighting's VRAM usage, pushing it as high as 100 MB for a "simple" scene. Add that to the VRAM used by OS X itself and to the VRAM required for your game assets, and it quickly exceeds the capacity of most GPUs Apple ships, including the 512 MB 9600M in my MacBook Pro.

Compounding these performance issues, we encountered a couple of bugs in Apple's OpenGL drivers which cost us a considerable amount of time to track down and workaround (we aren't the only ones suffering here), and there are still a few which we have not managed to track down yet. I believe with time and with Apple's assistance we might be able to work around or solve these issues, but that's a dependency we may not wish to place ahead of the product's release. Our time before 1.0 is likely better spent improving stability and performance for all users and ensuring that the Mac experience with Basic Lighting is as smooth and polished as possible.

Has any of this changed in the last 4 years?
#6
07/27/2013 (3:15 am)
The soon to come OS X (10.9) update is meant to finally be updating from the aging OpenGL 3.2 support to OpenGL 4.1.
#7
07/27/2013 (7:16 am)
Quote:Is Advanced Lighting via OpenGL even possible? My understanding was that OGL lacked support for certain texture formats required to render AL at any kind of decent framerate.

I don't know about anything about Mac so I cannot give you proper answer on "Advanced Lighting" on MacOS. But I can tell you that on Linux you shouldn't have any problems. I will post new screenshots with Linux build with "Advanced Lighting" soon.
#8
07/27/2013 (10:59 pm)
@Edward: That's good news. Assuming GL & driver support is there that'll be one (big) roadblock out of the way. The other hurdle will be the graphics hardware. The Intel HD and last-gen nVidia 'M' series cards that Macs are shipping with will likely struggle with AL.

@Dusan: Also good news. You're doing some terrific work!