Skip to Content
defold-typescript libraries
defold (official)

defold/defold-pbr

A work-in-progress PBR core with shaders, a material, a reference render script and the defold-pbr/core Lua module. Editor scripts generate environment lighting assets from .hdr files and extract .glb content into Defold collections.

Lua API not typed — upstream ships no .script_api, so resolve skips it.

  • GitHub: defold/defold-pbr — pinned to 0.1.1 (released while Defold 1.7.0 was current)
    1. Pick a release from defold/defold-pbr releases and add its Source code (zip) URL (or a packaged .zip asset, if the library ships one) to game.project under [project] dependencies, then Fetch Libraries in the Defold editor.
    2. Attach /defold-pbr/core.script to a game object to create the PBR context.
    3. Require defold-pbr/core to call functions such as set_environment, add_light_point and set_camera_world.
    4. In the render script, pass get_constants() to the model draw call and wrap it in enable_textures() and disable_textures().

Engine APIs

The module builds its constant buffer and binds textures with render, and reads texture handles with resource.

On this page