Skip to main content
gamedev.net
🔒 Locked

Shaders.....

Started by ZeroGravity 4 replies 850+ views
Original Post
ZeroGravity
ZeroGravity
Ok Basicly ive dicided on starting a new project. But For the first time ive dicided to use shaders,Which i know very little about.Basicly i need to choose which Gfx API i will be using and which shader solution. I already know C++ and OGL,But i havnt coded in about 4-6 months.... And now ive dicided to jump right back in and learn some new stuff in the process. Basicly I have 3 choices(or so i think), DX-HLSL,OGL-Cg,OGL-Slang. Im realy tempted to stay with OGL because i already have some knowlage of how it works.But From what ive seen DX is looking very good and OGL seems to be laging behind a little. Basicly id like some opinions on the different shader languages,Your experiances with them,pitfalls,and anything esle you can think of.... Thanks in advance....
Free Your mind Free your Feeling~~~Working on~~~Nothing
_the_phantom_
_the_phantom_
i''m not sure why you think OpenGL is ''lagging behind'' D3D.... however on the subject of shaders and OpenGL.

Cg will give you the most range from one bit of code from what i can tell, as it will target any of the Nvidia cards and use the Nvidia extensions to get the best from those cards, be it vertex or fragment shaders you are writing.
It does fall down a bit with ATI''s cards, iirc it can only target cards which expose the ARB_vertex_program and ARB_fragment_program extension, which is def the DX9 series of cards (R3x00/9500 and up), however i''m not sure about before that and afaik it doesnt have a profile to produce code to run on ATI''s version of ''register combiners'' (forgoten the name atm)

OGLSLang, or OGSL, is, as you might know, OpenGL''s native high level shading language, but unlike Cg it is currently only working GFFX and above Nvidia wise and 9500 and up ATI wise, due to it targeting DX9 class hardware.

Personaly, i perfer the OGSL mainly because its native to OpenGL and doesnt require any extra libs. Granted its still got a little way to go driver wise but i like its way of working, althoght i havent had the time to do anything concrete with it as yet (maybe in the next few weeks when i get some time)
klajntib
klajntib
I think that GLSL is THE ULTIMATE shading language, due to it''s one very unique feature - the shader get compiled by the driver at runtime, which in turn means the best optimisation.

It''s sad that it has no DX8-class HW support.
_the_phantom_
_the_phantom_
apprently the GF3/4 will get support of vertex shaders in GLSL at some point soonish.
I''ve also asked ATI if they plan on releasing vertex shader support for the 8500/9100/9200 and was told they have no plans to atm
ZeroGravity
ZeroGravity
Hmm ok ill do some more reseach on Slang and Cg.But it seems slag would be the better choice....
Free Your mind Free your Feeling~~~Working on~~~Nothing

Topic Locked

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

Sign in to reply to this topic.