浏览代码

Add BlendAdd

trethaller 7 年之前
父节点
当前提交
944c59a940
共有 3 个文件被更改,包括 4 次插入1 次删除
  1. 1 0
      h2d/BlendMode.hx
  2. 1 1
      h3d/mat/Material.hx
  3. 2 0
      h3d/mat/Pass.hx

+ 1 - 0
h2d/BlendMode.hx

@@ -4,6 +4,7 @@ enum BlendMode {
 	None;
 	Alpha;
 	Add;
+	BlendAdd;
 	SoftAdd;
 	Multiply;
 	Erase;

+ 1 - 1
h3d/mat/Material.hx

@@ -131,7 +131,7 @@ class Material extends BaseMaterial {
 			case Alpha:
 				mainPass.depthWrite = true;
 				mainPass.setPassName("alpha");
-			case Add, SoftAdd, Multiply, Erase, Screen:
+			case Add, BlendAdd, SoftAdd, Multiply, Erase, Screen:
 				mainPass.depthWrite = false;
 				mainPass.setPassName("additive");
 			}

+ 2 - 0
h3d/mat/Pass.hx

@@ -86,6 +86,8 @@ class Pass implements hxd.impl.Serializable {
 			blend(SrcAlpha, OneMinusSrcAlpha);
 		case Add:
 			blend(SrcAlpha, One);
+		case BlendAdd:
+			blend(One, OneMinusSrcAlpha);
 		case SoftAdd:
 			blend(OneMinusDstColor, One);
 		case Multiply: