1 // Copyright 2009-2021 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 
4 #include "Luminous.h"
5 // ispc
6 #include "render/materials/Luminous_ispc.h"
7 
8 namespace ospray {
9 namespace pathtracer {
10 
Luminous()11 Luminous::Luminous()
12 {
13   ispcEquivalent = ispc::PathTracer_Luminous_create();
14 }
15 
toString() const16 std::string Luminous::toString() const
17 {
18   return "ospray::pathtracer::Luminous";
19 }
20 
commit()21 void Luminous::commit()
22 {
23   const vec3f radiance =
24       getParam<vec3f>("color", vec3f(1.f)) * getParam<float>("intensity", 1.f);
25   const float transparency = getParam<float>("transparency", 0.f);
26 
27   ispc::PathTracer_Luminous_set(
28       getIE(), (const ispc::vec3f &)radiance, transparency);
29 }
30 
31 } // namespace pathtracer
32 } // namespace ospray
33