Cleanup: Code style.
This commit is contained in:
parent
8dd055cd47
commit
bc160d8a85
Notes:
blender-bot
2023-02-14 09:12:03 +01:00
Referenced by issue #44514, Crash under cycles rendering using F12 Referenced by issue #44515, Smoke domain cuts out shadows of smoke from intersecting objects when working with different layers for compositing (CYCLES)
|
@ -70,7 +70,7 @@ ccl_device float3 bsdf_ashikhmin_shirley_eval_reflect(const ShaderClosure *sc, c
|
|||
float out = 0.0f;
|
||||
|
||||
if(fmaxf(sc->data0, sc->data1) <= 1e-4f)
|
||||
return make_float3(0, 0, 0);
|
||||
return make_float3(0.0f, 0.0f, 0.0f);
|
||||
|
||||
if(NdotI > 0.0f && NdotO > 0.0f) {
|
||||
NdotI = fmaxf(NdotI, 1e-6f);
|
||||
|
|
|
@ -59,7 +59,7 @@ ccl_device float3 bsdf_ashikhmin_velvet_eval_reflect(const ShaderClosure *sc, co
|
|||
float cosHO = fabsf(dot(I, H));
|
||||
|
||||
if(!(fabsf(cosNH) < 1.0f-1e-5f && cosHO > 1e-5f))
|
||||
return make_float3(0, 0, 0);
|
||||
return make_float3(0.0f, 0.0f, 0.0f);
|
||||
|
||||
float cosNHdivHO = cosNH / cosHO;
|
||||
cosNHdivHO = fmaxf(cosNHdivHO, 1e-5f);
|
||||
|
@ -80,7 +80,7 @@ ccl_device float3 bsdf_ashikhmin_velvet_eval_reflect(const ShaderClosure *sc, co
|
|||
return make_float3(out, out, out);
|
||||
}
|
||||
|
||||
return make_float3(0, 0, 0);
|
||||
return make_float3(0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
ccl_device float3 bsdf_ashikhmin_velvet_eval_transmit(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf)
|
||||
|
|
|
@ -277,7 +277,7 @@ ccl_device float3 bsdf_microfacet_ggx_eval_reflect(const ShaderClosure *sc, cons
|
|||
float3 N = sc->N;
|
||||
|
||||
if(m_refractive || fmaxf(alpha_x, alpha_y) <= 1e-4f)
|
||||
return make_float3(0, 0, 0);
|
||||
return make_float3(0.0f, 0.0f, 0.0f);
|
||||
|
||||
float cosNO = dot(N, I);
|
||||
float cosNI = dot(N, omega_in);
|
||||
|
@ -356,7 +356,7 @@ ccl_device float3 bsdf_microfacet_ggx_eval_reflect(const ShaderClosure *sc, cons
|
|||
return make_float3(out, out, out);
|
||||
}
|
||||
|
||||
return make_float3(0, 0, 0);
|
||||
return make_float3(0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
ccl_device float3 bsdf_microfacet_ggx_eval_transmit(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf)
|
||||
|
@ -368,13 +368,13 @@ ccl_device float3 bsdf_microfacet_ggx_eval_transmit(const ShaderClosure *sc, con
|
|||
float3 N = sc->N;
|
||||
|
||||
if(!m_refractive || fmaxf(alpha_x, alpha_y) <= 1e-4f)
|
||||
return make_float3(0, 0, 0);
|
||||
return make_float3(0.0f, 0.0f, 0.0f);
|
||||
|
||||
float cosNO = dot(N, I);
|
||||
float cosNI = dot(N, omega_in);
|
||||
|
||||
if(cosNO <= 0 || cosNI >= 0)
|
||||
return make_float3(0, 0, 0); /* vectors on same side -- not possible */
|
||||
return make_float3(0.0f, 0.0f, 0.0f); /* vectors on same side -- not possible */
|
||||
|
||||
/* compute half-vector of the refraction (eq. 16) */
|
||||
float3 ht = -(m_eta * omega_in + I);
|
||||
|
@ -627,7 +627,7 @@ ccl_device float3 bsdf_microfacet_beckmann_eval_reflect(const ShaderClosure *sc,
|
|||
float3 N = sc->N;
|
||||
|
||||
if(m_refractive || fmaxf(alpha_x, alpha_y) <= 1e-4f)
|
||||
return make_float3(0, 0, 0);
|
||||
return make_float3(0.0f, 0.0f, 0.0f);
|
||||
|
||||
float cosNO = dot(N, I);
|
||||
float cosNI = dot(N, omega_in);
|
||||
|
@ -709,7 +709,7 @@ ccl_device float3 bsdf_microfacet_beckmann_eval_reflect(const ShaderClosure *sc,
|
|||
return make_float3(out, out, out);
|
||||
}
|
||||
|
||||
return make_float3(0, 0, 0);
|
||||
return make_float3(0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
ccl_device float3 bsdf_microfacet_beckmann_eval_transmit(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf)
|
||||
|
@ -721,13 +721,13 @@ ccl_device float3 bsdf_microfacet_beckmann_eval_transmit(const ShaderClosure *sc
|
|||
float3 N = sc->N;
|
||||
|
||||
if(!m_refractive || fmaxf(alpha_x, alpha_y) <= 1e-4f)
|
||||
return make_float3(0, 0, 0);
|
||||
return make_float3(0.0f, 0.0f, 0.0f);
|
||||
|
||||
float cosNO = dot(N, I);
|
||||
float cosNI = dot(N, omega_in);
|
||||
|
||||
if(cosNO <= 0 || cosNI >= 0)
|
||||
return make_float3(0, 0, 0);
|
||||
return make_float3(0.0f, 0.0f, 0.0f);
|
||||
|
||||
/* compute half-vector of the refraction (eq. 16) */
|
||||
float3 ht = -(m_eta * omega_in + I);
|
||||
|
|
|
@ -147,14 +147,14 @@ public: \
|
|||
\
|
||||
float3 eval_reflect(const float3 &omega_out, const float3 &omega_in, float& pdf) const \
|
||||
{ \
|
||||
pdf = 0; \
|
||||
return make_float3(0, 0, 0); \
|
||||
pdf = 0.0f; \
|
||||
return make_float3(0.0f, 0.0f, 0.0f); \
|
||||
} \
|
||||
\
|
||||
float3 eval_transmit(const float3 &omega_out, const float3 &omega_in, float& pdf) const \
|
||||
{ \
|
||||
pdf = 0; \
|
||||
return make_float3(0, 0, 0); \
|
||||
pdf = 0.0f; \
|
||||
return make_float3(0.0f, 0.0f, 0.0f); \
|
||||
} \
|
||||
\
|
||||
int sample(const float3 &Ng, \
|
||||
|
|
|
@ -162,8 +162,8 @@ void Camera::update()
|
|||
transform_perspective(&rastertocamera, make_float3(0, 0, 0));
|
||||
}
|
||||
else {
|
||||
dx = make_float3(0, 0, 0);
|
||||
dy = make_float3(0, 0, 0);
|
||||
dx = make_float3(0.0f, 0.0f, 0.0f);
|
||||
dy = make_float3(0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
dx = transform_direction(&cameratoworld, dx);
|
||||
|
|
|
@ -33,7 +33,7 @@ ShaderInput::ShaderInput(ShaderNode *parent_, const char *name_, ShaderSocketTyp
|
|||
name = name_;
|
||||
type = type_;
|
||||
link = NULL;
|
||||
value = make_float3(0, 0, 0);
|
||||
value = make_float3(0.0f, 0.0f, 0.0f);
|
||||
stack_offset = SVM_STACK_INVALID;
|
||||
default_value = NONE;
|
||||
usage = USE_ALL;
|
||||
|
|
Loading…
Reference in New Issue