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 Aug 15, 2024
1 parent 1dede61 commit a6e65e2
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 @@ -141,6 +141,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 @@ -97,6 +97,7 @@ struct HdEmbree_LightData
GfVec3f color;
HdEmbree_LightTexture texture;
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 @@ -383,7 +383,9 @@ _EvalIES(HdEmbree_LightData const& light, GfVec3f const& wI)
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 a6e65e2

Please sign in to comment.