DeerEngine/roe/Editor/Panels/AssetExplorer/MeshPreviewRender.as

18 lines
493 B
ActionScript

dictionary meshFrameBuffer;
Environment renderEnvironment;
FrameBuffer getMeshFrameBuffer(string mesh) {
if (meshFrameBuffer.exists(mesh)) {
FrameBuffer fb;
any fbAny = cast<any>(meshFrameBuffer[mesh]);
fbAny.retrieve(fb);
return fb;
}
return generateMeshFrameBuffer(mesh);
}
FrameBuffer generateMeshFrameBuffer(string mesh) {
FrameBuffer fb = Engine::createRGBA8FrameBuffer(mesh, 64, 64);
meshFrameBuffer[mesh] = any(fb);
return fb;
}