Jump to content

What are derivatives?


magneto

Recommended Posts

My half-remembered high school definition of a derivative is its the rate of change of a curve.

Here's a good visual example of 'eyeballing' the derivative of a curve (the rest of the course looks like a good intro too)

https://www.khanacademy.org/math/differential-calculus/taking-derivatives/visualizing-derivatives-tutorial/v/intuitively-drawing-the-derivative-of-a-function

 

If you plot an object's position as it moves around, and take the derivative of its position, that's its velocity. If you take the derivative of its velocity, that's its acceleration. A sillier way to say that is velocity is the rate-of-change of its position, and the acceleration is the rate-of-change of the rate-of-change of the position. :)

That's also explained here (integrals, or antiderivatives, are the opposite of derivatives): 

https://www.khanacademy.org/math/integral-calculus/indefinite-definite-integrals/indefinite-integrals/v/antiderivative-acceleration

 

Obviously this sort of stuff can be useful for simulation and shading (eg, you can think of a bump map as a rate-of-change for the surface normal), but its more something to keep in the back of your mind; whenever you find that you need to measure the rate of change of something, hey presto, you're talking derivatives.

 

  • Like 2
Link to comment
Share on other sites

Derivatives are often used in surface shading as a way to antialias. In order for texture mipmapping to work, you need to have an idea of how far apart in UV space a sample and its neighbour are. If they are less than a texel apart in UV space, you can use the highest resolution mip level. But if they're several texels apart, you want to blend all those intermediate texels together to get an approximation of the colors blurring together, and thus use a lower-resolution mip level which has pre-baked this blur in the form of a downscaled texture. In order to determine the mip level to use, the shader takes the difference of the UVs with its neighbours at each sample - the "derivative".

They can also be used to determine a reference frame on a surface, which you need to do tangent-space normal mapping.

At the discrete level computer graphics operates at, a derivative is simply the difference of two values over an interval - (V1 - V0) / (P1 - P0).

  • Like 5
Link to comment
Share on other sites

  • 4 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...