You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// the interaction here is the interaction at the illuminator-end of the ray, not the receiver
69
-
vec3 irr_glsl_light_deferred_eval_and_prob(outfloat pdf, infloat intersectionT, in irr_glsl_AnisotropicViewSurfaceInteraction interaction, in Light light)
70
-
{
71
-
// we don't have to worry about solid angle of the light w.r.t. surface of the light because this function only ever gets called from closestHit routine, so such ray cannot be produced
72
-
pdf = scene_getLightChoicePdf(light);
73
-
74
-
Triangle tri = triangles[Light_getObjectID(light)];
75
-
#if TRIANGLE_METHOD==0
76
-
pdf *= intersectionT*intersectionT/abs(dot(Triangle_getNormalTimesArea(tri),interaction.isotropic.V.dir));
77
-
#elif TRIANGLE_METHOD==1
78
-
//pdf /= Triangle_getSolidAngle(tri),origin);
79
-
#elif TRIANGLE_METHOD==2
80
-
pdf /= Triangle_getApproxProjSolidAngle(tri,origin,interaction.isotropic.V.dir);
// The sides are denoted by lower-case letters a, b, and c. On the unit sphere their lengths are numerically equal to the radian measure of the angles that the great circle arcs subtend at the centre. The sides of proper spherical triangles are (by convention) less than PI
// these variables might eventually get optimized out
95
+
cosC = cos_sides[2];
96
+
cscB = csc_sides[1];
97
+
113
98
// Both vertices and angles at the vertices are denoted by the same upper case letters A, B, and C. The angles A, B, C of the triangle are equal to the angles between the planes that intersect the surface of the sphere or, equivalently, the angles between the tangent vectors of the great circle arcs where they meet at the vertices. Angles are in radians. The angles of proper spherical triangles are (by convention) less than PI
114
-
constvec3 cos_vertices = (cos_sides-cos_sides.yzx*cos_sides.zxy)*csc_sides.yzx*csc_sides.zxy; // using Spherical Law of Cosines
// Both vertices and angles at the vertices are denoted by the same upper case letters A, B, and C. The angles A, B, C of the triangle are equal to the angles between the planes that intersect the surface of the sphere or, equivalently, the angles between the tangent vectors of the great circle arcs where they meet at the vertices. Angles are in radians. The angles of proper spherical triangles are (by convention) less than PI
135
+
vec3 cos_vertices,sin_vertices;
117
136
// get solid angle, which is also the reciprocal of the probability
118
-
{
119
-
// sorry about the naming of `something` I just can't seem to be able to give good name to the variables that is consistent with semantics
// End-of @Crisspl move this to `irr/builtin/glsl/shapes/triangle.glsl`
160
+
161
+
// the interaction here is the interaction at the illuminator-end of the ray, not the receiver
162
+
vec3 irr_glsl_light_deferred_eval_and_prob(outfloat pdf, invec3 origin, infloat intersectionT, in irr_glsl_AnisotropicViewSurfaceInteraction interaction, in Light light)
163
+
{
164
+
// we don't have to worry about solid angle of the light w.r.t. surface of the light because this function only ever gets called from closestHit routine, so such ray cannot be produced
165
+
pdf = scene_getLightChoicePdf(light);
166
+
167
+
Triangle tri = triangles[Light_getObjectID(light)];
168
+
#if TRIANGLE_METHOD==0
169
+
pdf *= intersectionT*intersectionT/abs(dot(Triangle_getNormalTimesArea(tri),interaction.isotropic.V.dir));
0 commit comments