zakgof / korender

3D graphics engine for Kotlin Multi-Platform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Korender korender

Kotlin Multiplatform 3D graphics rendering engine based on OpenGL / OpenGL ES

@Composable
fun App() = Korender {
    Frame {
        Renderable(
            mesh = sphere(2.0f),
            material = standard(StandardMaterialOption.Color) {
                color = Color(0.2f, 1.0f, 0.5f + 0.5f * sin(frameInfo.time))
            },
            transform = Transform().translate(sin(frameInfo.time).y)
        )
    }
}

Korender

Supported platforms

  • Desktop (Windows) - based on LWJGL
  • Android - based on OpenGL ES

Features

  • Rendering opaque and transparent objects
  • Diffuse, specular and ambient lighting (direction light)
  • Projection shadow maps with percentage close soft shadows
  • Texturing:
    • uv mapped
    • triplanar
    • detail
  • Bump mapping
  • Custom meshes
  • Wavefront .obj model file loading
  • Billboards (sprites)
  • Batching (instancing)
  • Simple heightfield (terrain)
  • Textured or shader sky
  • On-screen basic GUI
  • Custom shaders support
  • Screen-space shaders (filters)
  • Simple effects
    • smoke
    • fire
    • water

Demo app

Examples

Find more advanced examples

Concepts

  • KorenderContext - your entry point to access engine features
  • Renderable - a primitive that can be rendered. A renderable's has a Mesh (geometry) and a Material (surface properties)
  • Mesh - is generally an indexed collection of vertices that form triangles. Each vertex has a set of Attributes, such as position, normal, texture coordinates, etc.
  • Material - defines a renderable's surface look; consist of a Shader and its Uniforms (properties)
  • Shader - compiled GPU program, consisting of vertex ang fragment shader code
  • Uniforms - shader's parameters

About

3D graphics engine for Kotlin Multi-Platform

License:Apache License 2.0


Languages

Language:Kotlin 93.9%Language:GLSL 6.1%