Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hdEmbree] add support for inputs:diffuse #15

Open
wants to merge 1 commit into
base: pr/hdEmbree-double-sided-mesh
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -412,7 +412,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