Jump to content
  • Advertisement

Archived

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

vanillacoke

I've got two questions

This topic is 5555 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
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.

Share this post


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

Share this post


Link to post
Share on other sites
finite differencing is a way of computing a derivative. Here you can use it to create the normal vector.

Share this post


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

Share this post


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

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!