mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-04-24 00:21:06 +00:00
Added texture flags to shader
This commit is contained in:
parent
2adc7fa247
commit
fa140c18cc
2 changed files with 21 additions and 1 deletions
|
@ -673,6 +673,7 @@ bool FShader::Bind(int textureMode, int texFlags, int blendFlags, bool twoDFog,
|
|||
{
|
||||
FString variantConfig = "\n";
|
||||
variantConfig.AppendFormat("#define DEF_TEXTURE_MODE %d\n", textureMode);
|
||||
variantConfig.AppendFormat("#define DEF_TEXTURE_FLAGS %d\n", texFlags);
|
||||
variantConfig.AppendFormat("#define DEF_BLEND_FLAGS %d\n", blendFlags);
|
||||
variantConfig.AppendFormat("#define DEF_FOG_2D %d\n", twoDFog);
|
||||
variantConfig.AppendFormat("#define DEF_FOG_ENABLED %d\n", fogEnabled);
|
||||
|
|
|
@ -269,7 +269,26 @@ float spotLightAttenuation(vec4 lightpos, vec3 spotdir, float lightCosInnerAngle
|
|||
|
||||
void SetMaterialProps(inout Material material, vec2 texCoord)
|
||||
{
|
||||
material.Base = getTexel(texCoord.st);
|
||||
material.Base = getTexel(texCoord.st);
|
||||
|
||||
#if (DEF_TEXTURE_FLAGS & 0x1)
|
||||
material.Bright = texture(brighttexture, texCoord.st);
|
||||
#endif
|
||||
|
||||
#if (DEF_TEXTURE_FLAGS & 0x2)
|
||||
{
|
||||
vec4 Detail = texture(detailtexture, texCoord.st * uDetailParms.xy) * uDetailParms.z;
|
||||
material.Base *= Detail;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if (DEF_TEXTURE_FLAGS & 0x4)
|
||||
{
|
||||
material.Glow = texture(glowtexture, texCoord.st);
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
|
Loading…
Reference in a new issue