|
|
|
|
|
|
void ImportanceSamplePunctualLight(float rndVal, float3 lightPosition, |
|
|
|
float3 rayOrigin, float3 rayDirection, |
|
|
|
float tMin, float tMax, |
|
|
|
out float dist, out float rSq, out float rcpPdf) |
|
|
|
out float dist, out float rSq, out float rcpPdf, |
|
|
|
float minDistSq = FLT_EPS) |
|
|
|
float rayToLightDistSq = max(originToLightDistSq - originToLightProj * originToLightProj, FLT_EPS); |
|
|
|
float rayToLightDistSq = max(originToLightDistSq - originToLightProj * originToLightProj, minDistSq); |
|
|
|
|
|
|
|
float a = tMin - originToLightProj; |
|
|
|
float b = tMax - originToLightProj; |
|
|
|