#### Archived

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

# I've got two questions

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

## 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 on other sites
Behold, the power of Gamedev''s search engine

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

Cédric

##### 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 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 on other sites
finite differencing is a way of computing a derivative. Here you can use it to create the normal vector.

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

1. 1
2. 2
Rutin
20
3. 3
khawk
18
4. 4
A4L
14
5. 5

• 12
• 16
• 26
• 10
• 44
• ### Forum Statistics

• Total Topics
633763
• Total Posts
3013728
×

## Important Information

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!