PDA

View Full Version : where do I start with shaders?



BlackSoftware
07-07-2003, 11:07 AM
I have a quadro fx 500 and a basic opengl 1.1 engine. I downloaded the glslang spec and I'm reading it now.

where do you suggest I start learning about writing and integrating shaders into my current engine?

do I compile shader programs seperately?

I have so many questions but what I really wanna know is, where do I start?

I should note that I would prefer to stick to things directly portable to linux. I'm using vis c++ and glut now but I'm going to try to get the nvidia cg linux sdk up and running tonight.

[This message has been edited by BlackSoftware (edited 07-07-2003).]

Relic
07-08-2003, 12:12 AM
I'd prefer the bottom-up approach.
- Scan through the extensions from (older to newer) GL_NV_vertex_program and GL_ARB_vertex_program, GL_NV_fragment_program and GL_ARB_fragment_program to get a grip what the GPU assembly instructions look like.
- Search for simple tutorials on verttex and fragment programs on the developer sites.
- Get all NVIDIA SDK files and read the presentations you can find.
- Play around with simpler shaders and change parameters and formulas to get used to the idea.
- Understand how higher level shading languages abstract the assembly code and define the interfaces between them. You need that to feed the shaders correctly from your apps.
- Autodidactive tutorial: Plan a specific shader effect, write down the necessary computations on paper, implement it first in assembly and then in Cg and compare the output.