Cleanup for Cycles hair shader ifdefs.
sc->T and sc->data2 were behind __HAIR__ ifdef, now they are not anymore, so we can always assign the correct value.
This commit is contained in:
parent
bf0a001e61
commit
a2366a3a2e
|
@ -54,13 +54,8 @@ ccl_device int bsdf_hair_transmission_setup(ShaderClosure *sc)
|
|||
|
||||
ccl_device float3 bsdf_hair_reflection_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf)
|
||||
{
|
||||
#ifdef __HAIR__
|
||||
float offset = sc->data2;
|
||||
float3 Tg = sc->T;
|
||||
#else
|
||||
float offset = 0.0f;
|
||||
float3 Tg = make_float3(1.0f, 0.0f, 0.0f);
|
||||
#endif
|
||||
float roughness1 = sc->data0;
|
||||
float roughness2 = sc->data1;
|
||||
|
||||
|
@ -112,13 +107,8 @@ ccl_device float3 bsdf_hair_reflection_eval_transmit(const ShaderClosure *sc, co
|
|||
|
||||
ccl_device float3 bsdf_hair_transmission_eval_transmit(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf)
|
||||
{
|
||||
#ifdef __HAIR__
|
||||
float offset = sc->data2;
|
||||
float3 Tg = sc->T;
|
||||
#else
|
||||
float offset = 0.0f;
|
||||
float3 Tg = make_float3(1.0f, 0.0f, 0.0f);
|
||||
#endif
|
||||
float roughness1 = sc->data0;
|
||||
float roughness2 = sc->data1;
|
||||
float Iz = dot(Tg, I);
|
||||
|
@ -158,13 +148,8 @@ ccl_device float3 bsdf_hair_transmission_eval_transmit(const ShaderClosure *sc,
|
|||
|
||||
ccl_device int bsdf_hair_reflection_sample(const ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 *domega_in_dy, float *pdf)
|
||||
{
|
||||
#ifdef __HAIR__
|
||||
float offset = sc->data2;
|
||||
float3 Tg = sc->T;
|
||||
#else
|
||||
float offset = 0.0f;
|
||||
float3 Tg = make_float3(1.0f, 0.0f, 0.0f);
|
||||
#endif
|
||||
float roughness1 = sc->data0;
|
||||
float roughness2 = sc->data1;
|
||||
float Iz = dot(Tg, I);
|
||||
|
@ -213,13 +198,8 @@ ccl_device int bsdf_hair_reflection_sample(const ShaderClosure *sc, float3 Ng, f
|
|||
|
||||
ccl_device int bsdf_hair_transmission_sample(const ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 *domega_in_dy, float *pdf)
|
||||
{
|
||||
#ifdef __HAIR__
|
||||
float offset = sc->data2;
|
||||
float3 Tg = sc->T;
|
||||
#else
|
||||
float offset = 0.0f;
|
||||
float3 Tg = make_float3(1.0f, 0.0f, 0.0f);
|
||||
#endif
|
||||
float roughness1 = sc->data0;
|
||||
float roughness2 = sc->data1;
|
||||
float Iz = dot(Tg, I);
|
||||
|
|
|
@ -153,26 +153,16 @@ BSDF_CLOSURE_CLASS_BEGIN(HairReflection, hair_reflection, hair_reflection, LABEL
|
|||
CLOSURE_FLOAT3_PARAM(HairReflectionClosure, sc.N),
|
||||
CLOSURE_FLOAT_PARAM(HairReflectionClosure, sc.data0),
|
||||
CLOSURE_FLOAT_PARAM(HairReflectionClosure, sc.data1),
|
||||
#ifdef __HAIR__
|
||||
CLOSURE_FLOAT3_PARAM(HairReflectionClosure, sc.T),
|
||||
CLOSURE_FLOAT_PARAM(HairReflectionClosure, sc.data2),
|
||||
#else
|
||||
CLOSURE_FLOAT3_PARAM(HairReflectionClosure, sc.N),
|
||||
CLOSURE_FLOAT_PARAM(HairReflectionClosure, sc.data1),
|
||||
#endif
|
||||
BSDF_CLOSURE_CLASS_END(HairReflection, hair_reflection)
|
||||
|
||||
BSDF_CLOSURE_CLASS_BEGIN(HairTransmission, hair_transmission, hair_transmission, LABEL_GLOSSY)
|
||||
CLOSURE_FLOAT3_PARAM(HairTransmissionClosure, sc.N),
|
||||
CLOSURE_FLOAT_PARAM(HairTransmissionClosure, sc.data0),
|
||||
CLOSURE_FLOAT_PARAM(HairTransmissionClosure, sc.data1),
|
||||
#ifdef __HAIR__
|
||||
CLOSURE_FLOAT3_PARAM(HairReflectionClosure, sc.T),
|
||||
CLOSURE_FLOAT_PARAM(HairReflectionClosure, sc.data2),
|
||||
#else
|
||||
CLOSURE_FLOAT3_PARAM(HairReflectionClosure, sc.N),
|
||||
CLOSURE_FLOAT_PARAM(HairReflectionClosure, sc.data1),
|
||||
#endif
|
||||
BSDF_CLOSURE_CLASS_END(HairTransmission, hair_transmission)
|
||||
|
||||
VOLUME_CLOSURE_CLASS_BEGIN(VolumeHenyeyGreenstein, henyey_greenstein, LABEL_VOLUME_SCATTER)
|
||||
|
|
Loading…
Reference in New Issue