Hi fujimaru, unfortunately I don't speak japanese and google translate isn't making much sense, but i think you got the gist of it.
It just means that one needs to be careful with masks, since things like:
add vt0, vt1.x
will alter vt0's y z and w components as well, but:
add vt0.x, vt1.x
should only change vt0.x (at least that's my current assumption, shaders are hard to debug...)
It commented in Japanese, and I felt sorry for having been now.
automatic translation usage.
Although he may seldom be able to understand,
add vt2, vt0.x, vt1.x
[[01 00 00 00 ][02 00 0f 02 ][00 00 00 00000000 02 00 00 00 ][01 00 00 00 02 00 00 00 ]]
equal
add vt2.xyzw, vt0.xxxx, vt1.xxxx
[[01 00 00 00 ][02 00 0f 02 ][00 00 00 00000000 02 00 00 00 ][01 00 00 00 02 00 00 00 ]]
I also take care about a mask.
Embed
/**
* Copyright yonatan ( http://wonderfl.net/user/yonatan )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/wsTO
*/
// forked from yonatan's it's a knot
// forked from keim_at_Si's Metallic soft cube
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.text.*;
import com.adobe.utils.*;
import com.bit101.components.*;
public class main extends TextArea {
private var asm:AGALMiniAssembler = new AGALMiniAssembler();
function main() {
var a:String = <agal><![CDATA[
mul vt0, vt0, vc9.yyy
add v1, vt0, vc9.yyy
]]></agal>;
var b:String = <agal><![CDATA[
mul vt0.xyzw, vt0.xyzw, vc9.y
add v1, vt0, vc9.y
]]></agal>;
width = height = 465;
var aa:ByteArray = asm.assemble("vertex", a);
var bb:ByteArray = asm.assemble("vertex", b);
var i:int;
var same:Boolean = true;
if(aa.length == bb.length) {
for(i=0; i<aa.length; i++) {
text += aa[i] + "\t" + bb[i] + "\n";
same &&= aa[i] == bb[i];
}
text =
"Shader A:" + a +
"\nShader B:" + b +
"\n" + (same ? "Compiled shaders are identical" : "Compiled shaders differ") + "\n" +
text;
}
}
}
}