Use material sampling.
This commit is contained in:
parent
616741d7dd
commit
c48475ca52
1 changed files with 4 additions and 4 deletions
|
|
@ -161,9 +161,9 @@ Vec3fa Application1::renderPixelNextEventEstimation(float x, float y, const ISPC
|
||||||
|
|
||||||
/* sample BRDF at hit point */
|
/* sample BRDF at hit point */
|
||||||
Vec2f uv = RandomSampler_get2D(sampler);
|
Vec2f uv = RandomSampler_get2D(sampler);
|
||||||
Sample3f wi = cosineSampleHemisphere(uv.x, uv.y, sample.Ng);
|
Sample3f wi;
|
||||||
|
|
||||||
Vec3fa diffuse = Material__eval(material_array, matId, brdf, wo, sample, wi.v);
|
Vec3fa diffuse = Material__sample(material_array, matId, brdf, Lw, wo, sample, wi, uv);
|
||||||
|
|
||||||
Lw *= M_PI * diffuse;
|
Lw *= M_PI * diffuse;
|
||||||
|
|
||||||
|
|
@ -226,9 +226,9 @@ Vec3fa Application1::renderPixelPathTracer(float x, float y, const ISPCCamera& c
|
||||||
/* sample BRDF at hit point */
|
/* sample BRDF at hit point */
|
||||||
|
|
||||||
Vec2f uv = RandomSampler_get2D(sampler);
|
Vec2f uv = RandomSampler_get2D(sampler);
|
||||||
Sample3f wi = cosineSampleHemisphere(uv.x, uv.y, sample.Ng);
|
Sample3f wi;
|
||||||
|
|
||||||
Vec3fa diffuse = Material__eval(material_array, matId, brdf, wo, sample, wi.v);
|
Vec3fa diffuse = Material__sample(material_array, matId, brdf, Lw, wo, sample, wi, uv);
|
||||||
|
|
||||||
Lw *= M_PI * diffuse;
|
Lw *= M_PI * diffuse;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue