- 闪存生成器 4.7
- 空中 SDK 3.5
- Away3D 4.0.9 金
- 模拟器 iOS SDK(5.0、5.1、6.1)
- iPhone 3GS 6.1
- 2.3.6 中的安卓设备
我尝试在 Flash Builder for Mobile(iOS、Android)中使用 Away3d 进行测试...
我无法在 iOS 模拟器、设备(iphone e android)中运行我的小测试,但是,我的代码在 Air Simulator 中运行 100%
我设置了 renderMode到 GPU、Direct 和 Auto,在所有情况下,只有 Air Simulator 运行代码
我错过了什么?
调试中显示的错误是:
Error: Error #3613: The native shader compilation failed.
at flash.display3D::Program3D/upload()
at away3d.core.managers::AGALProgram3DCache/setProgram3D()[/Users/robbateman/Documents/fdt5workspace/away3d-core-fp11/src/away3d/core/managers/AGALProgram3DCache.as:98]
at away3d.materials.passes::MaterialPassBase/updateProgram()[/Users/robbateman/Documents/fdt5workspace/away3d-core-fp11/src/away3d/materials/passes/MaterialPassBase.as:363]
at away3d.materials.passes::DefaultScreenPass/updateProgram()[/Users/robbateman/Documents/fdt5workspace/away3d-core-fp11/src/away3d/materials/passes/DefaultScreenPass.as:659]
at away3d.materials.passes::MaterialPassBase/activate()[/Users/robbateman/Documents/fdt5workspace/away3d-core-fp11/src/away3d/materials/passes/MaterialPassBase.as:261]
at away3d.materials.passes::DefaultScreenPass/activate()[/Users/robbateman/Documents/fdt5workspace/away3d-core-fp11/src/away3d/materials/passes/DefaultScreenPass.as:515]
at away3d.materials::MaterialBase/activatePass()[/Users/robbateman/Documents/fdt5workspace/away3d-core-fp11/src/away3d/materials/MaterialBase.as:352]
at away3d.core.render::DefaultRenderer/drawRenderables()[/Users/robbateman/Documents/fdt5workspace/away3d-core-fp11/src/away3d/core/render/DefaultRenderer.as:152]
at away3d.core.render::DefaultRenderer/draw()[/Users/robbateman/Documents/fdt5workspace/away3d-core-fp11/src/away3d/core/render/DefaultRenderer.as:102]
at away3d.core.render::RendererBase/executeRender()[/Users/robbateman/Documents/fdt5workspace/away3d-core-fp11/src/away3d/core/render/RendererBase.as:288]
at away3d.core.render::DefaultRenderer/executeRender()[/Users/robbateman/Documents/fdt5workspace/away3d-core-fp11/src/away3d/core/render/DefaultRenderer.as:62]
at away3d.core.render::RendererBase/render()[/Users/robbateman/Documents/fdt5workspace/away3d-core-fp11/src/away3d/core/render/RendererBase.as:252]
at away3d.containers::View3D/render()[/Users/robbateman/Documents/fdt5workspace/away3d-core-fp11/src/away3d/containers/View3D.as:611]
at Testes/update()[/Users/lokovarrido/Documents/Adobe Flash Builder 4.7/Testes/src/Testes.as:41]
我的代码是:
package
{
import flash.display.Sprite;
import flash.events.Event;
import away3d.cameras.Camera3D;
import away3d.containers.View3D;
import away3d.entities.Mesh;
import away3d.materials.ColorMaterial;
import away3d.primitives.SphereGeometry;
[SWF(frameRate="60", width="100%", height="100%", backgroundColor="0x000000")]
public class Testes extends Sprite
{
private var cam:Camera3D;
private var view:View3D;
public function Testes()
{
cam = new Camera3D();
cam.z = -350;
view = new View3D(null, cam);
addChild(view);
var sphere:SphereGeometry = new SphereGeometry();
var sphereMaterial:ColorMaterial = new ColorMaterial(0xff0000);
var sphereMesh:Mesh = new Mesh(sphere, sphereMaterial);
view.scene.addChild(sphereMesh);
this.addEventListener(Event.ENTER_FRAME, update);
}
public function update(e:Event):void
{
trace("update");
view.render();
}
}
}