tModLoader

tModLoader

Fancy Lighting
467 Comments
Nahuelwg 11 hours ago 
ultra mode lighting is so pretty for building, i love it
flamedance58 Jul 13 @ 3:27pm 
Damn this makes the game pretty!
Downloaded, Set to Ultra, Enjoying it!
Zero lag so far but then again I'm not running any of the overhaul mods like Calamity or such.
dp413710 Jul 11 @ 4:51pm 
and it was this mod
dp413710 Jul 11 @ 4:42pm 
Either this mod, realistic sky, or lights and shadows is causing MAJOR lag, it used to work fine (i was using an Intel at that point, now i'm using the nvidia mx330, although i think it's instead now using the iGPU) below 1 fps, frame skip off does nothing, even happens when game is paused, I was running it at 4k on my other pc, now I am running it at 720p, still below 1fps, I need atleast 25 fps, a decent amount (people complain about 60fps, i find that stupid cause the eye can't tell a difference between 60fps and 48fps)....... the integrated gpu is the also the intel iris xe graphics. I tried using '/gldevice: D3D11' in the launch params to use the gpu with the directx 11 backend, but no luck, and also, I'm too lazy to code my own optimization mod, and this mod disabled nitrate's experimental render (found it in the source code, don't ask how i got it), if I was not lazy, i would just code the entire optimizations and force it to use direct x 11 for all graphics,
Rex  [author] Jul 10 @ 5:32pm 
I'm glad you're enjoying this mod! Unfortunately, I think increasing the frequency of lighting updates would have a large impact on framerates. Terraria computes lighting only once every four frames (at 60 FPS; I'm not sure how High FPS Support affects this), and tiles, non-solid tiles, and walls are rendered on separate frames in a 4-frame cycle that also includes some other things. If we wanted the lighting to update every frame, there would not only be 4x as many lighting updates, but tiles and walls would also need to be rendered 4x as many times. This would likely reduce performance significantly.
СЕРОВОДОРОД Jul 10 @ 7:43am 
That's actually one of the best graphic mod available on TML. Vanilla Terraria surely need this. But I've stumbled upon an irritating (for me) thing. Is there a way to increase refresh rate of the lighting? Because I see that it refreshes not every frame. There are some frames where the lighting doesn't update according to my position, which is really annoying to my eyes for some reason. I'm playing at 300 fps, so maybe it's because of the frame rate. Is there a way to increase the refresh rate?
Still, an excellent mod! From Russia. :coolstar2022:
Nahuelwg Jun 30 @ 6:13pm 
holy moly rtx terraria
loganrob08 Jun 26 @ 10:23am 
I see, thank you for looking into it
Rex  [author] Jun 25 @ 11:35pm 
Lighting is computed on a per-tile basis, so the precise variation in light level within a tile that would be required for sharp edges like in your image isn’t there. Instead, the current implementation smoothly interpolates light between tiles (which has the added benefit of looking somewhat like soft shadows). I think doing the more precise lighting with any reasonable level of performance would require using the GPU, which could be done but it would still be very expensive due to the resolution required, especially if there are a lot of light sources. However, I don’t have much experience implementing algorithms on GPUs, so I could be wrong about the performance cost.
loganrob08 Jun 25 @ 5:01pm 
For the shadows do you think you could add a pixelated filter or shader that matches Terraria's block resolution, similar to the style of your coarse normal map but with shadows? I think it would look very interesting and fit Terraria well.

Example: https://steamcommunity.com/sharedfiles/filedetails/?id=3508742015
bonk Jun 25 @ 1:11pm 
Responding back a bit late my fault, theres a couple of shortcuts i've seen applied in other 2d game engines, one of which being instead of a measurement of light travel distance its a simple gradient from water surface down, but I dont think its applicable in the ancient terraria engine.
modvlad15 Jun 25 @ 10:10am 
i think it does the same thing as lights and shadows, but i wanna add it as an addon.
modvlad15 Jun 25 @ 10:09am 
Is this mod compatible with the Lights and Shadows mod? please respond! :sans:
Rex  [author] Jun 19 @ 11:55pm 
@zircron In the vanilla lighting engine, the amount of light each tile of water absorbs is an RGB value. Due to performance reasons, the fancy lighting engine uses only a single number for this. Unfortunately you will have to disable the fancy lighting engine to retain the effect of light getting colored by water.
CursedSFMS Jun 19 @ 11:09pm 
Did you say... Bizarre?
bonk Jun 19 @ 9:59pm 
Bizzare question to ask but its a pet peeve of mine. Do y'all think you can add volume absorption to the water? Main example being the ocean shading, if you look at vanilla lighting the further the light travels the bluer it gets, starting at a softer cyan ish look near the top and shifting towards a deep blue as it gets deeper, while with the fancy lighting engine it only gets dimmer. Fantastic work on this btw!
HansingBansing Jun 19 @ 4:06am 
nvm I fixed it with verifying game files
HansingBansing Jun 19 @ 4:02am 
it goes completly white when hdr is enabled
KrisDreemurr Jun 18 @ 3:59pm 
Can we get sky only version pls?
Mateus Jun 10 @ 1:39pm 
I just did a bunch of tests with and without my mods and now i wasn't able to experience the issue again, perhaps it was a one time only kind of problem, maybe it had something to do with the fact that i haven't played it in a long time and the mod updates kept accumulating.
Rex  [author] Jun 9 @ 8:32pm 
@Mateus I can't replicate this issue. Are you running any other mods? What settings are you using?
Mateus Jun 5 @ 4:46pm 
So, for whatever reason those recent updates just make your screen complety white whenever you have this mod on exept UI, i've messed around with the configs and it looks like its the mod itself.
ANANAS Jun 4 @ 11:26pm 
Окак
:| Jun 1 @ 8:00pm 
Really great mod, wish my computer was good enough to run it because my FPS goes down to, like, 20 with it even just at 1080.
Ms.Sprite Jun 1 @ 8:39am 
Looks beautiful!
76561198063831608 May 31 @ 5:36pm 
Here are the logs I could find: https://pastebin.com/aQQ8tMCX
I've just enabled it again and it doesn't seem to crash anymore, but I'm betting it'll come back eventually.
Rex  [author] May 30 @ 9:52am 
Strange. Are there any error messages?
76561198063831608 May 29 @ 6:54pm 
For some reason, it started crashing constantly after alt-tabbing every time I had summoned the flying piggy bank using Money Trough. I had to disable it for that reason, shame.
Naro von Bali May 26 @ 5:49pm 
this burned my gt 1030 help
APo May 26 @ 8:19am 
Looks beautiful!
Sabastein May 25 @ 3:04pm 
got it! btw using ultimate setting can make that square smaller.
Rex  [author] May 25 @ 12:58pm 
That problem also occurs in vanilla.
Sabastein May 25 @ 11:46am 
how can I fix the problem that I tap shift to use torch for a second in pitch black area. When torch off and all back to pitch black. There would be a visual bug that all walls gone ( can see the biome background) in a square shape.

*test in underground. without dirt wall there's no this bug though
仔仔 May 24 @ 1:29am 
good
Lool & Saturlo May 21 @ 9:24am 
adding to doomzy's comment : infernum lunatic cultist forcefield exists in all difficulties , though only on infernum hdr makes it ultra bright
Rex  [author] May 20 @ 7:53pm 
FancyLightingMod.UseBlackLights is used when rendering glow effects. It replaces all non-black light colors with near-black so that only glowing objects (such as glowmasks) are rendered brightly. This is how smooth lighting knows which pixels use normal lighting and which pixels have their own glow lighting. It's somewhat inefficient because tiles have to be rendered multiple times, but I haven't found a better solution.
Moonlight Glint May 20 @ 6:04pm 
Is [code]FancyLightingMod.UseBlackLights[/code] something that might be useful for other mods to use for compatibility like much of the other code that isn't exposed, or something that's really only for the inner workings of this mod?
Doomzy May 20 @ 3:21am 
Ok I have return to inform that after thorough testing, Infernum Lunatic Cultist and Infernum Supreme Calamitas are the only bosses that have HDR errors that were extremely noticeable. I tested Calamity, Infernum, Hunt of the Old God, and Catalyst.

Lunatic Cultist has a forcefield around him that becomes ultra bright, making it impossible to see his sprite during the battle.

Supreme Calamitas shoots a large red circular attack that becomes a giant red glowing ball and obscures all the details of the attack.

HDR Bloom looks really good during these boss battles otherwise. Im not sure if there is a way to make compatibility for specific attacks and effects, but that would certainly be amazing if so! Either way I figured this would be worth bringing to your attention. If I come across anymore, I will notify.
Doomzy May 20 @ 2:01am 
Seems Mod compatability for HDR is working for the vast majority of Infernum, but Lunatic Cultist is def still a concern. If Cultist is fixed it would negate the need for the "Disable during bosses" option, which would be mega pleasing, but not a deal breaker. Love this mod and what you've done here Rex, hats off to ya fella!
Oh, I see. Ok, OK. Thank you for your update. The Mod is great. Maybe I should adjust the resolution from 2K to 1080p and try it again.
Rex  [author] May 19 @ 8:31pm 
I'll try seeing if the new version of Nitrate changed anything regarding its tile renderer. If so, then I'll disable the override. Otherwise, I'll disable the override if smooth lighting is not enabled when the mods are loaded (assuming that the new version still requires a reload to enable/disable the tile renderer). The reason for the override is that the combination of smooth lighting and Nitrate's tile renderer was causing rather severe visual bugs, such as flashing cave backgrounds IIRC. I'll likely have a small update out tomorrow or Wednesday.
Rex  [author] May 19 @ 8:26pm 
If you have a gaming PC and are experiencing performance issues with this mod, then my guess is that you are using the ultra preset and are either using large content mods, running the game at a resolution above 1080p/1200p, or have a high-refresh rate monitor (and so expect higher FPS), or some combination. Large content mods have probably the biggest impact on performance. However, I'm not saying you should disable content mods. After all, they are the biggest reason to use mods. So in this case, I would recommend lowering the in-game resolution to 1080p/1200p and using the high preset. If you still have poor performance, then you could try the low preset to gain at least some benefit. If you have a gaming PC and are still having issues despite all of the above, then I'm afraid I don't know why. For context, my PC with a Ryzen 5600X and RX 580 4 GB (a now 8-year-old midrange graphics card) runs the game with the ultra preset at a rock-solid 60 FPS at 1080p with no other mods.
MOD是个好MOD,但听我句劝,显卡不好别用,我7800XT+14600KF用了帧数暴跌,调了一晚上设置还以为是电脑坏了:GDNormal:
Loksi May 15 @ 3:12pm 
Adding on to last comment maybe adding it to the Mod Compatibility setting or its own option
Loksi May 15 @ 1:32pm 
Is it possible you could make the Nitrate disable change toggleable?
xanderru May 14 @ 7:35pm 
Currently, I'm running Spooky and Thorium. Previously I ran Fargo's Souls, Calamity Fables, and Spirit Reforged for content mods. No other content mods besides that but I do have smaller QoL mods like Magic Storage, AlchemistNPC Lite, and so on. For other "enhancement mods", the only other one besides Fancy Lighting is Terraria Ambience
Rex  [author] May 12 @ 11:06pm 
Are you running any big content mods? 45 FPS is much lower than I’d expect from your hardware but that would be with no other mods.
xanderru May 12 @ 5:05pm 
I'm not using High FPS support so its from 60 FPS to 45-50 which is rather rough.
Ziomislaw May 12 @ 2:34am 
The mod is quite nice and cozy. However it eats your FPS like crazy. Especially underground, my FPS drop from 144 to 90 and sometimes less
Rex  [author] May 12 @ 1:14am 
It depends on your base FPS but a 10–15 (or even more) FPS drop is expected if your FPS before was really high. For context, my laptop with integrated graphics runs the game at 180 FPS (the max my monitor can do) with the mod disabled and around 110 FPS using the default settings for this mod.