Sign in to follow this  
Baaaah

Previewing Cg shader and vertex programs

Recommended Posts

Hi, I'm a nood to shader programming - I have a small amount of C programming knowledge - and I'm trying to learn the Cg shader programming language. I might be wrong, but it seems from the information I've read so far, that the only way I can preview a shader I've written is through either the Directx or OpenGL API. And in order to do this I've got to learn a certain amount of windows programming. I guess I was wondering if there's another way to preview a shader without me having to learn another programming language? The book that I'm learning from bye the way, is 'The Cg Tutorial' published by Nvidia. I've got to the point where I'm supposed to render a traingle and use the vertex and shader programs to transform and colour it. Unfortunately it doesn't contain much info on how I go about this. :/ I guess I'm looking for a quick way around something I perhaps can't avoid, but any help would be appreciated. :) Cheers.

Share this post


Link to post
Share on other sites
If you don't want to build the code yourself, checkout this NeHe tutorial

I perfer FX files when working with HLSL. It has integrated dev environments with real-time previews.

----------
standards, n.: The principles we use to reject other people's code.
First time I've gotten a programming job that required a drug test. I was worried they were going to say "you don't have enough LSD in your system to do Unix programming". -- Paul Tomblin

Share this post


Link to post
Share on other sites
there is not really any point learning Cg without knowing either openGL on DX anyway, so if you dont know either of them you really need to learn that aswell. i dont know about DX, but you can pick up the basics of openGL in a couple of days. you can also do your windowing in glut which is very simple. if it would help i can send you some code to get you started.

Share this post


Link to post
Share on other sites
Foobar of Integers: Yeah, looks like it's just for Macs. There are I suppose PC equivalents however in the form of Render Monkey and FX Composer, so I suppose I can use those until I'm more familiar with OpenGL/DirectX. Cheers :)

rlange: Thanks for the link, that's a pretty cool tutorial. Yeah, I tihnk I'm going to use either Render Monkey or FX Composer until I've gained a better understanding of DirectX/OpenGL. The main thing I've learned is that there's no quick way really of doing this, I've got to invest some time into it if I want to write shaders and use them directly with either API.

judge dreadz: Yeah, after trawling around on the net for a few hours it gradually became apperent to me that there wasn't going to be a quick way to do this :). Yes, I'd like to have a look at that code that you mentioned, do you need my email or do you want to PM it to me?

Thanks for the help guys :)

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