Talk:Smoothstep

Latest comment: 5 years ago by Inigo.quilez in topic Inverse Smoothstep (cubic hermite)

Inverse Smoothstep (cubic hermite)

edit

I think it's worth mentioning that the inverse of the popular cubic smoothstep(), which is useful when doing certain operations in computer graphics, is

 

and in GLSL:

float inverse_smoothstep( float x )
{
    return 0.5 - sin(asin(1.0-2.0*x)/3.0);
}

(I derived this one myself while working on a project in 2017, no need for credit). An example of it in action is here: https://www.shadertoy.com/view/MsSBRh — Preceding unsigned comment added by Inigo.quilez (talkcontribs) 06:09, 11 February 2019 (UTC)Reply

"It is claimed"...?

edit

"It is claimed in both the MSDN and OpenGL documentation that the function has been implemented using Hermite interpolation."

I'm not sure what this means. The equation is given right there in the code snippet, and yes, that is cubic Hermite interpolation. So what does it mean to say that they "claim to implement it using cubic Hermite interpolation?" I believe it would be more useful to just confirm that the equation shown is the Hermite cubic interpolating polynomial, with the constraints that the endpoints are 0 and 1, and the derivatives at the endpoints are both zero. I guess if nobody comments, I'll make this change. Fletcherdunn (talk) 03:16, 25 August 2009 (UTC)Reply

edit

AMD Siggraph2003 ppt file has either moved, or has been deleted? —Preceding unsigned comment added by 173.174.83.212 (talk) 22:14, 10 August 2010 (UTC)Reply

saturate/clamp helper function consistency?

edit

It would be more clear if the code for the smoothstep and smootherstep reference implementations used the same helper function. Currently smoothstep uses saturate(value), while smootherstep uses clamp(value, 0, 1), which does exactly the same thing. — Preceding unsigned comment added by 70.36.63.75 (talk) 19:00, 12 July 2013 (UTC)Reply

General Form of Smoothstep Equations

edit

Would it be worth noting that all smoothstep equations can be generalized as:

 

where a is the degree of smoothness with larger values of a giving steeper smoothstep equations. Evaluating this function for different values of a gives:

 
 
 
 
 

For any value a where a > 0, this generalization will smoothly interpolate from 0 to 1 for any value x on the interval 0 ≤ x ≤ 1 while retaining the property Sa(0.5) = 0.5. It may be useful for those trying to find higher order smoothstep equations without having to solve increasingly complex systems of unknown variables.

138.247.214.47 (talk) 21:14, 5 April 2016 (UTC)Reply

I believe the most generalized way to present this smoothstep polynomial function is in terms of an odd-symmetry, odd-order polynomials about zero, as explained in this Stack Exchange question and answer. It has to be equivalent to the Hermite polynomial of the same order because it also shows continuity of the function and as many derivatives as possible. I do not know of a published article that presents this, so I am not sure how qualified this mathematical analysis would be for this article. 96.237.136.210 (talk) 04:16, 19 December 2016 (UTC)Reply

There is a broken equation in the article.

edit

It's in the section on the 5th order equation:

Applying the desired values for the second derivative of the function at both endpoints we get:
 

I don't want to slug through this to fix the equation. 96.237.136.210 (talk) 04:06, 19 December 2016 (UTC)Reply

Evidently it renders fine in the talkpage. It displays in red letters on the main page as:
Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "/mathoid/local/v1/":): {\begin{alignedat}{15}f(0)&&\;=\;&&0\;\;\;\;&&\Rightarrow &&\;\;\;\;0\;&&+&&\;0\;&&+&&\;0\;&&+&&\;2a_{2}\;&&=\;&&0&\\f(1)&&\;=\;&&0\;\;\;\;&&\Rightarrow &&\;\;\;\;20a_{5}\;&&+&&\;12a_{4}\;&&+&&\;6a_{3}\;&&+&&\;2a_{2}\;&&=\;&&0&\end{alignedat}}
So I dunno what to do. 96.237.136.210 (talk) 04:08, 19 December 2016 (UTC)Reply

I would like to modify and clean up the ===Generalization of higher-order equations=== section

edit

The math appears to be correct and was just proven recently at the Math Stack Exchange;

 

I want to substitute  , everywhere except in the subscript where  . So the expression will come out as:

 

and the 7 examples will be:

 

and, finally, to change the   in previous sections to their appropriate   for consistency throughout the article.

This will only improve consistency in the article. I could not find a reference for inclusion of the generalized Smoothstep, but we were able to prove it at the math StackExchange. I actually think we could bump the generalized definition to the lede of the article and maybe include a hatted section with the "smooth" properties and proof. There is some work involved and I will not begin to do this if someone objects strongly. 173.48.64.110 (talk) 21:41, 29 April 2017 (UTC)Reply


N?

edit

Where in this article is "N" defined? 192.150.204.8 (talk) 10:06, 19 December 2017 (UTC)Reply

smootherstep not in referenced book

edit

The reference provided for smootherstep ("Texturing and Modeling, Third Edition: A Procedural Approach") seems to not contain anything about smootherstep (or a 5th-order polynomial with a different function name) at all, but only smoothstep from this article's intro section. Does anyone know an alternative reference for smootherstep? Bigfootsbigfoot (talk) 09:42, 20 April 2018 (UTC)Reply

https://doi.org/10.1145/566654.566636 "Improving noise" by Ken Perlin, from 2002, https://mrl.nyu.edu/~perlin/paper445.pdf for Full text. He mentioned this on some presentations earlier, like in 1999 or 1998. It is not huge discovery (these polynomials are known for 150 years), just application.

My math was embarrassingly wrong. Sincere apologies to @Inigo.quilez.