what's the agal tex syntax?

486 views Asked by At

Here is the syntax I've read

tex t a b - Samples the texture in b (which should be one of the fs registers) at the coordinates in a, putting the resulting colour in t.

but In some opensource project code I found someone wrote tex like this:

tex ft0.xyzw vi0.xyzw fs0 <fLinear,mLinear,clamp,2d,rgba,b:45>//what's the bias:45?

and this

tex ft3, v3, fs0<2d, linear, miplinear,dxt1>//what is dxt1, are there any like this?

which really confusing me about what stuff I can put in <> it seems no order requirement

thanks for any hints

1

There are 1 answers

0
Conduit On BEST ANSWER

I can only guess as to the meanings of those other flags - they aren't in any of the documentation I've seen, and definitely aren't in the stock version of AGALMiniAssembler. My gut feeling is that they're likely used by an extended version of AGALMiniAssembler created for use with a specific Flash package (like Starling or Away3D). I'd stick with the well-documented texture flags - see the pdf linked at the end of my post.

As for the order, you are correct - order does not matter when passing tags to the tex function, assuming you are using the basic version of AGALMiniAssembler provided by Adobe.

The reason for this is relatively simple: every tag used by a single 'tex' operation is represented by a single 64-bit field when the operation is converted into bytecode. Order doesn't matter since the different tags will occupy different bits within the field. You will still have trouble when two tags that occupy the same portion of the field are used at the same time - "nearest" and "linear" for example, or "mipnearest" and "nomip" (note the conflicting behavior between these instructions!).

Check out this pdf if you want to see the ops that are implemented in the current, non-beta versions of Flash, or if you want to look any further into how bytecode is assembled before being passed to the shaders.