Skip to content

Commit

Permalink
Fixed CharacterCombine blend mode on metalness
Browse files Browse the repository at this point in the history
  • Loading branch information
fo76utils authored Sep 17, 2024
1 parent 786024b commit a68d778
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion res/shaders/stf_default.frag
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,11 @@ void main()
} else if ( blendMode == 4 ) {
// CharacterCombine: blend color, roughness and metalness multiplicatively
layerBaseMap = layerBaseMap * baseMap * 2.0;
layerPBRMap.rg = layerPBRMap.rg * pbrMap.rg * 2.0;
layerPBRMap.r = layerPBRMap.r * pbrMap.r * 2.0;
if ( layerPBRMap.g < 0.5 )
layerPBRMap.g = layerPBRMap.g * pbrMap.g;
else
layerPBRMap.g = layerPBRMap.g + pbrMap.g - layerPBRMap.g * pbrMap.g;
}
srcMask *= f;
float dstMask = 1.0 - ( blendMode != 1 ? srcMask : 0.0 );
Expand Down

0 comments on commit a68d778

Please sign in to comment.