shader & ray tracer

I have a very basic question about shaders and ray tracing. I am trying to write a shader to bump map a cylinder. after reading some online literature, i am confused whether i should write a ray-tracer before i start writing a shader. I could use either renderman or cg, but i am not sure if i need a ray-tracer. please let me know. also i someone is aware of a way to perform bump mapping on a cylinder, please send some pointers.

Hi !

Not sure what you are trying to do here, if you want to make make OpenGL shaders, you do not need any ray tracing.

It is correct that most renderman compatible renderers use something called shaders, but this has nothing to do with an OpenGL shader.


so basically one does not need a ray tracer to render say a plank of wood or a torus with bump mapping ??
if i have to write a shader to display plank of wood or a stone with some bump mapping, i can do it using a simple opengl program and writing vertex/fragment shaders in Cg??
i am feeling quite dumb asking these questions… :expressionless: but answers will be greatly appreciated.

You are correct, no ray tracing is required.

Ray tracing is really a method of determining surface visibility and other effects like reflections.

Even a ray tracer must compute the appearance of a surface once it determines the point of intersection using what you could call a shader.

OpenGL renders things differently. It transforms polygon vertices to the screen and renders the interpolated pixels to the framebuffer and uses the depth buffer to determine which ones are visible at each screen location. How it shades the pixels to the framebuffer (and even their location) is a result of vertex and fragment programs called shaders.