Merge pull request #56 from MouseChannel/fix_cos_weight_pdf
(fix)fix cos_weight pdf
This commit is contained in:
commit
c436c46141
1 changed files with 5 additions and 4 deletions
|
|
@ -110,12 +110,13 @@ void main()
|
|||
vec3 rayOrigin = world_position;
|
||||
vec3 rayDirection = samplingHemisphere(prd.seed, tangent, bitangent, world_normal);
|
||||
|
||||
// Probability of the newRay (cosine distributed)
|
||||
const float p = 1 / M_PI;
|
||||
|
||||
// Compute the BRDF for this ray (assuming Lambertian reflection)
|
||||
float cos_theta = dot(rayDirection, world_normal);
|
||||
vec3 albedo = mat.pbrBaseColorFactor.xyz;
|
||||
|
||||
// Probability of the newRay (cosine distributed)
|
||||
const float p = cos_theta / M_PI;
|
||||
|
||||
vec3 albedo = mat.pbrBaseColorFactor.xyz;
|
||||
if(mat.pbrBaseColorTexture > -1)
|
||||
{
|
||||
uint txtId = mat.pbrBaseColorTexture;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue