123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- // Do not edit.
- import { ShaderStore } from "../../Engines/shaderStore.js";
- import "./decalFragment.js";
- const name = "pbrBlockAlbedoOpacity";
- const shader = `struct albedoOpacityOutParams
- {vec3 surfaceAlbedo;float alpha;};
- #define pbr_inline
- void albedoOpacityBlock(
- in vec4 vAlbedoColor,
- #ifdef ALBEDO
- in vec4 albedoTexture,
- in vec2 albedoInfos,
- #endif
- #ifdef OPACITY
- in vec4 opacityMap,
- in vec2 vOpacityInfos,
- #endif
- #ifdef DETAIL
- in vec4 detailColor,
- in vec4 vDetailInfos,
- #endif
- #ifdef DECAL
- in vec4 decalColor,
- in vec4 vDecalInfos,
- #endif
- out albedoOpacityOutParams outParams
- )
- {vec3 surfaceAlbedo=vAlbedoColor.rgb;float alpha=vAlbedoColor.a;
- #ifdef ALBEDO
- #if defined(ALPHAFROMALBEDO) || defined(ALPHATEST)
- alpha*=albedoTexture.a;
- #endif
- #ifdef GAMMAALBEDO
- surfaceAlbedo*=toLinearSpace(albedoTexture.rgb);
- #else
- surfaceAlbedo*=albedoTexture.rgb;
- #endif
- surfaceAlbedo*=albedoInfos.y;
- #endif
- #ifndef DECAL_AFTER_DETAIL
- #include<decalFragment>
- #endif
- #if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
- surfaceAlbedo*=vColor.rgb;
- #endif
- #ifdef DETAIL
- float detailAlbedo=2.0*mix(0.5,detailColor.r,vDetailInfos.y);surfaceAlbedo.rgb=surfaceAlbedo.rgb*detailAlbedo*detailAlbedo;
- #endif
- #ifdef DECAL_AFTER_DETAIL
- #include<decalFragment>
- #endif
- #define CUSTOM_FRAGMENT_UPDATE_ALBEDO
- #ifdef OPACITY
- #ifdef OPACITYRGB
- alpha=getLuminance(opacityMap.rgb);
- #else
- alpha*=opacityMap.a;
- #endif
- alpha*=vOpacityInfos.y;
- #endif
- #if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)
- alpha*=vColor.a;
- #endif
- #if !defined(SS_LINKREFRACTIONTOTRANSPARENCY) && !defined(ALPHAFRESNEL)
- #ifdef ALPHATEST
- #if DEBUGMODE != 88
- if (alpha<ALPHATESTVALUE)
- discard;
- #endif
- #ifndef ALPHABLEND
- alpha=1.0;
- #endif
- #endif
- #endif
- outParams.surfaceAlbedo=surfaceAlbedo;outParams.alpha=alpha;}
- `;
- // Sideeffect
- ShaderStore.IncludesShadersStore[name] = shader;
- /** @internal */
- export const pbrBlockAlbedoOpacity = { name, shader };
- //# sourceMappingURL=pbrBlockAlbedoOpacity.js.map
|