Game Development Community

OpenGL versus DirectX HLSL

by Ben McIntosh · in Torque Game Engine Advanced · 04/25/2009 (1:28 pm) · 2 replies

I am beginning to learn HLSL to develop shaders for TGEA and I am wondering if it is better to start with programming for DirectX or OpenGL first?

I am using RenderMonkey to learn and when I just run the sample projects, the OpenGL shaders run beautifully but the DirectX ones seem to be running very slow... maybe in software emulation mode. I'm sure that just has to do with my video card.

In any event, does it even really matter which way I go? I noticed that you can define both a DirectX and OpenGL file in the TGEA shader definition, but is this common to support both?

Thanks!

About the author

Ben is the co-founder of Urban Brain Studios; a new independent developer of games and game development tools.


#1
04/25/2009 (1:43 pm)
As follow-up, the DirectX rendering was slow just because I was using it in debug mode.
#2
04/25/2009 (3:07 pm)
The reason for supporting both is for cross-platform support. TGEA doesn't support OpenGL in Windows, so you'll need to use HLSL for Windows and GLSL for Mac.

They're fairly similar, so what I do is develop my shaders in HLSL and when I'm satisfied with how they work, then I port them to GLSL.