Skip to content

Commit

Permalink
[hdEmbree] add support for inputs:diffuse
Browse files Browse the repository at this point in the history
  • Loading branch information
pmolodo committed Oct 23, 2024
1 parent 2559f99 commit 13bf404
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pxr/imaging/plugin/hdEmbree/light.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ HdEmbree_Light::Sync(HdSceneDelegate *sceneDelegate,
// Store luminance parameters
_lightData.intensity = sceneDelegate->GetLightParamValue(
id, HdLightTokens->intensity).GetWithDefault(1.0f);
_lightData.diffuse = sceneDelegate->GetLightParamValue(
id, HdLightTokens->diffuse).GetWithDefault(1.0f);
_lightData.exposure = sceneDelegate->GetLightParamValue(
id, HdLightTokens->exposure).GetWithDefault(0.0f);
_lightData.color = sceneDelegate->GetLightParamValue(
Expand Down
1 change: 1 addition & 0 deletions pxr/imaging/plugin/hdEmbree/light.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ struct HdEmbree_LightData
GfMatrix4f xformWorldToLight;
GfVec3f color;
float intensity = 1.0f;
float diffuse = 1.0f;
float exposure = 0.0f;
float colorTemperature = 6500.0f;
bool enableColorTemperature = false;
Expand Down
4 changes: 3 additions & 1 deletion pxr/imaging/plugin/hdEmbree/renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,9 @@ _SampleCylinder(GfMatrix4f const& xf, GfMatrix3f const& normalXform,
GfVec3f
_EvalLightBasic(HdEmbree_LightData const& light)
{
GfVec3f Le = light.color * light.intensity * powf(2.0f, light.exposure);
// Our current material model is always 100% diffuse, so diffuse parameter
// is a stright multiplier
GfVec3f Le = light.color * light.intensity * light.diffuse * powf(2.0f, light.exposure);
if (light.enableColorTemperature) {
Le = GfCompMult(Le,
_BlackbodyTemperatureAsRgb(light.colorTemperature));
Expand Down

0 comments on commit 13bf404

Please sign in to comment.