forked from bartvdbraak/blender
Fix #30049: cycles noise texture producing nan values with some
texture coordinates, due to int overflow. Also minor tweak in shader code to avoid copying uninitialized values, should have no effect though because they were not used.
This commit is contained in:
parent
b67b1c8564
commit
4a427a441b
@ -368,12 +368,13 @@ __device int shader_bsdf_sample(KernelGlobals *kg, const ShaderData *sd,
|
||||
#else
|
||||
label = svm_bsdf_sample(sd, sc, randu, randv, &eval, omega_in, domega_in, pdf);
|
||||
#endif
|
||||
if(*pdf != 0.0f) {
|
||||
bsdf_eval_init(bsdf_eval, sc->type, eval*sc->weight, kernel_data.film.use_light_pass);
|
||||
|
||||
bsdf_eval_init(bsdf_eval, sc->type, eval*sc->weight, kernel_data.film.use_light_pass);
|
||||
|
||||
if(sd->num_closure > 1 && *pdf != 0.0f) {
|
||||
float sweight = sc->sample_weight;
|
||||
_shader_bsdf_multi_eval(sd, *omega_in, pdf, sampled, bsdf_eval, *pdf*sweight, sweight);
|
||||
if(sd->num_closure > 1) {
|
||||
float sweight = sc->sample_weight;
|
||||
_shader_bsdf_multi_eval(sd, *omega_in, pdf, sampled, bsdf_eval, *pdf*sweight, sweight);
|
||||
}
|
||||
}
|
||||
|
||||
return label;
|
||||
|
@ -84,8 +84,9 @@ __device uint phash(int kx, int ky, int kz, int3 p)
|
||||
|
||||
__device float floorfrac(float x, int* i)
|
||||
{
|
||||
*i = quick_floor(x);
|
||||
return x - *i;
|
||||
float f = floorf(x);
|
||||
*i = (int)f;
|
||||
return x - f;
|
||||
}
|
||||
|
||||
__device float fade(float t)
|
||||
|
Loading…
Reference in New Issue
Block a user