I am trying to get into shading with AGAL. I have set up a full screen quad to be drawn with shader programs, but I ran into something unexplainable.
I have these vertices
var vertices:Vector.<Number> = Vector.<Number>([
- 1, - 1, 0, - 1, - 1, 0,
+ 1, - 1, 0, + 1, - 1, 0,
- 1, + 1, 0, - 1, + 1, 0,
+ 1, + 1, 0, + 1, + 1, 0
]);
This pair of program works
vertexShaderAssembler.assemble(Context3DProgramType.VERTEX,
"mov op, va0\n" +
"mov v0, va1"
);
...
fragmentShaderAssembler.assemble(Context3DProgramType.FRAGMENT,
"mov oc, v0"
);
However this does not
vertexShaderAssembler.assemble(Context3DProgramType.VERTEX,
"mov op, va0\n" +
"mov v0, va0"
);
...
fragmentShaderAssembler.assemble(Context3DProgramType.FRAGMENT,
"mov oc, v0"
);
Any clue on why I have to pass the same values through va1 and why it does not work when vertices only have three coordiante?