Skip to content

AnrokX/blockbench-emissive-export

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Emissive glTF Export - Blockbench Plugin

Export emissive/glowing textures properly in glTF/GLB files without needing Blender post-processing.

Blockbench License

The Problem

Blockbench can preview emissive/bloom effects, but the standard glTF export doesn't include emissive material properties. The typical workflow requires:

  1. Export from Blockbench
  2. Import into Blender
  3. Manually connect emissive textures to the Principled BSDF emission input
  4. Set emission strength
  5. Re-export from Blender

This plugin eliminates that entire Blender step.

Features

  • Two ways to define emissive textures:
    1. Set texture render mode to "Emissive" (original behavior)
    2. Use separate emissive textures with _e or _emissive suffix (e.g., character_e.png)
  • Configurable emission strength per texture
  • Support for both ASCII (.gltf) and binary (.glb) formats
  • Uses KHR_materials_emissive_strength extension for HDR values > 1.0
  • Automatic texture pairing (e.g., character.png + character_e.png)
  • Zero dependencies - pure JavaScript

Installation

Option 1: Direct File

  1. Download emissive_gltf_export.js
  2. In Blockbench: File > Plugins > Load Plugin from File
  3. Select the downloaded file

Option 2: Drag & Drop

Simply drag emissive_gltf_export.js into the Blockbench window.

Option 3: From URL

  1. In Blockbench: File > Plugins > Load Plugin from URL
  2. Enter the raw GitHub URL to the .js file

Usage

Method 1: Single Texture (Same Image for Base Color & Emission)

  1. Set Texture to Emissive Mode Right-click your texture → Render Mode → Emissive

  2. Configure Emission Strength (Optional) Right-click the emissive texture → Set Emission Strength...

Method 2: Separate Emissive Texture (Different Images)

This allows you to have a different texture for emission vs base color - perfect for glow masks where only specific parts should emit light.

Why Use This Method?

Method 1 (Single Texture) Method 2 (Separate Textures)
Entire texture glows Only specific parts glow
Quick setup More control
Good for fully emissive objects (lamps, screens) Good for partial glow (eyes, buttons, trim)

Creating a Glow Mask

Your emissive texture (_e suffix) acts as a glow mask:

  • Black pixels = No emission
  • Colored pixels = Emit that color
  • White pixels = Full emission

Example workflow:

  1. Duplicate your base texture
  2. Paint everything black except the parts you want to glow
  3. Keep or recolor the glowing parts (e.g., eyes, LED indicators)
  4. Save with _e suffix

Setup Steps

  1. Name your textures with matching base names:

    • Base texture: character.png
    • Emissive texture: character_e.png or character_emissive.png
  2. Import both textures into Blockbench The plugin will automatically pair them by name. Check the console (F12) for:

    [Emissive glTF Export] Found emissive texture pair: character.png → character_e.png
    
  3. Configure Emission Strength (Optional) Right-click the _e/_emissive texture → Set Emission Strength...

  4. Export - The emissive texture is automatically embedded, even if not applied to any faces.

Supported suffixes: _e, _emissive, _emission, _glow

Note: You don't need to set render mode to "Emissive" when using the suffix method - the naming alone triggers the pairing.

Emission Strength Values

  • 1.0 = Standard emission (default)
  • > 1.0 = Brighter glow (HDR, uses KHR extension)
  • < 1.0 = Dimmer glow

Export

For .gltf (ASCII): File → Export → Export glTF Model

For .glb (Binary): File → Export → Export Emissive GLB

Output Format

The plugin adds proper glTF 2.0 emissive material properties.

Single texture (same image for base color & emission):

{
  "materials": [{
    "pbrMetallicRoughness": {
      "baseColorTexture": { "index": 0 }
    },
    "emissiveFactor": [1.0, 1.0, 1.0],
    "emissiveTexture": { "index": 0 },
    "extensions": {
      "KHR_materials_emissive_strength": {
        "emissiveStrength": 3.0
      }
    }
  }]
}

Separate emissive texture (different images):

{
  "textures": [
    { "source": 0, "name": "character" },
    { "source": 1, "name": "character_e" }
  ],
  "materials": [{
    "pbrMetallicRoughness": {
      "baseColorTexture": { "index": 0 }
    },
    "emissiveFactor": [1.0, 1.0, 1.0],
    "emissiveTexture": { "index": 1 }
  }]
}

Compatibility

Blockbench: 4.8.0+ (Desktop & Web)

Tested Renderers:

  • Blender (glTF importer)
  • Three.js
  • Babylon.js
  • Unity (with glTF importer)
  • Unreal Engine (with glTF importer)
  • Godot

Limitations

  • Preview bloom in Blockbench is separate from export strength - the plugin only affects exported files.
  • Emissive textures must share the same UV mapping as the base texture (they use the same texCoord).

Troubleshooting

Texture pairing not working

Check the console (F12) for pairing messages. If you don't see Found emissive texture pair:, verify:

  • Base texture: name.png (no suffix)
  • Emissive texture: name_e.png (exact same base name + suffix)
  • Both textures are imported into the project

Verifying the export

After exporting, check the console for:

[Emissive glTF Export] Added dedicated emissive texture: name_e.png (index: 1)
[Emissive glTF Export] Applied emissive to material 0 (name.png + name_e.png)
[Emissive glTF Export] GLB modified successfully

Testing in Blender

  1. Import the GLB into Blender
  2. Go to Shading tab
  3. Select the material - you should see:
    • Base Color texture connected
    • Emission texture connected (separate image)
    • Emission strength already set

Contributing

Issues and PRs welcome! This plugin was created to solve a common pain point in the Blockbench → Game Engine workflow.

License

MIT License - See LICENSE file.

Credits

Created with assistance from Claude AI for the Blockbench community.

About

Blockbench plugin to export emissive textures properly in glTF/GLB files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors