kool Documentation

kool is a multi-platform OpenGL / WebGPU game engine written in kotlin that works on Desktop Java, Android and in browsers.

Get started now View it on GitHub


Getting started

kool supports two development styles: Editor and code-only. The easiest way to get into things is using the editor. However, the editor is still in a rather early state and you may prefer the code-only way. In that case the kool Templates provide the easiest way to start a clean kool project from scratch.

Alternatively, you can browse the sourcecode of the Demos to get an impression of slightly more complex scenarios.

Finally, here’s a complete hello world example:

fun main() = KoolApplication {
    // Create and add a new scene
    addScene {
        // Add a mouse manipulatable camera
        defaultOrbitCamera()

        // Add a spinning colored cube
        addColorMesh {
            generate {
                cube {
                    colored()
                }
            }
            shader = KslPbrShader {
                color { vertexColor() }
                metallic(0f)
                roughness(0.25f)
            }
            onUpdate {
                transform.rotate(45f.deg * Time.deltaT, Vec3f.X_AXIS)
            }
        }

        // Add a directional light to illuminate the scene
        lighting.singleDirectionalLight {
            setup(Vec3f(-1f, -1f, -1f))
            setColor(Color.WHITE, 5f)
        }
    }
}

License

kool is distributed by an Apache-2.0 License.

Get in touch

Feel free to join the Discord Server!

Code of conduct

kool is committed to fostering a welcoming community.

View the Code of Conduct on our GitHub repository.