• Journey's End on PC - Find info here and here. Please report bugs and issues for PC 1.4 and 1.4.1 to Re-Logic here.
  • Journey's End on Mobile - Find info here. Report bugs for Mobile 1.4 to DR Studios at this link and give as much detail as possible.
  • 1.4 will bring many changes to the PC version. We strongly advise making plans to back up your worlds and players prior to updating your game. More details here.
  • Console and Switch - The latest news can be found here. To report a bug, please use this link.

tModLoader Smooth Lighting


Official Terrarian
The way the game normally works:

Whenever a tile is drawn, the game does a lookup in the lighting data and writes that color value into the vertices of whatever is being drawn. The shader that draws tiles will multiply that vertex value by the texture color and draw it to the screen.

Sometimes the game wants to draw things while ignoring lighting (emissive), and in those cases it will write the glow color into the vertices and draw a texture in the shape of the part that glows. Dyes and some paints that use custom shaders can also ignore what light color is written in the vertices when drawing the part that glows.

The mod's current approach:
  1. Before drawing starts, generate a texture containing lighting data for the part of the world that overlaps with the screen referred to by RandomComputerUser as a "light texture".
  2. Any code that wrote a light value into vertices, instead write white. Everything is drawn as if it were fully lit.
  3. After all drawing is finished, multiply the light texture by the entire screen to darken the world back from fully lit to the correct brightness.
Why this mod fails:

Once tiles are drawn, there is no distinction between pixels that are glowing and pixels that are lit by the lighting texture, so the mod cannot tell the difference between pixels from a regular tile, and pixels from the glow effect of a spelunker potion.

Suggested future mod version:
My plan is to try to rewrite the mod and implement a shader that multiplies the tile texture color by the light texture color and apply the shader while drawing tiles, but I'm not currently sure how long that will take.
The difference between this fixed mod version and the current version is that lighting will no longer be done in a single step after all drawing is finished. The mod will be able to treat glowing objects differently from lit ones.

Rexus the wolf

there is a horrendously annoying bug, great mod, this bug ruined it all, what is it? dangersence, hunter and spelunker potions arrent working...., i always mine using that, now? mining takes around 3 hours longer for a total of 5 because i sometimes mine for 2 hours xd, more loot means more joy for me hahah

please fix



There is 2 major bug I finded while I played with your mod was on:

1. When drinking a Spelunker Potion, it will not show any ores or any nearby objects or treasure.

2. When night ends and the sun comes up, it can be seen that the lightning is a bit wierd or glichy in a way.

If you would pls fix this, that would be rly great! I love your mod, it rly adds much more and a brand new feeling to the game.

Update: Also, your mod makes the the Crystal Shard or any that type of object to not glow at all, or just very low, that will makes it rly hard to find it too, even more so, cuz Spelunker Potion not working either, as I said it once.
The crystal shard thing is kind of an understandable oversight, looking at the tModLoader page. It says "Ore dusts have been supressed because they were revealing ore in complete darkness." For the meantime though, I will just keep the mod disabled until future patches regarding this problem because I don't want to search fr the hardmode ores (+Chlorophyte) in complete darkness.
Top Bottom