在项目开发中,经常有一些需要使用任务或者书签,Flashbuilder中可以手动设定标记,但又一个缺点,在多人开发中,这些标记无法方便的共享.
有一种方式就是使用注释来实现同样的标注功能,Flashbuilder4.5中有一个选项(如下图),坑爹FlashBuilder,坑爹的任务标签。。竟然不支持AS。
无奈之下,找到一个好用的插件Flash Builder Task Plugin 1.0.0(下图),使用注释的方式做任务标记。
在项目开发中,经常有一些需要使用任务或者书签,Flashbuilder中可以手动设定标记,但又一个缺点,在多人开发中,这些标记无法方便的共享.
有一种方式就是使用注释来实现同样的标注功能,Flashbuilder4.5中有一个选项(如下图),坑爹FlashBuilder,坑爹的任务标签。。竟然不支持AS。
无奈之下,找到一个好用的插件Flash Builder Task Plugin 1.0.0(下图),使用注释的方式做任务标记。
还记得MAX大会上的案例么?
最新发布的player11中,很多API有些调整和变动,Vibo用最新的API重新还原了大会上的演示:
package
{
import com.adobe.utils.AGALMiniAssembler;
import flash.display.Sprite;
import flash.display.Stage3D;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.display3D.*;
import flash.events.Event;
import flash.geom.Matrix3D;
import flash.geom.Rectangle;
/**
* Molehill 演示 Hello World!!
* @author Vibo
* @email vibo_cn@hotmail.com
*/
public class ExampleFlash11 extends Sprite
{
private var _stage3D:Stage3D;
public var context3D:Context3D;
public var vertexbuffer:VertexBuffer3D;//顶点缓冲区
public var indexbuffer:IndexBuffer3D;//索引缓冲区
public var program:Program3D;
protected var _vertexShader:String = [
"m44 op, va0, vc0", // multiply vertex by modelViewProjection
"mov v0, va1" // copy the vertex color
].join("\n");
protected var _fragmentShader:String = [
"mov oc, v0" // output the fragment color
].join("\n");
public function ExampleFlash11()
{
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
//
//
trace("stage3Ds length:",stage.stage3Ds.length,"wmodeGPU:"+stage.wmodeGPU);
_stage3D = stage.stage3Ds[0];
_stage3D.viewPort = new Rectangle(0, 0, 688, 528);
_stage3D.addEventListener(Event.CONTEXT3D_CREATE, onContext3DUpdate);
_stage3D.requestContext3D();
//
}
public function onContext3DUpdate(e:Event):void
{
trace("3D支持创建..")
//
_stage3D.removeEventListener(Event.CONTEXT3D_CREATE, onContext3DUpdate);
//创建 Context3D
context3D = _stage3D.context3D;
if (context3D) {
trace("显卡驱动信息:\n",context3D.driverInfo);
//Context3D设置
context3D.enableErrorChecking = true;
context3D.configureBackBuffer(688, 528, 1, true);
//创建索引缓冲区
var indexVector:Vector.<uint> = Vector.<uint>([ 0, 1, 2 ]);
indexbuffer = context3D.createIndexBuffer(3);
indexbuffer.uploadFromVector(indexVector, 0, 3);
trace("vertexVector length:"+indexVector.length);
//创建一个顶点缓冲区
var vertexVector:Vector.<Number> = Vector.<Number>([// x , y , z , r , g , b
-1,-1,0,255/255,0,0,
0,1,0, 0,255/255,0,
1,-1,0, 0,0,255/255
])
vertexbuffer =context3D.createVertexBuffer(3, 6);//行,列
vertexbuffer.uploadFromVector(vertexVector, 0, 3);
trace("vertexVector length:"+vertexVector.length);
//设置顶点流
//设定 va0 为 x,y,z
context3D.setVertexBufferAt(0, vertexbuffer, 0, Context3DVertexBufferFormat.FLOAT_3);
//设定 va1 为 r,g,b
context3D.setVertexBufferAt(1, vertexbuffer, 3, Context3DVertexBufferFormat.FLOAT_3);
//完成初始化
var av:AGALMiniAssembler = new AGALMiniAssembler();
av.assemble(Context3DProgramType.VERTEX,_vertexShader);
var af:AGALMiniAssembler = new AGALMiniAssembler();
af.assemble(Context3DProgramType.FRAGMENT,_fragmentShader);
//
program = context3D.createProgram();
program.upload(av.agalcode, af.agalcode);
//
this.addEventListener(Event.ENTER_FRAME,onRenderFrame);
}else {
throw new Error("Rendering context lost!");
return;
}
}
public function onRenderFrame(e:Event):void
{
//清除
context3D.clear(0, 0, 0, 1);
//设置
context3D.setProgram(program);
//设置程序的常量
var viewMatrix:Matrix3D = new Matrix3D();
context3D.setProgramConstantsFromMatrix(Context3DProgramType.VERTEX, 0, viewMatrix, true);
//绘制
context3D.drawTriangles(indexbuffer, 0, 1);
//显示
context3D.present();
}
}
}
还在为安装和配置Alchemy发愁吗?Alchemy Repack版本发布解除这个问题.
Features
- Auto installation of files, Shorcuts, and cie
- Choice of installation destination
- Generating user passwd and group files
- Generating user profile bashrc
- Auto setup of Alchemy paths
- Auto config Alchemy and link LLVM
- Windows Full Paths navigation (Helper fx)
- Fast compiler functions (Helpers fx)
- Clean on/off (Clear tempory files .as, .abc, .o, ..) Default = on

