Skip to content

Latest commit

 

History

History
79 lines (60 loc) · 2.4 KB

index.md

File metadata and controls

79 lines (60 loc) · 2.4 KB
title layout nav_order description
Home
default
1
An OpenGL / WebGPU engine for Desktop JVM, Android and Javascript written in Kotlin.

kool Documentation

{: .fs-9 }

kool is a multi-platform OpenGL / WebGPU game engine written in kotlin that works on Desktop Java, Android and in browsers. {: .fs-6 .fw-300 }

Get started now{: .btn .btn-primary .fs-5 .mb-4 .mb-md-0 .mr-2 } View it on GitHub{: .btn .fs-5 .mb-4 .mb-md-0 }


Getting started

kool supports two development styles: Editor and code-only. The easiest way to get into things is using [the editor]({% link docs/editor/editor.md %}). 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]({% link demos.md %}) 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.