! Samples the power cosine distribution. */
| 138 | |
| 139 | /*! Samples the power cosine distribution. */ |
| 140 | inline void sample(const PowerCosineDistribution& This, const Vec3fa& wo, const Vec3fa& N, Sample3f &wi, const Vec2f s) |
| 141 | { |
| 142 | Vec3fa dir = powerCosineSampleHemisphere(This.exp,s); |
| 143 | Sample3f wh; |
| 144 | wh.v = frame(N) * dir; |
| 145 | wh.pdf = powerCosineSampleHemispherePDF(dir,This.exp); |
| 146 | Sample3f r = make_Sample3f(reflect(wo,wh.v),1.0f); |
| 147 | wi = make_Sample3f(r.v,wh.pdf/(4.0f*abs(dot(wo,wh.v)))); |
| 148 | } |
| 149 | |
| 150 | /*! Samples the power cosine distribution. */ |
| 151 | #if defined(ISPC) |
no test coverage detected