OpenGL fallback discussion

BlitzMax Forums/BlitzMax Programming/OpenGL fallback discussion

Robert Cummings(Posted 2006) [#1]
Software opengl entirely corrupted on my pc - can't see a thing. I have an ati radeon x1900xt though. I think it is deeply foolish to rely on its existence on the pc platform.

The mac osx is entirely opengl friendly so we can probably expect different results from there.

Also:
Anyone feel like porting cower.SDL to mac? he has said he would do it but he does not have a mac so it isn't feasible for him.


GfK(Posted 2006) [#2]
I don't get the image outline problem in software GL, which is interesting, I guess.

On the other hand, girlfriend's PC will fall over and die at the merest mention of GL.

I agree you can't rely on GL being available - perhaps on Win32 platforms you're going to have to default to DirectX and let the end-user choose GL from there. But even then we're going either need some way of testing for GL availability, or accept that the user selecting GL when their system doesn't support it in any way, is going to make the thing crash.

Tricky one...


Robert Cummings(Posted 2006) [#3]
Its no problem for me. I'm just posting this to alert other people who keep bandying around that blitzmax is going to automatically work - it isn't.

Well, Graphics() will actually return null if it couldn't open dx. So just test for DX then for OpenGL and then just check the vendor name to see if GL is in software. Thats what I do and it works a treat.

Example

driver = Graphics(640,480,0)
if driver = null
try the same with opengl graphics driver()
if driver still null
drop into software such as SDL or inform user game is not compatible

Thats what I do, and it is reliable. I am just trying to get the information out there for people. I am not saying there is a problem with this, because there isn't.

I think we need SDL on mac and linux. I am willing to donate money to programmers who need it in order to further SDL development within blitzmax.

Noel's SDL libs are a fantastic starting point but they aren't linux and they aren't mac, so IMHO that needs to be persued. SDL is fast in the right hands.

I am just lett


ImaginaryHuman(Posted 2006) [#4]
On the Mac the OpenGL support is really good. They don't have any DirectX whatsoever so a lot of extra effort has been put into GL especially since on newer machines the entire desktop is rendered with OpenGL hardware accelerated. It has to work right or they wouldn't be able to have a stable desktop. I don't know of much use of software rendering on the Mac. The only time I see it use software is if it's a pre Quartz Extreme (GL desktop) Mac or there isn't enough videoram. My old iBook does software GL only, and works correctly and reliably even for a 10 year old machine (although the o/s has been updated since).

So you almost don't even need to worry about having SDL on the Mac because it isn't likely to be needed. The software GL works fine, and if anyone else can say otherwise I'd be surprised. I have no idea what it's like on Linux, but the same situation is true - there is no DX so OpenGL has been focussed on and made to be more reliable. I'd be surprised to hear that the software GL on Linux is unreliable. I don't at this point see any need for a fix to this problem except under Windows and I don't think porting SDL to Mac or Linux will be of any benefit. In fact it's probably pointless.

It's mainly windows that has the problems. Since windows platforms are in such great numbers, with SO many different graphics cards, drivers, implementations, o/s revisions, hardware configurations, etc, and not exactly very well standardized and highly proprietary, I'm not really surprised that things are much more unpredictable and unreliable on that platform, if only because of the number of units. If you really want to target as many people at all costs, then obviously you have to use DX first and GL second. Either that or clearly display a notice on your advertising that it is an OpenGL application and requires a working installation of OpenGL. Maybe you could find out where GL drivers can be downloaded from and include the links in your software or documentation.

If you are wanting to make your software truly cross-platform you shouldn't need to have separate code that runs only on a given platform and not others, so they should all use OpenGL. That said I'm sure some people are going to think of falling back to DX under windows, just because it seems to be a problem for some people. Either that or you can stop trying to please everyone and just put your backing behind OpenGL.


Robert Cummings(Posted 2006) [#5]
Out of curiosity, how much can you throw around using software rendering under ogl on the mac? Is it true that it can get somewhat ugly - ie no filtered edges and so forth?


ImaginaryHuman(Posted 2006) [#6]
I wouldn't be surprised, software rendering uses the CPU only so whatever the CPU can do it's likely to be a lot less than the gfx card, even with a low-mid-range card.
I can't report an exact comparison because my ibook is so slow anyway, it can't do more than a few frames per second of even the simplest graphics in OpenGL.

On the ibook, DrawPixmap is the same speed as DrawImage. I think that's because there is very limited video ram, so it actually keeps ALL textures in main memory, so drawing a pixmap from main memory to main memory is no faster or slower than doing it with an image. I also found on my faster iMac which has much faster gfx card for OpenGL hardware acceleration, that DrawPixmap on that machine is 10 times faster and DrawImage is 100 times faster, than the ibook's speed. That's a 1GHz G4. So you might find depending on the cpu and gfx card that there can be quite significant differences, in my case around 10 times performance drop in software. You just can't do what OpenGL can do, in software, and expect it to be anywhere near as fast as hardware accelerated highly graphics-processing specific GPU's.


TartanTangerine (was Indiepath)(Posted 2006) [#7]
Software render on OGL is at the mercy of the driver and while some are fast the Microsoft version is very slow.


Robert Cummings(Posted 2006) [#8]
Thanks! It looks as though when I do the mac port I will have software rendering with SDL for that also - it'll be much faster.


TartanTangerine (was Indiepath)(Posted 2006) [#9]
Thanks! It looks as though when I do the mac port I will have software rendering with SDL for that also - it'll be much faster.

:D

Can I purchase the SDL multiplatform renderer?


Grey Alien(Posted 2006) [#10]
Is it really worth bothing with software rendering, surely the game will look/run like poo?


TartanTangerine (was Indiepath)(Posted 2006) [#11]
I've had to add some serious modifications to igL to cope with SDL applications. Software render, in the casual market, is widely used. To the extent where is it possible to render straight to the igL window direct.


ImaginaryHuman(Posted 2006) [#12]
I guess it depends on who you think your market is and who you are targetting and on what platform. I think you only need be concerned on Windows machines.