diff --git a/data/__internal/shaders/SimpleForward/SimpleForward.frag.glsl b/data/__internal/shaders/SimpleForward/SimpleForward.frag.glsl index 6000e5d..a809b61 100644 --- a/data/__internal/shaders/SimpleForward/SimpleForward.frag.glsl +++ b/data/__internal/shaders/SimpleForward/SimpleForward.frag.glsl @@ -4,6 +4,8 @@ in vec3 eyeNormal; in vec3 eyePosition; in vec2 texCoord; +uniform float opacity; + /* * Diffuse */ @@ -32,7 +34,7 @@ void main() vec3 N = normalize(eyeNormal); vec4 diffuseColor = diffuse(uv); - float alpha = diffuseColor.a; + float alpha = diffuseColor.a * opacity; fragColor = vec4(diffuseColor.rgb, alpha); } diff --git a/src/dagon/render/simple/shaders/simpleforward.d b/src/dagon/render/simple/shaders/simpleforward.d index b1210c6..003bf75 100644 --- a/src/dagon/render/simple/shaders/simpleforward.d +++ b/src/dagon/render/simple/shaders/simpleforward.d @@ -1,5 +1,5 @@ /* -Copyright (c) 2024 Timur Gafarov +Copyright (c) 2024-2025 Timur Gafarov Boost Software License - Version 1.0 - August 17th, 2003 Permission is hereby granted, free of charge, to any person or organization @@ -73,7 +73,7 @@ class SimpleForwardShader: Shader setParameter("normalMatrix", state.normalMatrix); setParameter("opacity", mat.opacity * state.opacity); - + setParameter("shadeless", mat.shadeless); setParameter("textureScale", mat.textureScale); // Diffuse