Ver código fonte

Temp fix for rects not drawing

Karl Zylinski 7 meses atrás
pai
commit
ce69726714
1 arquivos alterados com 8 adições e 1 exclusões
  1. 8 1
      shader.hlsl

+ 8 - 1
shader.hlsl

@@ -21,5 +21,12 @@ vs_out vs_main(vs_in input) {
 	return output;
 }
 float4 ps_main(vs_out input) : SV_TARGET {
-	return tex.Sample(smp, input.uv) * input.color;
+	float4 c = tex.Sample(smp, input.uv);
+
+	// TODO this is a hack because we don't have a "rectangle drawing texture".
+	if (c.r == 0 && c.g == 0 && c.b == 0 && c.a == 0) {
+		return input.color;
+	}
+
+	return c * input.color;
 }