| 18 | |
| 19 | namespace ispc { |
| 20 | void HDRILight::set(bool isVisible, |
| 21 | const Instance *instance, |
| 22 | const vec3f &radianceScale, |
| 23 | const linear3f &light2world, |
| 24 | const Texture2D *map, |
| 25 | const Distribution2D *distribution) |
| 26 | { |
| 27 | super.isVisible = isVisible; |
| 28 | super.instance = instance; |
| 29 | #ifndef OSPRAY_TARGET_SYCL |
| 30 | super.sample = |
| 31 | reinterpret_cast<ispc::Light_SampleFunc>(ispc::HDRILight_sample_addr()); |
| 32 | super.eval = |
| 33 | reinterpret_cast<ispc::Light_EvalFunc>(ispc::HDRILight_eval_addr()); |
| 34 | #endif |
| 35 | |
| 36 | this->radianceScale = radianceScale; |
| 37 | this->map = map; |
| 38 | this->distribution = distribution; |
| 39 | |
| 40 | this->rcpSize = 1.f / this->map->size; |
| 41 | this->light2world = light2world; |
| 42 | |
| 43 | // Enable dynamic runtime instancing or apply static transformation |
| 44 | if (instance) { |
| 45 | if (instance->motionBlur) { |
| 46 | #ifndef OSPRAY_TARGET_SYCL |
| 47 | super.sample = reinterpret_cast<ispc::Light_SampleFunc>( |
| 48 | ispc::HDRILight_sample_instanced_addr()); |
| 49 | super.eval = reinterpret_cast<ispc::Light_EvalFunc>( |
| 50 | ispc::HDRILight_eval_instanced_addr()); |
| 51 | #endif |
| 52 | } else { |
| 53 | this->light2world = instance->xfm.l * this->light2world; |
| 54 | } |
| 55 | } |
| 56 | world2light = rcp(this->light2world); |
| 57 | } |
| 58 | } // namespace ispc |
| 59 | |
| 60 | namespace ospray { |
no outgoing calls
no test coverage detected