@@ -4,15 +4,8 @@ private class CopyShader extends h3d.shader.ScreenShader {
static var SRC = {
@param var texture : Sampler2D;
-
- var pixelColor : Vec4;
- function __init__fragment() {
- pixelColor = texture.get(calculatedUV);
- }
function fragment() {
- output.color = pixelColor;
+ pixelColor = texture.get(calculatedUV);
}
@@ -13,8 +13,13 @@ class ScreenShader extends hxsl.Shader {
color : Vec4,
};
+ var pixelColor : Vec4;
var calculatedUV : Vec2;
+ function __init__() {
+ output.color = pixelColor;
+ }
+
function vertex() {
calculatedUV = input.uv;
output.position = vec4(input.position, 0, 1);