Basic GLSL questions

Started by
2 comments, last by Red_falcon 17 years, 7 months ago
Greetings, I'm beginning to learn about shaders, and have some basic questions. 1) My desktop has a Radeon 9800 Pro and my laptop has a GeForce4 4200, which support different Shader Model versions. Where can I find information about the different SM versions? What each supports and doesn't support, etc. 2) Since my laptop doesn't support fragment shaders (via GLSL at least), how can I use vertex shaders? Most examples I see has the vertex shader passing information about color to the fragment shader. I've got a basic vertex shader now, but the colors are all wrong. Can a vertex shader be used without a fragment shader? 3) If I'm using shaders to basically replace the fixed-function pipeline, do I never want to enable lighting and textures via glEnable(GL_LIGHTING), etc? 4) Is there an example somewhere of simply replacing the FFP using shaders as a starting point? EDIT: 5) I run some "picking" code which re-renders the scene using color codes so I can determine what item the user selected. I only render this scene to the back buffer and never bring it to the front. However, when using the vertex shader, the colors "shift" whenever the picking scene is rendered. Why am I seeing the results of the picking scene rendering? Do I have to specify in the shader to render to the back buffer? Thanks! [Edited by - Mantear on September 9, 2006 1:45:36 PM]
Advertisement
1. R9800 supports 2.0 shaders. GF4 1.1 VS and 1.3 PS.
2. VS can be used without PS. Just look at the fixed-function pipeline for pixel rasterizing and you'll know what data to pass from VS.
3. If you use shaders you don't need to enable lighting or texturing (texturing must be enabled for PS < 2.0).
4. I don't know. Maybe...
5. I don't know what's exactly the problem. Maybe some screenshots...
if (time() == $) { $ = 0; }
4) Is there an example somewhere of simply replacing the FFP using shaders as a starting point?

Yes get the "Orange Book" by randi rost. It covers FFP code examples in GLSL...
Or get ShaderGen from 3dLabs, it generates ffp shader for you. So you can learn how to cover this area.
-----"Master! Apprentice! Heartborne, 7th Seeker Warrior! Disciple! In me the Wishmaster..." Wishmaster - Nightwish

This topic is closed to new replies.

Advertisement