Previewing Cg shader and vertex programs

Started by
4 comments, last by judge dreadz 18 years, 1 month ago
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.
Advertisement
There's a program called "OpenGL Shader Builder" that lets you edit and preview GL ARB vertex/fragment shaders and GLSL, but it might only be for OS X.
"ok, pac man is an old gameand, there are faces which is eatin up shits" - da madface
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
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.
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 :)
PM me your email and i'll send you something to get you started.

This topic is closed to new replies.

Advertisement