Repository navigation
fix(render): honour ignore_lighting and one-sided entity materials - #67
Merged
notchyves merged 2 commits intoNov 6, 2026
Merged
Conversation
Pack entities drawn by a render controller with ignore_lighting were lit by the world light where they stand, so a logo anchored in an unlit spot came out black. They now draw at full brightness, scaled by light_color_multiplier. Entities were also always drawn without face culling. Materials without DisableCulling (entity, entity_alphatest_one_sided, ...) now cull back faces, so inward-facing background planes no longer cover the model in front of them. The world matrix mirrors model z, so the culled side is swapped when the model matrix has a negative determinant.
Entity cubes take east/west UVs from the opposite face to undo Bedrock's mirrored x, but the per-face presence check still used the unswapped index. A cube listing only east (or only west) got its quad on the wrong side, facing outward: the Hive logo's inward background walls showed as dark slivers past the letters.
NaySurGithub
force-pushed
the
fix/entity-ignore-lighting
branch
from
November 6, 2026 21:56
2eea051 to
e7549ab
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On The Hive hub, the
hivehub:logoentity (the big "HIVE" title) renders as a solid black / dark box instead of the green letters. Once that is fixed, dark slivers still stick out past the letters on one side.The "before, at an angle" shot already includes the first two fixes below: the slivers on the right are the third bug.
All shots come from Perlin's offline preview with the server's resource pack mounted (
PERLIN_TEST_SERVER_PACKS,PERLIN_PREVIEW_ENTITIES=hivehub/logo).How the pack builds the logo
entity/hive/hub/logo.json: materialentity_alphatest_one_sided, texturetextures/entity/hive/hub/logo(a 127×36 palette PNG);render_controllers/hive/hub/logo.json:"ignore_lighting": true,"light_color_multiplier": 1.0;models/entity/hive/hub/logo.json: the H / I / V / E letters, plus aborderbone. That bone is a box of six zero-thickness planes around the letters, each with one face, all facing inward:southatz = -7,northatz = 17,upaty = -1,downaty = 38,westatx = -64,eastatx = 65. Seen from outside, only the far walls show, as a dark frame behind the letters.Causes and fixes
1.
ignore_lightingwas not read (black logo).EntityAssetsnow parsesignore_lightingandlight_color_multiplier.fullbrightalready did.2. Entities were always drawn with face culling off (the front background plane covered the logo).
UiDraw::cullnow follows the entity material: materials withoutDisableCullingcull back faces.3. A lone
eastorwestface was built on the wrong side (slivers past the letters).origin.x = -(from.x + size.x)and keeps the face names. In geometry space,eastis therefore the −x side andwestthe +x side.Geometry.cppalready undoes this for entity cubes by taking a side's UV from the opposite face (fi = 1 - i). But it checked face presence with the unswapped indexc.faces[i].present. A cube listing onlyeast(or onlywest) got its single quad on the opposite side, facing outward. Both side walls of the logo's box then faced the viewer as dark slivers.fi. Box-UV cubes are unaffected, since they always have all six faces.Culling now applies to every entity with a one-sided material, not only pack entities. Vanilla mobs using
entity(cow, pig, creeper, …) were checked up close:Testing
main(653959d).