Cycles / Filter functions:
* Avoid some variable castings here to save some calculations.
This commit is contained in:
@@ -178,13 +178,13 @@ bool Pass::contains(const vector<Pass>& passes, PassType type)
|
|||||||
|
|
||||||
static float filter_func_box(float v, float width)
|
static float filter_func_box(float v, float width)
|
||||||
{
|
{
|
||||||
return (float)1;
|
return 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
static float filter_func_gaussian(float v, float width)
|
static float filter_func_gaussian(float v, float width)
|
||||||
{
|
{
|
||||||
v *= (float)2/width;
|
v *= 2.0f/width;
|
||||||
return (float)expf((float)-2*v*v);
|
return expf(-2.0f*v*v);
|
||||||
}
|
}
|
||||||
|
|
||||||
static vector<float> filter_table(FilterType type, float width)
|
static vector<float> filter_table(FilterType type, float width)
|
||||||
|
Reference in New Issue
Block a user