kaun is a replacement for löve's built-in love.graphics module intended for 3D graphics

kaun

kaun is a replacement for löve's built-in love.graphics module intended for 3D graphics. It is a Lua module you can require from a shared library.

Be aware that the code is horrible, because I just wanted to try the idea out in a couple of weeks 2 years ago (at the time of writing this). Now I decided to make a game and I am trying to not trap myself in the perpetual cycle of rewriting. If you want to improve anything (and there is a lot) feel invited to contribute!

Why?

If you know your way around löve, you might know that additions to löve 11 in particular (esp. setDepthMode) have made it easier to do 3D graphics with löve, but for the foreseeable future it will not be primarily intended for 3D graphics.

And if you know your way around löve a bit more, you will also have noticed how a handful of ambitious developers have delved far into 3D graphics with löve and stumbled upon new requirements for features that are hard to fit cleanly into löve as it currently is. So they either take a while to make them work or don't end up there at all.

kaun should be a way to not have to worry about these things and add whatever is necessary or useful in the future (like occlusion queries, uniform buffer objects, geometry/compute shaders, indirect draws etc.).

It is also a way to to make techniques possible that require more CPU load than might be comfortably manageable with LuaJIT (like software rasterization for occlusion culling or performant state sorting).

The goal is still to have a "lövely" API (fairly low-level, but enough to abstract away boring OpenGL details and to leave space for relevant optimizations).

Examples

Hello Spinning Cube (from here: main.lua):

VIDEO

kaun = require("kaun")
local shaders = require("shared.shaders")

local cameraTrafo = kaun.newTransform()
cameraTrafo:lookAtPos(0, 0, 4,   0, 0, 0)
kaun.setViewTransform(cameraTrafo)

local shader = kaun.newShader(shaders.defaultVertex, shaders.defaultTexturedLambert)

local mesh = kaun.newBoxMesh(1, 1, 1)
local meshTrafo = kaun.newTransform()

local texture = kaun.newCheckerTexture(512, 512, 64)

function love.resize(w, h)
    kaun.setProjection(45, w/h, 0.1, 100.0)
    kaun.setWindowDimensions(w, h)
end

function love.update(dt)
    meshTrafo:rotate(dt, 0, 1, 0)
end

function love.draw()
    kaun.clear()
    kaun.clearDepth()

    kaun.setModelTransform(meshTrafo)
    kaun.draw(mesh, shader, {
        color = {1, 1, 1, 1},
        baseTexture = texture,
    })

    kaun.flush()
end

Videos of the other Examples:

Owner
Similar Resources

A modern cross-platform low-level graphics library and rendering framework

A modern cross-platform low-level graphics library and rendering framework

Diligent Engine A Modern Cross-Platform Low-Level 3D Graphics Library Diligent Engine is a lightweight cross-platform graphics API abstraction library

Aug 12, 2022

Lightweight and modular C++11 graphics middleware for games and data visualization

Magnum — Lightweight and modular C++11/C++14 graphics middleware for games and data visualization Looking for an open-source library that gives you gr

Aug 14, 2022

Yocto/GL: Tiny C++ Libraries for Data-Driven Physically-based Graphics

Yocto/GL: Tiny C++ Libraries for Data-Driven Physically-based Graphics

Yocto/GL: Tiny C++ Libraries for Data-Oriented Physically-based Graphics Yocto/GL is a collection of small C++17 libraries for building physically-bas

Aug 11, 2022

📽 Highly Optimized Graphics Math (glm) for C

🎥 OpenGL Mathematics (glm) for C Documentation Almost all functions (inline versions) and parameters are documented inside the corresponding headers.

Aug 12, 2022

A library for high-performance, modern 2D graphics with SDL written in C.

SDL_gpu, a library for making hardware-accelerated 2D graphics easy. by Jonathan Dearborn SDL_gpu is licensed under the terms of the MIT License. See

Aug 17, 2022

