没有合适的资源?快使用搜索试试~ 我知道了~
Adobe AGAL Reference Card
4星 · 超过85%的资源 需积分: 9 28 下载量 128 浏览量
2011-04-02
10:46:53
上传
评论 1
收藏 167KB PDF 举报
温馨提示
试读
5页
Flash 3D开发Adoebe AGAL (Adobe Graphics Assembly Language) 参考文档。
资源推荐
资源详情
资源评论
AGAL Reference Card
The secret language for Flash 3D
by Marco Scabia
iFLash3D
http://iFLash3D.com! ! Copyright 2011 - All Rights Reserved
AGAL OpCodes 1
memory
mov
destination = source1
move data from source1 to destination
arithmetic
add
destination = source1 + source2
add two registers, component-wise
sub
destination = source1 - source2
subract two registers, component-wise
mul
destination = source1 * source2
multiply two registers, component-wise
div
destination = source1 / source2
division betwen two registers, component-wise
rcp
destination = 1 / source1
reciprocal of one register, component-wise
frc
destination = source1 - (float)floor(source1)
fractional part of one register, component-wise
neg
destination = - source1
negation of one register, component-wise
trigonometric
sin
destination = sin(source1)
sine function of one regsiter, component-wise
cos
destination = cos(source1)
cosine function of one register, component-wise
algebraic
min
destination = min(source1, source2)
minimum between two registers, component-
wise
max
destination = max(source1, source2)
maximum between two registers, component-
wise
sqt
destination = sqrt(source1)
square root of one register, component-wise
rsq
destination = 1 / sqrt(source1)
reciprocal of square root of one register,
component-wise
pow
destination = pow(source1, source2)
elevate source1 register to the power of
source2, component-wise
log
destination = log2(source1)
base 2 logarithm of one register, component-
wise
exp
destination = 2^source1
2-based exponentional function of one register,
component-wise
nrm
destination = normalize(source1)
normalize one register to length of 1
abs
destination = abs(source1)
absolute value of one register, component-wise
sat
destination = max(min(source1,1),0)
clamp one register in the range (0,1),
component-wise
AGAL Registers
Attribute Registers
VertexBuffer input to Vertex Shaders
syntax: va<n>
quantity: 8
Vertex Shader only
Constant Registers
Pass parameters from Actionscript to Shaders
syntax
Vertex Shaders: vc<n>
Pixel Shaders: fc<n>
quantity
Vertex Shaders: 128
Pixel Shaders: 28
Temporary Registers
For use by Shaders. Temporary data
syntax
Vertex Shaders: vt<n>
Pixel Shaders: ft<n>
quantity
Vertex Shaders: 8
Pixel Shaders: 8
Varying Registers
Pass data from Vertex Shader to Pixel Shader
syntax: v<n>
quantity: 8
Texture Samplers
pick texture color value at UV coordinates
syntax: ft<n> <flag1, flag2, ...>
quantity: 8
Pixel Shader only
flags
mip mapping
mipnone
nomip
mipnearest
miplinear
texture size
2d
3d
cube
filtering
nearest
linear
texture repeat
repeat
wrap
clamp
Output Registers
Output of Shaders
Vertex: clip space position
Pixel: pixel color
syntax
Vertex Shaders: op
Pixel Shaders: oc
quantity
Vertex Shaders: 1
Pixel Shaders: 1
AGAL Overview
AGAL related Actionscript
Create Shader
Context3D::createProgram
Upload to GPU
Program3D::upload
Program3D::dispose
Enable Shader
Context3D::setProgram
Write to Constant Registers
Context3D::setProgramConstantsFromVector
Context3D::setProgramConstantsFromMatrix
Enable Texture
Context3D::setTexture
AGAL OpCode Syntax
<opcode> <destination> <source 1> <source 2
or sampler>
资源评论
- wangmeng89012012-10-08不错啊,找了好久,挺清晰的,初学agal很有用
- macro7762013-03-07基本上整理了一遍,不过要注意毕竟不是完整参考
- latency0292012-06-25不是很详细,适合入门的时候看看……
suwenyin
- 粉丝: 2
- 资源: 11
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功