Skip to content
Timo Wiren edited this page May 6, 2022 · 26 revisions

Aether3D Game Engine

This is a reboot of Aether3D game engine. API Documentation: https://twiren.kapsi.fi/doc_v0.8.7/html/

Importing meshes

There is a converter for FBX and OBJ meshes in Tools. Once they have been built, they can be used in command line like follows:

convert_obj 0 mesh.obj produces mesh.ae3d with vertex format containing a position, texcoord, normal, tangent and color.

convert_obj 1 mesh.obj produces mesh.ae3d with vertex format containing a position, texcoord and normal.

When exporting FBX from Blender, set the scale to 0.01.

Blender exporter is in Tools/io_export_aether3d.py. Install it into Blender and it's in export menu.

Importing .obj and its materials to a .ae3d mesh file and .scene file:

  1. ./convert_obj 0 object.obj
  2. ./read_mtl object.mtl > file.scene
  3. ./read_mtl object.obj >> file.scene
  4. Paste the following to the end of file.scene:
gameobject
name myobject
transform
position 0 0 0
meshrenderer
meshpath object.ae3d

Tangent-Space Convention

  • MikkTSpace
  • OpenGL Y+
  • Tangent-space computed in pixel shader

Animation

Aether3D supports skinned animation from .fbx files. It's sampled at 24 FPS.

Textures

Supported compressed formats: PVRv2, PVRv3, ASTC, BC1, BC2, BC3, BC4 and BC5.

PVR and ASTC are only supported on iOS. BCn is only supported on PC.

To generate a compatible ASTC texture, here's an example command:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/texturetool -e ASTC -f KTX -o ~/output.ktx ~/Documents/src/aether3d_build/Samples/glider.png

Loading shaders

Shader shader;

shader.Load( "unlitVert", "unlitFrag", FileSystem::FileContents("unlit.hlsl"), FileSystem::FileContents( "unlit.hlsl" ), FileSystem::FileContents("unlit_vert.spv"), FileSystem::FileContents("unlit_frag.spv") );

Shader source code is loaded from file system objects that can be filled from files, .pak files or data. Because the renderer supports Vulkan, Metal and D3D12, there are parameters for all shading languages. If you don't want to support a particular language, just provide an empty string for FileContents. D3D12 shaders can be .hlsl sources or compiled blobs (.obj). In case of Metal, shaders should be put into your Xcode project and Shader::Load is given a vertex and fragment shader's name.