56 const Light *light = id_cast<const Light *>(
object->data);
60 switch (light->
type) {
62 switch (light->area_shape) {
64 b.add(pxr::HdLightTokens->width, light->area_size);
65 b.add(pxr::HdLightTokens->height, light->area_size);
68 b.add(pxr::HdLightTokens->width, light->area_size);
69 b.add(pxr::HdLightTokens->height, light->area_sizey);
72 b.add(pxr::HdLightTokens->radius, light->area_size / 2.0f);
76 b.add(pxr::HdLightTokens->radius, (light->area_size + light->area_sizey) / 4.0f);
82 b.add(pxr::HdLightTokens->radius, light->radius);
83 if (light->radius == 0.0f) {
84 b.add(pxr::UsdLuxTokens->treatAsPoint,
true);
87 b.add(pxr::UsdLuxTokens->inputsShapingConeAngle,
RAD2DEGF(light->spotsize * 0.5f));
88 b.add(pxr::UsdLuxTokens->inputsShapingConeSoftness, light->spotblend);
92 b.add(pxr::HdLightTokens->
angle,
RAD2DEGF(light->sun_angle * 0.5f));
99 intensity = light->energy / 4.0f;
103 intensity = light->energy /
M_PI;
106 b.add(pxr::HdLightTokens->
color, pxr::GfVec3f(light->r, light->g, light->b));
107 b.add(pxr::HdLightTokens->enableColorTemperature, (light->mode &
LA_USE_TEMPERATURE) != 0);
108 b.add(pxr::HdLightTokens->colorTemperature, light->temperature);
109 b.add(pxr::HdLightTokens->intensity, intensity);
110 b.add(pxr::HdLightTokens->exposure, light->exposure);
111 b.add(pxr::HdLightTokens->diffuse, light->diff_fac);
112 b.add(pxr::HdLightTokens->specular, light->spec_fac);
119 const pxr::HdContainerDataSourceHandle &light_params,
123 pxr::HdContainerDataSourceHandle xform =
124 pxr::HdXformSchema::Builder()
125 .SetMatrix(pxr::HdRetainedTypedSampledDataSource<pxr::GfMatrix4d>::New(
transform))
126 .SetResetXformStack(pxr::HdRetainedTypedSampledDataSource<bool>::New(
false))
128 pxr::HdContainerDataSourceHandle visibility =
129 pxr::HdVisibilitySchema::Builder()
130 .SetVisibility(pxr::HdRetainedTypedSampledDataSource<bool>::New(visible))
134 b.add(pxr::HdLightSchema::GetSchemaToken(), light_params);
135 b.add(pxr::HdXformSchema::GetSchemaToken(), xform);
136 b.add(pxr::HdVisibilitySchema::GetSchemaToken(), visibility);
Map< const Object *, int > nonmesh_instance_count
pxr::SdfPath object_prim_id(const Object *object) const
void emit_object_prim(EmittedObject &emitted, const pxr::SdfPath &path, const pxr::TfToken &type, const pxr::HdContainerDataSourceHandle &ds, const pxr::GfMatrix4d &geometry_xform=pxr::GfMatrix4d(1.0))
pxr::SdfPath instance_clone_prim_id(const Object *source, int instance_index) const
void emit_prim(const pxr::SdfPath &path, const pxr::TfToken &type, const pxr::HdContainerDataSourceHandle &ds)