Initial commit
This commit is contained in:
commit
686dcaf351
68 changed files with 6230 additions and 0 deletions
13
glsl/smooth_heaviside.glsl
Normal file
13
glsl/smooth_heaviside.glsl
Normal file
|
@ -0,0 +1,13 @@
|
|||
// A useful filter, behaves like a smoothly parameterized smooth Heaviside
|
||||
// function.
|
||||
//
|
||||
// Inputs:
|
||||
// x input scalar (-inf, inf)
|
||||
// t control steepness of step function: --> 0 more linear, --> inf more like
|
||||
// Heaviside function (piecewise constant function x<0--> -1 , x>0 --> 1)
|
||||
// Returns scalar value
|
||||
float smooth_heaviside( float x, float t)
|
||||
{
|
||||
return (1./(1.+exp(-2.*t*(x)))-1./2.)/(1./(1.+exp(-2.*t*1.))-1./2.);
|
||||
}
|
||||
|
Reference in a new issue