13.08.2012 Views

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>ACTIONSCRIPT</strong> 3.0 DEVELOPER’S GUIDE<br />

Adobe Graphics Assembly Language (AGAL)<br />

Name Opcode Operation Description<br />

m34 0x19 multiply matrix 3x4 destination.x = (source1.x * source2[0].x) + (source1.y * source2[0].y)<br />

+ (source1.z * source2[0].z) + (source1.w * source2[0].w)<br />

kil 0x27 kill/discard<br />

(fragm<strong>en</strong>t shader<br />

only)<br />

tex 0x28 texture sample<br />

(fragm<strong>en</strong>t shader<br />

only)<br />

Destination field format<br />

The [destination] field is 32 bits in size:<br />

31.............................0<br />

----TTTT----MMMMNNNNNNNNNNNNNNNN<br />

T = Register type (4 bits)<br />

M = Write mask (4 bits)<br />

N = Register number (16 bits)<br />

- = undefined, must be 0<br />

Source field format<br />

The [source] field is 64 bits in size:<br />

63.............................................................0<br />

D-------------QQ----IIII----TTTTSSSSSSSSOOOOOOOONNNNNNNNNNNNNNNN<br />

D = Direct=0/Indirect=1 for direct Q and I are ignored, 1bit<br />

Q = Index register compon<strong>en</strong>t select (2 bits)<br />

I = Index register type (4 bits)<br />

T = Register type (4 bits)<br />

S = Swizzle (8 bits, 2 bits per compon<strong>en</strong>t)<br />

O = Indirect offset (8 bits)<br />

N = Register number (16 bits)<br />

- = undefined, must be 0<br />

destination.y = (source1.x * source2[1].x) + (source1.y * source2[1].y)<br />

+ (source1.z * source2[1].z) + (source1.w * source2[1].w)<br />

destination.z = (source1.x * source2[2].x) + (source1.y * source2[2].y)<br />

+ (source1.z * source2[2].z) + (source1.w * source2[2].w)<br />

(produces only a 3 compon<strong>en</strong>t result, destination must be masked to<br />

.xyz or less)<br />

If single scalar source compon<strong>en</strong>t is less than zero, fragm<strong>en</strong>t is<br />

discarded and not drawn to the frame buffer. (Destination register<br />

must be set to all 0)<br />

destination equals load from texture source2 at coordinates source1.<br />

In this case, source2 must be in sampler format.<br />

sge 0x29 set-if-greater-equal destination = source1 >= source2 ? 1 : 0, compon<strong>en</strong>t-wise<br />

slt 0x2a set-if-less-than destination = source1 < source2 ? 1 : 0, compon<strong>en</strong>t-wise<br />

seq 0x2c set-if-equal destination = source1 == source2 ? 1 : 0, compon<strong>en</strong>t-wise<br />

sne 0x2d set-if-not-equal destination = source1 != source2 ? 1 : 0, compon<strong>en</strong>t-wise<br />

Last updated 6/6/2012<br />

1125

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!