Advertisement

I've got two questions

Started by July 02, 2003 09:55 PM
6 comments, last by vanillacoke 21 years, 7 months ago
First of all, what is pixel shader? I''ve heard that term a few times, and I didn''t find much info about it, and I can''t really figure out what it is from its name... Second, does anyone here know how to do bump mapping on an implicit surface? Example: I have a scalar function f(x,y,z), and I want to use that function to generate heights on the surface of a sphere (raytraced with the implicit equation of a sphere). I can''t figure out a simple way to do it. I want to generate scalar heights, not vector displacements. ANy help?
You know what I never noticed before?
Behold, the power of Gamedev''s search engine

Besides, you should have asked this in the Graphics programming forum.

Cédric
Advertisement
quote:
Original post by vanillacoke Second, does anyone here know how to do bump mapping on an implicit surface? Example: I have a scalar function f(x,y,z), and I want to use that function to generate heights on the surface of a sphere (raytraced with the implicit equation of a sphere). I can''t figure out a simple way to do it. I want to generate scalar heights , not vector displacements. ANy help?


One way would be to use finite differencing to calculate the normal at a point. Basically take the heights at adjacent points, and find the normal vector from that.

cedric: sorry, I guess I didn''t realize that there is a graphics forum.

skjeld: is finite differencing something that allows you to analyze an implicit surface? I''ll go try to read about it.
You know what I never noticed before?
finite differencing is a way of computing a derivative. Here you can use it to create the normal vector.
To find the derivative of what? I already know how to take the derivative of a function. To find the normal vector to an implicit surface, don''t you just use the gradient?
You know what I never noticed before?
Advertisement
It''s the partial derivative with respect to x,y,z(the direction you do differencing in)

and the gradient is the vector of partial derivatives...
A pixel shader is a program(called a shader), which is run per pixel. For shorter shaders, this is typical, a simple mathematical equation, for example a lighting equation. Check out cgshaders.org. There are quite a few graphics apis that use pixels shaders. Opengl and DirectX are the most famous that do it in real time.

This topic is closed to new replies.

Advertisement