我尝试在Flash Builder for Mobile(iOS,Android)中使用Away3d进行测试...
我无法在iOS模拟器,设备(iphone e android)中运行我的小teste,但我的代码在空气模拟器中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();
}
}
}
答案 0 :(得分:1)
在Adobe AIR Application Descriptor XML的<initialWindow>
下,设置depthAndStencil
:
<initialWindow>
<depthAndStencil>true</depthAndStencil>