(fix)fix cos_weight pdf
Signed-off-by:mousechannel MoCheng <mochenghh@gmail.com> Signed-off-by: MoCheng <mochenghh@gmail.com>
This commit is contained in:
parent
8d4ba64b18
commit
ebf0838233
1 changed files with 5 additions and 4 deletions
|
|
@ -110,11 +110,12 @@ 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);
|
||||
|
||||
// Probability of the newRay (cosine distributed)
|
||||
const float p = cos_theta / M_PI;
|
||||
|
||||
vec3 albedo = mat.pbrBaseColorFactor.xyz;
|
||||
if(mat.pbrBaseColorTexture > -1)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue