Returns the direct sun radiance for a direction on the skydome
| 72 | |
| 73 | // Returns the direct sun radiance for a direction on the skydome |
| 74 | static Float3 SampleSun(Float3 sampleDir) |
| 75 | { |
| 76 | Float3 res = 0.0f; |
| 77 | if(AppSettings::EnableSun) |
| 78 | { |
| 79 | float cosSunAngularRadius = std::cos(DegToRad(AppSettings::SunSize)); |
| 80 | Float3 sunDir = Float3::Normalize(AppSettings::SunDirection); |
| 81 | float cosGamma = Float3::Dot(sunDir, sampleDir); |
| 82 | if(cosGamma >= cosSunAngularRadius) |
| 83 | res = AppSettings::SunLuminance(); |
| 84 | } |
| 85 | |
| 86 | return res; |
| 87 | } |
| 88 | |
| 89 | // Checks if a hit triangle is back-facing |
| 90 | static bool IsTriangleBackFacing(const EmbreeRay& ray, const BVHData& bvhData) |
no test coverage detected