Skip to main content
GameDev.net gamedev.net
🔒 Locked

Shader abstraction

Started by geolycosa Jan 4, 2007 at 1:59 AM 1 replies 1.6k views
Original Post
geolycosa
geolycosa
Hello all, I am interested in writing a cross-platform renderer that uses only shaders, as I gather this is the approach newer versions of popular graphics APIs are catering to. I am curious as to how one might abstract the concept of a shader such that there is minimal dependancy on the underlying rendering API, and if there are any tools out there for rapidly developing shaders in multiple shader languages.
Will Miller | Game Designer | Big Huge Games
LoneDwarf
LoneDwarf
Take a look at Cg from NVIDIA. It supports different platforms. Some people say Cg is dead but I am guessing it won't be anytime soon since the PS3 uses it.
Monder
Monder
If you use OpenGL you could use GLSL which will work on any platform that supports GL.

If you must use multiple APIs Cg may be a good bet. You could also go the UE3 route where the artists are given a graphical shader designer where they basically just link up various blocks to create their own shaders (there's some more info here, there's also a video somewhere that has bit of info about it). Each block is just a fragment of shader code. If you did this (and didn't use Cg) you'd have to write each of the shader code fragments in ever language you might use, however as the three I know of (Cg, GLSL, HLSL) are very similar it can't be hard to write an automated tool to do it for you.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.