3D engine from scratch (without OpenGL or any other 3D graphics library)

3D engine from scratch (without OpenGL or any other 3D graphics library)

Simple 3d engine based on SFML library. I tried to make this engine powerful and easy to understand.

Aug 7, 2022

Dear PyGui 3D Engine (early development) and Graphics API demos.

Dear PyGui 3D Engine (early development) and Graphics API demos.

Marvel This repo is the working location of the eventual Dear PyGui 3D Engine. It also contains several single file examples of creating a triangle wi

Aug 5, 2022

4K Executable Graphics framework

4K Executable Graphics framework

Blossom 🌸 Blossom is a small framework for creating 4K Executable Graphics artworks for the demoscene. You are free to use this as the basis for your

Aug 9, 2022

This repository is used for storing sourcecode related to final project of Computer Graphics and Computer Vision

This repository is used for storing sourcecode related to final project of Computer Graphics and Computer Vision

Computer Graphics and Computer Vision Description: This repository is used for storing sourcecode related to final project of Computer Graphics and Co

Jul 8, 2022
Related tags
A terminal-based graphics library for both 2D and 3D graphics.
A terminal-based graphics library for both 2D and 3D graphics.

TermGL A terminal-based graphics library for both 2D and 3D graphics. Written in C, created for terminals supporting ANSI escape codes. Table of Conte

Aug 10, 2022
This repo contains the DirectX Graphics samples that demonstrate how to build graphics intensive applications on Windows.
This repo contains the DirectX Graphics samples that demonstrate how to build graphics intensive applications on Windows.

DirectX-Graphics-Samples This repo contains the DirectX 12 Graphics samples that demonstrate how to build graphics intensive applications for Windows

Aug 10, 2022
Wireframe rasterizer built from scratch (using MLX) in C
Wireframe rasterizer built from scratch (using MLX) in C

Fils de Fer Project Goal This project is about creating a simplified graphic “wireframe” (“fils de fer” in French, hence the name of the project) repr

Nov 20, 2021
A completely free, open-source, 2D game engine built on proven torque technology.
A completely free, open-source, 2D game engine built on proven torque technology.

Torque2D 4.0 Early Access 1 MIT Licensed Open Source version of Torque2D from GarageGames. Maintained by the Torque Game Engines team and contribution

Aug 10, 2022
A scratch built kernel original planed to only render a Utah-teapot
A scratch built kernel original planed to only render a Utah-teapot

teapot-OS (sine wave animation) (first 3d renderer, with mouse controll) Current progress Bootloader enter 32 bit protected mode and run c code Switch

Feb 9, 2022
Verisilicon Tensor Interface Module for OpenVX

TIM-VX is a software integration module provided by VeriSilicon to facilitate deployment of Neural-Networks on OpenVX enabled ML accelerators. It serves as the backend binding for runtime frameworks such as Android NN, Tensorflow-Lite, MLIR, TVM and more.

Aug 14, 2022
This is a fast module to probing an area in a 2d plane for physic objects

Godot AreaProber 2D Checking for neighbour colliders made easy AreaProber allows you to probe for colliders anywhere in your 2D game's world, no need

Feb 14, 2022
This module is a simple, lightweight and flexible way to generate QR codes in Godot
This module is a simple, lightweight and flexible way to generate QR codes in Godot

QRCodeTexture Godot Module Summary This module is a simple, lightweight and flexible way to generate QR codes in Godot. It provides a new type of text

Jun 19, 2022
Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.
Cross-platform, graphics API agnostic,

bgfx - Cross-platform rendering library GitHub Discussions Discord Chat What is it? Cross-platform, graphics API agnostic, "Bring Your Own Engine/Fram

Aug 14, 2022
2D Vector Graphics Engine Powered by a JIT Compiler

Blend2D 2D Vector Graphics Powered by a JIT Compiler. Official Home Page (blend2d.com) Official Repository (blend2d/blend2d) Public Chat Channel Zlib

Aug 7, 2022