Skip to content

Emissive Textures (Geckolib3)

Tslat edited this page Jul 3, 2023 · 5 revisions

Geckolib provides automatic glowing textures by using a built-in render layer. For this to work the texture needs to be prepared.

Render Layer

The render layer is called LayerGlowingAreasGeo. It takes in your renderer instance, a supplier that returns the current texture and another supplier that returns the current model id and add a function that returns the render type to use to render the glowing texture. The input parameter for that function is the id of the generated glowing texture.

To use the standard glowing texture, you'd put in RenderType::eyes (note that this rendertype is not ideal and you should rather implement your own) for the render type function.

Example usage: TBD

Texture

The glowing texture automatically gets generated. For that the texture needs a .mceta file. In that file, one needs to include a "glowsections" section. That section contains all areas that glow. A corner-coordinate and the dimensions of the square define each space. The coordinates are defined like pixel coordinates; 0/0 represents the top left corner.

Example mcmeta file content for a standard biped texture (eyes will glow):

{
  "glowsections": {
    "sections": [
	  {
		"x": 9,
		"y": 12,
		"w": 2,
		"h": 1
	  },
	  {
		"x": 13,
		"y": 12,
		"w": 2,
		"h": 1
	  }
	]
  }
}

A mcmeta file can be edited with any text editor. It must be named the same as the texture file it belongs to. For example, for the texture "zombie.png", the accompanying mcmeta file would be named "zombie.png.mcmeta".

Table of Contents

Geckolib 3
Geckolib 4

Hosted By: Cloudsmith

Package repository hosting is graciously provided by Cloudsmith.

Cloudsmith is the only fully hosted, cloud-native, universal package management solution that enables your organization to create, store and share packages in any format, to any place, with total confidence.

Clone this wiki locally