Skip to content

Commit

Permalink
mc/gi: generate GLSL for material IOR
Browse files Browse the repository at this point in the history
  • Loading branch information
pablode committed May 26, 2024
1 parent 74d377f commit 4f65898
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/gi/src/GlslShaderGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ namespace gtl

bool GiGlslShaderGen::generateMaterialShadingGenInfo(const McMaterial& material, MaterialGenInfo& genInfo)
{
auto dfFlags = MC_DF_FLAG_SCATTERING | MC_DF_FLAG_VOLUME_ABSORPTION | MC_DF_FLAG_VOLUME_SCATTERING | MC_DF_FLAG_THIN_WALLED;
auto dfFlags = MC_DF_FLAG_SCATTERING | MC_DF_FLAG_VOLUME_ABSORPTION | MC_DF_FLAG_VOLUME_SCATTERING |
MC_DF_FLAG_THIN_WALLED | MC_DF_FLAG_IOR;

if (material.isEmissive)
{
Expand Down
3 changes: 2 additions & 1 deletion src/mc/include/Backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ namespace gtl
MC_DF_FLAG_VOLUME_ABSORPTION = (1 << 4),
MC_DF_FLAG_VOLUME_SCATTERING = (1 << 5),
MC_DF_FLAG_CUTOUT_OPACITY = (1 << 6),
MC_DF_FLAG_COUNT = 7
MC_DF_FLAG_IOR = (1 << 7),
MC_DF_FLAG_COUNT = 8
};

class McBackend
Expand Down
3 changes: 2 additions & 1 deletion src/mc/src/Backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ namespace gtl
mi::neuraylib::Target_function_description("thin_walled", "mdl_thin_walled"),
mi::neuraylib::Target_function_description("volume.absorption_coefficient", "mdl_volume_absorption_coefficient"),
mi::neuraylib::Target_function_description("volume.scattering_coefficient", "mdl_volume_scattering_coefficient"),
mi::neuraylib::Target_function_description("geometry.cutout_opacity", "mdl_cutout_opacity")
mi::neuraylib::Target_function_description("geometry.cutout_opacity", "mdl_cutout_opacity"),
mi::neuraylib::Target_function_description("ior", "mdl_ior")
};
const static char* MATERIAL_STATE_NAME = "State";

Expand Down

0 comments on commit 4f65898

Please sign in to comment.