《Adobe图形汇编语言》
来自官方参考文档,记录一下,方便查看..
———————
Program bytecode can be created using the Pixel Bender 3D offline tools. It can also be created dynamically. This specification describes the raw bytecode format.
The input ByteArrays are in Endian.LITTLE_ENDIAN format.
Type Description
int8 8 bit little endian integer
int16 16 bit little endian integer
int32 32 bit little endian integer
Header: Bytecode always begins with this 7 byte header:
Offset(Bytes) Size(Bytes) Name Description
0 1 magic must be 0xa0
1 4 version must be 1
5 1 shadertypeid must be 0xa1
6 1 shadertype either 0 for vertex or 1 for fragment programs
Tokens: The header is immediately followed by any number of tokens. Every
token is 192bits (24 bytes) in size and always has the format:
[opcode][destination][source1][source2 or sampler]
[操作码] [目标] [source1] [source2或采样器]
Unused fields must be set to 0.
[opcode]
The [opcode] field is 32 bits in size and can take one of these values:
Name Value Description 名称 值 说明 mov 0x00 move move data from source1 to destination, componentwise add 0x01 add destination = source1 + source2, componentwise sub 0x02 subtract destination = source1 - source2, componentwise mul 0x03 multiply destination = source1 * source2, componentwise div 0x04 divide destination = source1 / source2, componentwise rcp 0x05 reciprocal destination = 1/source1, componentwise min 0x06 minimum destination = minimum(source1,source2), componentwise max 0x07 maximum destination = maximum(source1,source2), componentwise frc 0x08 fractional destination = source1 - (float)floor(source1), componentwise sqt 0x09 square root destination = sqrt(source1), componentwise rsq 0x0a recip. root destination = 1/sqrt(source1), componentwise pow 0x0b power destination = pow(source1,source2), componentwise log 0x0c logarithm destination = log_2(source1), componentwise exp 0x0d exponential destination = 2^source1, componentwise nrm 0x0e normalize destination = normalize(source1), componentwise sin 0x0f sine destination = sin(source1), componentwise cos 0x10 cosine destination = cos(source1), componentwise crs 0x11 cross product destination.x = source1.y * source2.z - source1.z * source2.y destination.y = source1.z * source2.x - source1.x * source2.z destination.z = source1.x * source2.y - source1.y * source2.x dp3 0x12 dot product destination = source1.x*source2.x + source1.y*source2.y + source1.z*source2.z dp4 0x13 dot product destination = source1.x*source2.x + source1.y*source2.y + source1.z*source2.z + source1.w*source2.w abs 0x14 absolute destination = abs(source1), componentwise neg 0x15 negate destination = -source1, componentwise sat 0x16 saturate destination = maximum(minimum(source1,1),0), componentwise m33 0x17 multiply destination.x = (source1.x * source2[0].x) + (source1.y * source2[0].y) + (source1.z * source2[0].z) matrix 3x3 destination.y = (source1.x * source2[1].x) + (source1.y * source2[1].y) + (source1.z * source2[1].z) destination.z = (source1.x * source2[2].x) + (source1.y * source2[2].y) + (source1.z * source2[2].z) m44 0x18 multiply destination.x = (source1.x * source2[0].x) + (source1.y * source2[0].y) + (source1.z * source2[0].z) + (source1.w * source2[0].w) matrix 4x4 destination.y = (source1.x * source2[1].x) + (source1.y * source2[1].y) + (source1.z * source2[1].z) + (source1.w * source2[1].w) destination.z = (source1.x * source2[2].x) + (source1.y * source2[2].y) + (source1.z * source2[2].z) + (source1.w * source2[2].w) destination.w = (source1.x * source2[3].x) + (source1.y * source2[3].y) + (source1.z * source2[3].z) + (source1.w * source2[3].w) m34 0x19 multiply destination.x = (source1.x * source2[0].x) + (source1.y * source2[0].y) + (source1.z * source2[0].z) + (source1.w * source2[0].w) matrix 3x4 destination.y = (source1.x * source2[1].x) + (source1.y * source2[1].y) + (source1.z * source2[1].z) + (source1.w * source2[1].w) destination.z = (source1.x * source2[2].x) + (source1.y * source2[2].y) + (source1.z * source2[2].z) + (source1.w * source2[2].w) kil 0x27 kill / discard (fragment shader only) If single scalar source component is less than zero, fragment is discarded and not drawn to the frame buffer. The destination register must be all 0. tex 0x28 texture sample (fragment shader only) destination = load from texture source2 at coordinates source1. In this source2 must be in sampler format. sge 0x29 set-if-greater-equal destination = source1 >= source2 ? 1 : 0, componentwise slt 0x2a set-if-less-than destination = source1 < source2 ? 1 : 0, componentwise
[destination]
The [destination] field is 32 bits in size:
31………………………..0
—-TTTT—-MMMMNNNNNNNNNNNNNNNN
T = Register type (4 bits)
M = Write mask (4 bits)
N = Register number (16 bits)
- = undefined, must be 0
[source]
The [source] field is 64 bits in size:
63…………………………………………………….0
D————-QQ—-IIII—-TTTTSSSSSSSSOOOOOOOONNNNNNNNNNNNNNNN
D = Direct=0/Indirect=1 for direct Q and I are ignored, 1bit (currently only direct allowed)
Q = Index register component select (2 bits)
I = Index register type (4 bits)
T = Register type (4 bits)
S = Swizzle (8bits, 2bits per component)
O = Indirect offset (8bits)
N = Register number (16 bits)
- = undefined, must be 0
[sampler]
The second source of the tex opcode must be in [sampler] format:
63…………………………………………………….0
FFFFMMMMWWWWSSSSDDDD——–TTTT—————-NNNNNNNNNNNNNNNN
N = Sampler index (16 bits)
T = Register type, must be 5, Sampler
F = Filter (0=nearest,1=linear) (4bits)
M = Mipmap (0=disable,1=nearest,2=linear)
W = Wrapping (0=clamp,1=repeat)
S = Special flag bits (must be 0)
D = Dimension (0=2D,1=Cube)
The following register types are available:
Name Value Count/Fragment Count/Vertex Usage Attribute 0 n/a 8 input using Context3D::setVertexBufferAt Constant 1 28 128 input using Context3D::setProgramConstants family of functions Temporary 2 8 8 temporary for computation, not visible outside program Output 3 1 1 vertex: clipspace position, fragment: color Varying 4 8 8 output from vertex, input to fragment, transfer interpolated data Sampler 5 8 n/a read texture, set using Context3D::setTextureAt
已经支持Molehill的3D引擎:
Check 2D animation with the display list (check your CPU usage)
Check 2D animation with Molehill (check your CPU usage)
基于 Molehill开发的游戏:
开发环境配置:
1.下载playerglobal.swc(下载后重命名);
2.配置SDK: 放置playerglobal.swc到[sdk目录]\frameworks\libs\player\player11.0
3.发布SWF设置wmode:”direct”;设置发布版本号为11.0.编译参数添加-swf-version=13
API文档:下载>>>
安装地址:http://www.o-minds.com/products/flashfirebug
安装方法(Firefox环境):
亮点功能:
1.直接编辑属性
2.显示树状结构
3.错误,警告和调试信息输出面板
有个缺点是中文调试信息是乱码。
Adobe Flash Player 10.2已经放出
1.Stage Video硬件加速
2.IE9下支持硬件加速
3.自定义鼠标
4.多显示器全屏支持
近期评论