Sign in to follow this  
kikkler

shader programming - assembler or highter languages?

Recommended Posts

I want to start shader programming and i'm currently considering the possibilities - be it 'assembly' language like the good old days, or maybe higher languages (cg etc') which are, erm.. highter. I dont see myself writing full blown programs in pure assembly, is this apply to GPU programming as well? I know assembly allows you to be super specific, but is it worth the extra hassle? i'm not trying to invoke another vs thread, i'm just looking for a little advise to make my way easier down the road thanks

Share this post


Link to post
Share on other sites
Use HLSL, Cg or OpenGL Shader Language.

Its really not worth your time trying to write it all in asm. If you find later you *really* need to go back to asm it, then you can get the shader compiler to give you the asm output and edit that to your hearts content.

Share this post


Link to post
Share on other sites
I do most of my work in HLSL. Easy to use and understands, and I can take advantage of Shader model 3.0 when it arrives without any change in the code (of course, I'll have more capability then :)

There seems to be a lot of support for HLSL, many tools for it, and works on both ATI and Nvidia cards.

I don't have much need for using assembly anymore, unless there is a speed issue which I investigate by using assembly - other than that, it's HLSL.

-Todd

Share this post


Link to post
Share on other sites
Quote:
Original post by kikkler
I dont see myself writing full blown programs in pure assembly, is this apply to GPU programming as well?

GPU shader code is typically pretty small, say about a screen of code for a single effect, so you don't have nearly as much to worry about as if you were making a whole app in assembly language.

Having said that, go for as high-level as your graphics card will allow (so that'd be GLSL or HLSL depending on API (and assuming you've got a recent card)). If those aren't avalible then Cg is your next step down.

Share this post


Link to post
Share on other sites
Hi,
Use HLSL or GLSL. They make your life so much easier.

Unless you are looking for absolutely maximum performance (something only required for really high end engines) the it would be better if you stick to the basics. Aftr you get experience you can optimize you code as you wish.

In my case, I use HLSL with standar anottations for DX9c. We have decided that our game will be finished in a year from now, so we consider PS1.4 as our minimum target (consider that in a year from now, we will 1.4 shaders will be 3 generations away). In that time, just think that the speed of the average GPU will be enough for your average shader.

Luck!
Guimo


Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this