Re: High Level Shading & Gaming Industry
| Date : Fri, 20 Oct 2006 22:19:01 -0500 |
| To : 3DGames(at)Softimage.COM |
| From : "Andi \"Debug\" Ireland" <debug(at)neverborn.net> |
| Subject : Re: High Level Shading & Gaming Industry |
Hi Guy... LTNS
I have been writing a game engine for over 2 years now, and worked on NeL ( www.nevrax.org ) for over 4 years improving the engine for Nevrax for educational purposes.
I have taken up the insane task of platform independent code in my engine personally I went with an abstract shader system on top of an abstract API driver system that tries to support everything each API and thus each language can achieve at the core with a profile system similar to Cg, since it is an engine it itself supports Cg, and the API dependent high languages and assembler versions.
It is horrific I can assure you, the only reason I went this way was self education the convoluted ambiguous mess you end up with providing support for so many shader types is more like torture than fun.
I agree with what was said earlier commercial games either are made for one target platform thus one shader language then they do a port if it succeeds or have multiple teams each working on a different target platforms, sometimes they have an engine with abstracted drivers and all teams improve the engine code base and their platform drivers.
Here Occam's razor is in full effect the simple solution is in my eyes the best solution pick an API and either High level or low level shading languages for that API and platform.
If you want an interesting conversation with lots of fun people in the Indie games industry I recommend #flipcode on irc.enterthegame.net I hang out there often and they are sure to have some valid input on your question
Hope this ramble helps
Andi "Debug" Ireland
Wessam Bahnassi wrote:
Honestly, all this multi-platform thing is totally dependent on the company's policy. I think casual games have more tendency to support multiple platforms because their problems are usually easily-manageable. But larger titles concentrate on the market with the biggest numbers, and they ship to other platforms as well if the title becomes a top-seller.
Realistically, even if a title is to be launched on targets that use D3D and OGL, it's hard to share shaders across platforms mainly because of the huge hardware differences. Advanced features vary a lot between platforms, and it would be a shame to lose all that for a common-denominator solution that allows you to write a shader once and reuse on multiple platforms. From a 3D engine design POV, it's much better to abstract shaders into a higher-level interface that allows artists specify a "material" for an object rather than directly specify shader-code. The engineers would then be free to implement the material in the most optimized way for each platform. In that sense, you might actually end up mixing Cg and HLSL and GLSL or even a company-proprietary language for a single project. And personally I wouldn't consider that a bad design...
Does this answer your question? :)
Wessam Bahnassi Microsoft DirectX MVP, Programmer Electronic Arts -- In|Structurez Arabic Gamedev Community www.instructurez.com
-----Original Message----- From: owner-3dgames(at)Softimage.COM [mailto:owner-3dgames(at)Softimage.COM] On Behalf Of Guy Rabiller Sent: Friday, October 20, 2006 9:36 AM To: 3DGames(at)Softimage.COM Subject: Re: High Level Shading & Gaming Industry
Thanks for your input Wessam.
> ../.. Cross-platform support? For what? Linux? FreeBSD? > These are not OSs that gamers use ../..
What about the Mac ?
But, lets say that both support for DirectX and OpenGL is needed. From your <personal>opinion</personal> would it be preferable to only support Cg or only HLSL/GLSL ?
-- guy rabiller | 3d technical director (at) LaMaison
Wessam Bahnassi a écrit :
HLSL is well-integrated within the DirectX SDK and is very easy to useand
integrate out of the box. If the game (or even the whole company) is notyour
going to use OpenGL, then why bother with Cg? And thanks to the Xbox,
HLSL code can be easily ported to Xbox and 360, whereas Cg doesn'tcompile
whetherfor these targets...
<personal opinion>
Well, asking about whether to choose Cg or HLSL is similar to asking
toto use OpenGL or Direct3D. As you know, most PC game titles today use Direct3D as a 3D API.
Now, from a 3D Engine developer point-of-view, it's a big waste of time
support both D3D and OGL. Cross-platform support? For what? Linux?FreeBSD?
These are not OSs that gamers use. But Xbox, and Xbox360 (which are D3D-only
based) are widely distributed. PS2 and PS3 do not use OGL as theirgraphics
API so the engine will still have to support these in a different codepath
beneathanyways whether it supports OGL or not... </personal opinion>
Performance-wise, one might argue that Cg delivers better performance on
nVidia hardware because the compiler knows exactly what's running
it. This fact will mostly change with D3D10 now as the compilation ofHLSL
will be moved to the driver itself, which means nVidia ca provide thesame
optimization capabilities as they do with the Cg compiler (unless ifthey
Onintentionally don't want to :)
Wessam Bahnassi Microsoft DirectX MVP, Programmer Electronic Arts -- In|Structurez Arabic Gamedev Community www.instructurez.com
-----Original Message-----
From: owner-3dgames(at)Softimage.COM [mailto:owner-3dgames(at)Softimage.COM]
?Behalf Of Guy Rabiller Sent: Friday, October 20, 2006 3:22 AM To: 3DGames(at)Softimage.COM Subject: High Level Shading & Gaming Industry
Hi,
I'm trying to gather usefull informations about high level shading habits and usages in the gaming industry.
So far, and afaik, there are HLSL, GLSL & Cg among the most used high level shading languages available.
I've seen that most engines are trying to support all of these, some only support one.
The kind of questions I have in mind is for instance:
What the point of supporting HLSL & GLSL if Cg is able to handle both OpenGL and DirectX ?
Do you think it would be reasonable to only support Cg ? Are there any strong reasons why an engine should support Cg and HLSL for instance ?
I'm thinking about one: Gaming Console ( especialy XBox for instance where HLSL is mandatory, afaik ).
But outside the gaming console world, would there be any reason at all
body:---Performance may be ?
What are your thoughts/informations about this matter ?
Thanks in advance for any hint.
-- guy rabiller | 3d technical director (at) LaMaison
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in
unsubscribe 3dgames
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe 3dgames
--- Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body: unsubscribe 3dgames
--- Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body: unsubscribe 3dgames
- Follow-Ups:
- Re: High Level Shading & Gaming Industry
- From: Guy Rabiller <guy(at)alamaison.fr>
- Re: High Level Shading & Gaming Industry
- References:
- RE: High Level Shading & Gaming Industry
- From: "Wessam Bahnassi" <wbahnassi(at)inframez.com>
- RE: High Level Shading & Gaming Industry
| DATE: | << | >> | THREAD: | << | >> | INDEX: | Main | Thread |
|---|
- Previous by Date: Re: High Level Shading & Gaming Industry
- Next by Date: Re: High Level Shading & Gaming Industry
- Previous by Thread: Re: High Level Shading & Gaming Industry
- Next by Thread: Re: High Level Shading & Gaming Industry
- Index(es):
| Search the 3D Games List archives here or use the advanced search form to search across mailing lists. Searching help is available. |