Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Tutorials/Emissive Textures

From FiguraMC
Revision as of 20:45, 26 September 2024 by Manuel (talk | contribs) (Automated upload of converted .txt file.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

import Emoji from ‘@site/src/components/Emoji’;


This page describes everything to know about Emissive Textures.


Defining a Texture as Emissive

Every ModelPart in BlockBench has a reference to a single texture. When Figura loads the avatar, Figura looks for a texture with the same name as the texture used by the ModelPart but with _e added to the end of it. For example, the emissive texture used by ModelParts that use <Emoji icon="file/texture"/> texture.png will use <Emoji icon="file/texture"/> texture_e.png as their emissive texture.
_e is one of the [[../start_here/BlockBench#texture-suffix|texture suffixes]] that Figura looks for when loading an avatar.


<img src={require("@site/static/img/emissive-example/names.png").default} width="400"></img>


Emissive Texture Behavior

<img src={require("@site/static/img/emissive-example/emissive.png").default} align="right"/>


The pixels on a Texture using the “EMISSIVE” [[../enums/RenderTypes|RenderType]] are not interpreted the same was as a regular texture.


First of all, the alpha values of pixels are ignored. This means that the emissive texture itself cannot be halfway visible. Its either the pixel is completely opaque, or completely gone. No in between.
On the texture below, both pixels will render the exact same. Even though they appear to be 2 distinct colors, the right color has an alpha value of 139 and is blending with the gray GitHub background. They have the exact same RGB values and will be rendered exactly the same under the “EMISSIVE” RenderType.
<img src={require("@site/static/img/emissive-example/alpha.png").default} width="40"/>


Second, the “brightness” of a pixel is what determines the intensity of the emissive glow. If you know HSV, its the Value that controls this property. Emissive Intensity controls how bright the pixel will render, but also how much of the pixel behind it will show through.
On the texture below, both pixels will render with the same color. The pixel on the left will render with max brightness, not allowing the pixels on the base texture to blend through. The pixel on the right won’t glow as much, but allows the pixels on the base texture to blend through.
<img src={require("@site/static/img/emissive-example/brightness.png").default} width="40"/>


Iris Emissives

If you use Iris, regardless of the fact of if you are currently using custom shaders, the “EMISSIVE” RenderType is modified to use the alpha value when rendering the emissive texture. How exactly is not known. Experimentation is required.


Emissive Render Types

There are three emissive render types: EMISSIVE, EMISSIVE_SOLID, and EYES. All of these require the original _e texture and will make the same pixels glow that are in the _e texture.


EMISSIVE

This is the default render type of the _e texture.


EMISSIVE_SOLID

Like EMISSIVE, but it doesn’t allow transparency, transparent pixels will render as black.


EYES

The render type as Enderman and Spider eyes. This will not make the glowing pixels visible while you are under the invisibility effect.


Setting Render Type Example

To be clear: To use these you still need to have the _e texture, this can simply change the rendering of it


You can set the render type to “Eyes” like this


models:setSecondaryRenderType("Eyes")

Note: The glow on the paperdoll and the skull may look slightly different.