summaryrefslogtreecommitdiffstats
path: root/src/main/java/dev/figboot/cuberender/state/BlendMode.java
diff options
context:
space:
mode:
authorLibravatar bigfoot547 <[email protected]>2024-06-14 22:29:45 -0500
committerLibravatar bigfoot547 <[email protected]>2024-06-14 22:29:45 -0500
commit2b43b48607989c31f82c1a7861beeaa09148ca30 (patch)
tree54d66e4baaadc1296d51e1391a6e29e859601e51 /src/main/java/dev/figboot/cuberender/state/BlendMode.java
parentallow translation using 4x4 matrices (diff)
transparency is fixed also capes
Diffstat (limited to 'src/main/java/dev/figboot/cuberender/state/BlendMode.java')
-rw-r--r--src/main/java/dev/figboot/cuberender/state/BlendMode.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/dev/figboot/cuberender/state/BlendMode.java b/src/main/java/dev/figboot/cuberender/state/BlendMode.java
index 0c30998..1c1acf4 100644
--- a/src/main/java/dev/figboot/cuberender/state/BlendMode.java
+++ b/src/main/java/dev/figboot/cuberender/state/BlendMode.java
@@ -12,9 +12,9 @@ public enum BlendMode {
float pAlphaFactor = prev.w * (1 - inOutColor.w);
float aOut = inOutColor.w + pAlphaFactor;
- inOutColor.x = (inOutColor.x + prev.x * pAlphaFactor) / aOut;
- inOutColor.y = (inOutColor.y + prev.y * pAlphaFactor) / aOut;
- inOutColor.z = (inOutColor.z + prev.z * pAlphaFactor) / aOut;
+ inOutColor.x = (inOutColor.x * inOutColor.w + prev.x * pAlphaFactor) / aOut;
+ inOutColor.y = (inOutColor.y * inOutColor.w + prev.y * pAlphaFactor) / aOut;
+ inOutColor.z = (inOutColor.z * inOutColor.w + prev.z * pAlphaFactor) / aOut;
inOutColor.w = aOut;
});