Jump to content
magneto

What are derivatives?

Recommended Posts

Hi,

This is something I really don't understand and I didn't find anything in the Houdini help. Can anyone explain it in simple terms?

Is it only useful in shading?

 

Thanks :)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Thanks Matt, your post definitely made me understand it better :)

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
4 hours ago, malexander said:

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

Is it property of such tangents that they are inconsistent on uv seams?

Share this post


Link to post
Share on other sites

"A derivative is a financial security with a value that is reliant upon or derived from, an underlying asset or group of assets—a benchmark. The derivative itself is a contract between two or more parties, and the derivative derives its price from fluctuations in the underlying asset."

source

Share this post


Link to post
Share on other sites

I once implemented derivatives up to 8th and it become quite hard to use them meaningfully but jerk still showed something that could at least be visualized easily sort of like the uneven acceleration of a car by a new driver that jerks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×