Repository navigation
How it works
Why players turn see-through with shaders, and what Solid Self changes.
Vanilla draws the player model with the translucent entity render type, RenderTypes.entityTranslucent. Without shaders that makes no difference.
Shader packs running on Iris work in stages:
| Stage | What is drawn or calculated |
|---|---|
| 1. Opaque pass | Terrain and solid entities fill the depth buffer |
| 2. Deferred passes | Effects like world outlines, ambient occlusion and reflections read that depth buffer |
| 3. Translucent pass | Water, glass and translucent entities |
Players only appear in stage 3, so the effects in stage 2 never see them:
- No outlines. Blocks, mobs and cosmetics get outlined, the player doesn't.
- See-through players. The player is blended with what's behind it, which shows most against a bright sky.
Upstream report: Iris #3105.
A single mixin hooks into LivingEntityRenderer#getRenderType. For player renderers it replaces the vanilla translucent type with the cutout type that most mobs use:
if (cir.getReturnValue() == RenderTypes.entityTranslucent(texture)) {
cir.setReturnValue(RenderTypes.entityCutout(texture));
}The player is now drawn in stage 1 and every shader effect picks it up. Source: LivingEntityRendererMixin.java
Player heads use the player's skin and are drawn with the translucent render type as well, through PlayerSkinRenderCache.RenderInfo#renderType. That covers placed heads, heads in item frames, heads in your hand and heads worn by players, mobs or armor stands. A second mixin replaces that type with RenderTypes.entityCutoutZOffset, the same type vanilla uses for every other mob head.
Source: PlayerSkinRenderInfoMixin.java
| Invisibility and spectators | The vanilla ghost look uses a different render type |
| First-person hand | Drawn by a separate method |
| Other entities | Only players and player heads are affected |
| Other mods | If a mod already changed the player's render type, Solid Self leaves it alone |
Note
Cutout rendering only knows visible and invisible. Partly transparent skin pixels are therefore shown fully or not at all. Fully transparent pixels work as before.
| ‹ Usage | Compatibility › |
cloaki.de · MIT License · Not an official Minecraft product. Not approved by or associated with Mojang or Microsoft.