Archived

This topic is now archived and is closed to further replies.

vanillacoke

I've got two questions

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites