mirror of
https://github.com/overte-org/overte.git
synced 2025-04-06 22:32:57 +02:00
put back stepping in translucent case
This commit is contained in:
parent
5371fd613a
commit
f55c4b8b12
2 changed files with 9 additions and 4 deletions
|
@ -223,10 +223,13 @@ vec3 fetchLightMap(vec2 uv) {
|
|||
}
|
||||
<@endfunc@>
|
||||
|
||||
<@func evalMaterialOpacity(fetchedOpacity, materialOpacity, opacity)@>
|
||||
<@func evalMaterialOpacity(fetchedOpacity, materialOpacityCutoff, materialOpacity, matKey, opacity)@>
|
||||
{
|
||||
// This path only valid for transparent material
|
||||
<$opacity$> = <$materialOpacity$> * <$fetchedOpacity$>;
|
||||
<$opacity$> = mix(<$fetchedOpacity$>,
|
||||
step(<$materialOpacityCutoff$>, <$fetchedOpacity$>),
|
||||
float((<$matKey$> & OPACITY_MASK_MAP_BIT) != 0))
|
||||
* <$materialOpacity$>;
|
||||
}
|
||||
<@endfunc@>
|
||||
|
||||
|
|
|
@ -103,8 +103,9 @@ void main(void) {
|
|||
<$fetchMaterialTexturesCoord0(matKey, _texCoord0, albedoTex)$>
|
||||
|
||||
<@if HIFI_USE_TRANSLUCENT@>
|
||||
float cutoff = getMaterialOpacityCutoff(mat);
|
||||
float opacity = getMaterialOpacity(mat) * _color.a;
|
||||
<$evalMaterialOpacity(albedoTex.a, opacity, opacity)$>;
|
||||
<$evalMaterialOpacity(albedoTex.a, cutoff, opacity, matKey, opacity)$>;
|
||||
<$discardInvisible(opacity)$>;
|
||||
<@else@>
|
||||
float cutoff = getMaterialOpacityCutoff(mat);
|
||||
|
@ -154,8 +155,9 @@ void main(void) {
|
|||
<@endif@>
|
||||
|
||||
<@if HIFI_USE_TRANSLUCENT@>
|
||||
float cutoff = getMaterialOpacityCutoff(mat);
|
||||
float opacity = getMaterialOpacity(mat) * _color.a;
|
||||
<$evalMaterialOpacity(albedoTex.a, opacity, opacity)$>;
|
||||
<$evalMaterialOpacity(albedoTex.a, cutoff, opacity, matKey, opacity)$>;
|
||||
<$discardInvisible(opacity)$>;
|
||||
<@else@>
|
||||
float cutoff = getMaterialOpacityCutoff(mat);
|
||||
|
|
Loading…
Reference in a new issue