@@ -233,6 +233,42 @@ HdEmbree_Light::Sync(HdSceneDelegate *sceneDelegate,
233
233
_lightData.shaping .coneSoftness = value.UncheckedGet <float >();
234
234
}
235
235
236
+ if (const auto value = sceneDelegate->GetLightParamValue (
237
+ id, HdLightTokens->shapingIesFile );
238
+ value.IsHolding <SdfAssetPath>()) {
239
+ SdfAssetPath iesAssetPath = value.UncheckedGet <SdfAssetPath>();
240
+ std::string iesPath = iesAssetPath.GetResolvedPath ();
241
+ if (iesPath.empty ()) {
242
+ iesPath = iesAssetPath.GetAssetPath ();
243
+ }
244
+
245
+ if (!iesPath.empty ()) {
246
+ std::ifstream in (iesPath);
247
+ if (!in.is_open ()) {
248
+ TF_WARN (" could not open ies file %s" , iesPath.c_str ());
249
+ } else {
250
+ std::stringstream buffer;
251
+ buffer << in.rdbuf ();
252
+
253
+ if (!_lightData.shaping .ies .iesFile .load (buffer.str ())) {
254
+ TF_WARN (" could not load ies file %s" , iesPath.c_str ());
255
+ }
256
+ }
257
+ }
258
+ }
259
+
260
+ if (const auto value = sceneDelegate->GetLightParamValue (
261
+ id, HdLightTokens->shapingIesNormalize );
262
+ value.IsHolding <bool >()) {
263
+ _lightData.shaping .ies .normalize = value.UncheckedGet <bool >();
264
+ }
265
+
266
+ if (const auto value = sceneDelegate->GetLightParamValue (
267
+ id, HdLightTokens->shapingIesAngleScale );
268
+ value.IsHolding <float >()) {
269
+ _lightData.shaping .ies .angleScale = value.UncheckedGet <float >();
270
+ }
271
+
236
272
_PopulateRtcLight (device, scene);
237
273
238
274
HdEmbreeRenderer *renderer = embreeRenderParam->GetRenderer ();
0 commit comments