28 const Vec2f &iOrientation,
50 Vec2r ori2d(-vertexOri[1], vertexOri[0]);
54 if (
_clamp && (scal < 0)) {
63 if (thickness < 0.0) {
81 float iAmount,
float ixScale,
int nbOctave,
bool smooth,
bool pureRandom)
99 Vec2r p(
v->getProjectedX(),
v->getProjectedY());
102 Vec2r p0(
v2->getProjectedX(),
v2->getProjectedY());
103 p0 = p + 2 * (p - p0);
114 Vec2r p(sv->getPoint());
119 Vec2r ori2d(vertexOri[0], vertexOri[1]);
120 ori2d =
Vec2r(p - p0);
135 sv->setPoint(p[0] + noise[0], p[1] + noise[1]);
154 real ifactorCurvature,
155 real iFactorCurvatureDifference,
158 real iAnisoCurvature,
159 real iCarricatureFactor)
220 real ifactorCurvature,
221 real iFactorCurvatureDifference,
224 real iAnisoCurvature,
225 real iCarricatureFactor)
235 for (
int i = 0; i < nbIteration; ++i) {
246 return exp(-x * x / (sigma * sigma));
294 Vec2r BA, BC, normalCurvature;
301 normalCurvature = BA + BC;
326 normalCurvature = BA + BC;
346 const Vec2r p0((
v)->getPoint());
350 (
v)->setPoint(p[0], p[1]);
Class to define a pseudo Perlin noise.
Pseudo-random number generator.
Iterators used to iterate over the elements of the Stroke.
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMVert * v
CalligraphicShader(real iMinThickness, real iMaxThickness, const Vec2f &iOrientation, bool clamp)
virtual int shade(Stroke &ioStroke) const
real turbulenceLinear(real x, uint nbOctave=8)
real turbulenceSmooth(real x, uint nbOctave=8)
void smooth(int nbIterations, real iFactorPoint, real ifactorCurvature, real iFactorCurvatureDifference, real iAnisoPoint, real iAnisoNormal, real iAnisoCurvature, real icarricatureFactor)
Smoother(Stroke &ioStroke)
real _factorCurvatureDifference
real _factorCurvatureDifference
virtual int shade(Stroke &ioStroke) const
SmoothingShader(int iNbIteration, real iFactorPoint, real ifactorCurvature, real iFactorCurvatureDifference, real iAnisoPoint, real iAnisoNormal, real iAnisoCurvature, real icarricatureFactor)
virtual int shade(Stroke &ioStroke) const
SpatialNoiseShader(float iAmount, float ixScale, int nbOctave, bool smooth, bool pureRandom)
void setThickness(float tr, float tl)
void setColor(float r, float g, float b)
float strokeLength() const
const StrokeAttribute & attribute() const
virtual Interface0DIterator verticesBegin()
int vertices_size() const
StrokeInternal::StrokeVertexIterator strokeVerticesEnd()
StrokeInternal::StrokeVertexIterator strokeVerticesBegin(float t=0.0f)
Vec< T, N > & normalizeSafe()
Vec< T, N > & normalize()
smooth(Type::VEC3, "P") .flat(Type out_color storage_buf(0, Qualifier::READ, "Surfel", "surfels_buf[]") .push_constant(Type smooth(Type::VEC4, "interp_color")
ccl_device_inline float2 fabs(const float2 a)
ccl_device_inline float3 exp(float3 v)
VecMat::Vec2< real > Vec2r
static const real M_EPSILON
static const uint NB_VALUE_NOISE
static real edgeStopping(real x, real sigma)
ccl_device_inline int clamp(int a, int mn, int mx)