diff --git a/Components/Hlms/Pbs/src/OgreHlmsJsonPbs.cpp b/Components/Hlms/Pbs/src/OgreHlmsJsonPbs.cpp index 657b083cbf0..4aeeda0fed6 100644 --- a/Components/Hlms/Pbs/src/OgreHlmsJsonPbs.cpp +++ b/Components/Hlms/Pbs/src/OgreHlmsJsonPbs.cpp @@ -368,6 +368,10 @@ namespace Ogre changeBlendblock ); } + itor = json.FindMember( "refraction_strength" ); + if( itor != json.MemberEnd() && itor->value.IsNumber() ) + pbsDatablock->setRefractionStrength( static_cast( itor->value.GetDouble() ) ); + itor = json.FindMember( "clear_coat" ); if( itor != json.MemberEnd() && itor->value.IsObject() ) { @@ -837,6 +841,9 @@ namespace Ogre outString += "\n\t\t\t}"; } + outString += ",\n\t\t\t\"refraction_strength\" : "; + outString += StringConverter::toString( pbsDatablock->getRefractionStrength() ); + if( pbsDatablock->getClearCoat() != 0.0f ) { outString += ",\n\t\t\t\"clear_coat\" :\n\t\t\t{"; diff --git a/Docs/2.0/JSON/PbsAllSettings.json b/Docs/2.0/JSON/PbsAllSettings.json index f7a35ad2528..6844652d0eb 100644 --- a/Docs/2.0/JSON/PbsAllSettings.json +++ b/Docs/2.0/JSON/PbsAllSettings.json @@ -63,6 +63,7 @@ including invalid combinations (i.e. having a Metallic texture and a Specular te "shadow_const_bias" : 0.01, "two_sided" : false, "receive_shadows" : true, + "refraction_strength" : 0.2, "workflow" : "specular_ogre" "specular_fresnel" "metallic", diff --git a/Docs/src/manual/HlmsPBSDatablockReference.md b/Docs/src/manual/HlmsPBSDatablockReference.md index 908f91e2755..1ba792350cb 100644 --- a/Docs/src/manual/HlmsPBSDatablockReference.md +++ b/Docs/src/manual/HlmsPBSDatablockReference.md @@ -79,6 +79,12 @@ Reference Guide: HLMS PBS Datablock {#hlmspbsdatablockref} - If switching from the 'default' BRDF implementation, the scene will be too bright. If so, divide light power by PI. - **DEFAULT="default"** +## Parameter: refraction_strength + +- Value of type float +- See Ogre::HlmsPbsDatablock::setRefractionStrength +- **DEFAULT=0.075** + ## Parameter: detail_diffuse[X] {#dbParamDetailDiffuse} - Name of the detail map to be used on top of the diffuse colour - Can contain up to 4 detail_diffuse blocks (`detail_diffuse0` to `detail_diffuse3`) @@ -263,6 +269,8 @@ Reference Guide: HLMS PBS Datablock {#hlmspbsdatablockref} "macroblock" : "macroblock_name", "macroblock" : ["macroblock_name", "macroblock_name_for_shadows"], "shadow_const_bias" : 0.01, + + "refraction_strength" : 0.2, "brdf" : "default", "detail_diffuse0" :