Code cleanup / Cycles: Remove some unused hair code.
This commit is contained in:
@@ -1071,9 +1071,10 @@ ccl_device_inline float3 curvepoint(float t, float3 p0, float3 p1, float3 p2, fl
|
|||||||
return data[0] * p0 + data[1] * p1 + data[2] * p2 + data[3] * p3;
|
return data[0] * p0 + data[1] * p1 + data[2] * p2 + data[3] * p3;
|
||||||
}
|
}
|
||||||
|
|
||||||
ccl_device_inline float3 bvh_curve_refine(KernelGlobals *kg, ShaderData *sd, const Intersection *isect, const Ray *ray, float t)
|
ccl_device_inline float3 bvh_curve_refine(KernelGlobals *kg, ShaderData *sd, const Intersection *isect, const Ray *ray)
|
||||||
{
|
{
|
||||||
int flag = kernel_data.curve.curveflags;
|
int flag = kernel_data.curve.curveflags;
|
||||||
|
float t = isect->t;
|
||||||
float3 P = ray->P;
|
float3 P = ray->P;
|
||||||
float3 D = ray->D;
|
float3 D = ray->D;
|
||||||
|
|
||||||
|
@@ -75,14 +75,7 @@ ccl_device void shader_setup_from_ray(KernelGlobals *kg, ShaderData *sd,
|
|||||||
|
|
||||||
sd->shader = __float_as_int(curvedata.z);
|
sd->shader = __float_as_int(curvedata.z);
|
||||||
sd->segment = isect->segment;
|
sd->segment = isect->segment;
|
||||||
|
sd->P = bvh_curve_refine(kg, sd, isect, ray);
|
||||||
float tcorr = isect->t;
|
|
||||||
if(kernel_data.curve.curveflags & CURVE_KN_POSTINTERSECTCORRECTION) {
|
|
||||||
tcorr = (isect->u < 0)? tcorr + sqrtf(isect->v) : tcorr - sqrtf(isect->v);
|
|
||||||
sd->ray_length = tcorr;
|
|
||||||
}
|
|
||||||
|
|
||||||
sd->P = bvh_curve_refine(kg, sd, isect, ray, tcorr);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#endif
|
#endif
|
||||||
|
@@ -793,10 +793,9 @@ typedef enum CurveFlag {
|
|||||||
CURVE_KN_INTERPOLATE = 4, /* render as a curve? */
|
CURVE_KN_INTERPOLATE = 4, /* render as a curve? */
|
||||||
CURVE_KN_ACCURATE = 8, /* use accurate intersections test? */
|
CURVE_KN_ACCURATE = 8, /* use accurate intersections test? */
|
||||||
CURVE_KN_INTERSECTCORRECTION = 16, /* correct for width after determing closest midpoint? */
|
CURVE_KN_INTERSECTCORRECTION = 16, /* correct for width after determing closest midpoint? */
|
||||||
CURVE_KN_POSTINTERSECTCORRECTION = 32, /* correct for width after intersect? */
|
CURVE_KN_TRUETANGENTGNORMAL = 32, /* use tangent normal for geometry? */
|
||||||
CURVE_KN_TRUETANGENTGNORMAL = 64, /* use tangent normal for geometry? */
|
CURVE_KN_TANGENTGNORMAL = 64, /* use tangent normal for shader? */
|
||||||
CURVE_KN_TANGENTGNORMAL = 128, /* use tangent normal for shader? */
|
CURVE_KN_RIBBONS = 128, /* use flat curve ribbons */
|
||||||
CURVE_KN_RIBBONS = 256, /* use flat curve ribbons */
|
|
||||||
} CurveFlag;
|
} CurveFlag;
|
||||||
|
|
||||||
typedef struct KernelCurves {
|
typedef struct KernelCurves {
|
||||||
|
@@ -124,10 +124,8 @@ void CurveSystemManager::device_update(Device *device, DeviceScene *dscene, Scen
|
|||||||
|
|
||||||
if(line_method == CURVE_ACCURATE)
|
if(line_method == CURVE_ACCURATE)
|
||||||
kcurve->curveflags |= CURVE_KN_ACCURATE;
|
kcurve->curveflags |= CURVE_KN_ACCURATE;
|
||||||
if(line_method == CURVE_CORRECTED)
|
else if(line_method == CURVE_CORRECTED)
|
||||||
kcurve->curveflags |= CURVE_KN_INTERSECTCORRECTION;
|
kcurve->curveflags |= CURVE_KN_INTERSECTCORRECTION;
|
||||||
if(line_method == CURVE_POSTCORRECTED)
|
|
||||||
kcurve->curveflags |= CURVE_KN_POSTINTERSECTCORRECTION;
|
|
||||||
|
|
||||||
if(use_tangent_normal)
|
if(use_tangent_normal)
|
||||||
kcurve->curveflags |= CURVE_KN_TANGENTGNORMAL;
|
kcurve->curveflags |= CURVE_KN_TANGENTGNORMAL;
|
||||||
|
@@ -49,7 +49,6 @@ typedef enum curve_triangles {
|
|||||||
typedef enum curve_lines {
|
typedef enum curve_lines {
|
||||||
CURVE_ACCURATE,
|
CURVE_ACCURATE,
|
||||||
CURVE_CORRECTED,
|
CURVE_CORRECTED,
|
||||||
CURVE_POSTCORRECTED,
|
|
||||||
CURVE_UNCORRECTED
|
CURVE_UNCORRECTED
|
||||||
} curve_lines;
|
} curve_lines;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user