- Install: glfw (3.4-2)
- RPI5 GL Version: "3.1 (Core Profile) Mesa 25.1.1-arch1.1"
- Running VS Code under Wayland: code --enable-features=UseOzonePlatform --ozone-platform=wayland
- Fix for the "Failed to load plugin 'libdecor-gtk.so': failed to init" etc.
- It turns out that even if system is running Wayland, VSCode defaults to using the X11 protocol. To fix this, you can launch VSCode with the following command:
code --ozone-platform=wayland --enable-features=UseOzonePlatform --use-cmd-decoder=validating --use-gl=desktop
The MicroEngine
project is a lightweight game engine written in C# using OpenTK.
It provides a modular structure for creating 3D applications, with components for rendering,
scene management, and more. Below is an overview of the key classes and interfaces:
- OpenGL ES 3.1/Raspberry Pi 5 support.
- Scene graph.
- Lights.
- Materials.
- Textures.
- Meshes.
- Cameras.
- Skybox.
- Audio.
- Physics.
- Shadows.
- Scripting.
- Logging using ILogger.
- Write documentation. :-)
MicroEngine
: The core engine library.MicroEngine.Audio
: Audio management and playback.MicroEngine.Physics
: Physics simulation and collision detection.MicroEngine.Extensions
: Extensions and utilities for the engine.MicroEngine.Extensions.Audio
: Audio extensions and utilities.
- Represents the main container for all objects in the 3D world.
- Manages a hierarchy of scene objects (
ISceneObject
). - Handles updates and rendering of the scene.
ISceneObject
is an interface for all objects in a scene. It defines hierarchy, representation,
and transformations of objects. Below is a concise description of its properties and methods:
Parent
: The parent of this object.Children
: A list of child objects of this object.
Geometry
: The geometry defining the shape of the object.Material
: The material defining the appearance of the object.IsVisible
: Indicates whether the object and its children are visible.
Position
: The position of the object relative to its parent.Rotation
: The rotation of the object (in radians).Scale
: The scale of the object relative to its parent.SetRotationX/Y/Z(float angle)
: Sets the rotation around the X/Y/Z axis.
ModelMatrix
: The model matrix of the object (updated before rendering).NeedsModelMatrixUpdate
: Indicates whether the model matrix needs to be updated.
GetScene()
: Returns theScene
instance to which the object belongs (throws an exception if not found).
- Interface for materials that define how objects appear when rendered.
- Properties:
Shader
: The shader program used for rendering.Textures
: A collection of textures applied to the material.
- Example implementation:
Material
: A simple material with diffuse and specular properties.
- Interface for defining the shape of a 3D object.
- Examples:
DefaultGeometry
: Default geometry with normals and a single texture.MultiTextureGeometry
: A geometry with multiple textures. No lights.SingleTextureGeometry
: A geometry with a single texture. No lights.
- Interface for shader programs used in rendering.
- Manages vertex and fragment shaders.
- Example implementation:
DefaultShader
: Default shader with textures and lights.SkyboxShader
: Shader for rendering sky boxes.MultiTextureShader
: Shader for rendering objects with multiple textures.SingleTextureShader
: Shader for rendering objects with a single texture.
ICamera
is an interface for all camera objects in a scene. It extends ISceneObject
and defines properties and methods for managing the camera's view and projection.
Fov
: The field of view (FOV) in degrees, representing the vertical angle of the camera's view.Direction
: A vector indicating the direction the camera is looking.
GetViewMatrix()
: Returns the view matrix, which defines the camera's position and orientation in the scene.GetProjectionMatrix()
: Returns the projection matrix, which defines how the 3D scene is projected onto a 2D screen.
- Interface for the main game loop.
- Responsibilities:
- Initializing the game.
- Updating the game state.
- Rendering the scene.
- Create a Scene: Instantiate a
Scene
and populate it with objects implementingISceneObject
. - Add Geometry and Materials: Use
IGeometry
andIMaterial
to define the appearance of objects. - Set Up a Camera: Add an
ICamera
to the scene to define the view. - Implement a Game Loop: Use
IGame
to manage updates and rendering.
This modular structure allows you to extend and customize the engine for your specific needs.
Camera:
- https://gamedev.stackexchange.com/questions/183748/3d-camera-rotation-unwanted-roll-space-flight-cam
- https://stackoverflow.com/questions/64953941/how-to-implement-the-roll-angle-together-with-yaw-and-pitch-in-glmlookat-funct
- https://learnopengl.com/Getting-started/Camera
- https://kengine.sourceforge.net/tutorial/vc/camera-eng.htm
- https://cboard.cprogramming.com/game-programming/135390-how-properly-move-strafe-yaw-pitch-camera-opengl-glut-using-glulookat.html
- https://tuttlem.github.io/2013/12/30/a-camera-implementation-in-c.html
- https://gamedev.stackexchange.com/questions/136174/im-rotating-an-object-on-two-axes-so-why-does-it-keep-twisting-around-the-thir
- https://gamedev.stackexchange.com/questions/183748/3d-camera-rotation-unwanted-roll-space-flight-cam
- https://swiftgl.github.io/learn/01-camera.html
Skybox: