Colored lights is a mod that aims to add colored light to Minecraft, adding an extra layer of visuals. It's been well sought after, and was finally achieved with CptSpaceToaster's Easy Colored Lights mod, which has since been discontinued. CptSpaceToaster's mod used ASM, a library which injects code into existing class files, to achieve this effect. I am working on achieving it without the need for assembly and base class edits, making it more compatible and writing it in pure GL code.
For those who say this is not possible, I hereby provide a counter example, (albeit quite beta):
I have been able to render smooth, any colored light with negligible framerate impact on my rig in a development environment. If you want to see my progress, stick around and I"ll be sure to keep you up to date on my progress.
What am I trying to accomplish?
I am trying to add three channels of light to blocks so that they appear to diffuse, emit, and mix blue, red, and green channels of light. Existing lighting items, (torches, glowstone, etc), should all have the same light values, but might have a tint around them. Worlds that use this mod should be backwards compatible with other mods for them to work efficiently. (Make backups just to be sure!) My goal is to have this mod use as FEW BASE EDITS AS POSSILBE, none if I can manage it. This mod will always require forge, as it allow me to hook into various parts of the game. The API part of the mod will be a separate download from the demo part of the mod, which will contain various colored blocks.
Where's the Download?
I am not going to release a download until I feel that it is stable enough and in a decent state to be released. Right now I can implement types of light, but they sometimes glitch when mixed together. Because of this, I'll be waiting to release a fuller version of an alpha until I get the mod completely latched down.
Post here in the forums if you have a crash report. PLEASE PUT IT IN SPOILERS. Include the version of the mod, your graphics card Minecraft is running off of (and driver version), and your Forge version. If needed, put an image of the problem. If you wanna chat, you can find me on Espernet in the channel KColoredLights.
The actual OpenGL code used to render the light is only 24 lines of code long; it's not too bad. The main reason why it's not already in the game is because in the game's early state, the lighting system was written BY HAND, and has predominantly stayed that way, with the devs choosing not to use a lot of OpenGL's lighting. (In fact, GL_LIGHTING is DISABLED in Minecraft's code).
I'll help test mod interactions with this new iteration as soon as it's released. May I suggest setting up a Google spreadsheet in the same way Cpt did? That made it really easy to publish issues/crashes without filling the forum thread.
A question to head off others that may ask: will this work with Optifine/FastCraft/Shaders mod?
And so it begins. Following this closely as I see it being very valuable for my upcoming super-sized adventure map. Thank you for continuing this, it's so very needed.
PS: I'm as giddy as a little girl knowing this is being continued. No joke.
PS: I'm as giddy as a little girl knowing this is being continued. No joke.
Same here. Colored lights have been my dream since the 1.6.6 beta days. There's a little imp in my head that sees colored lights in Terraria and starts grumbling, even though I know the technical challenge is much more complex than that.
I'll help test mod interactions with this new iteration as soon as it's released. May I suggest setting up a Google spreadsheet in the same way Cpt did? That made it really easy to publish issues/crashes without filling the forum thread.
A question to head off others that may ask: will this work with Optifine/FastCraft/Shaders mod?
And so it begins. Following this closely as I see it being very valuable for my upcoming super-sized adventure map. Thank you for continuing this, it's so very needed.
PS: I'm as giddy as a little girl knowing this is being continued. No joke.
Cool, stay tuned for updates, I'll post things from time to time on progress.
I've encountered a bug where enabling GL_LIGHTING kills grass and leaves color. To investigate, I tried to disable GL_TEXTURES_2D and see if there's an extra render step in grass and leaves. Turns out there was, here's side to side of what with and without lighting does to the blocks:
Without GL_LIGHTING enabled:
With GL_LIGHTING enabled:
I believe this is caused by an extra rendering step done by the engine on grass and leaf blocks, but I'm not quite sure of the similarities between the two in terms of code.
After digging a bit more, I found out that the problem was that it was rendering it with no color overlay, and would just point to the bland greyscale textures. I've replaced one of them, which seems to have fixed it:
This is going to be a temporary fix until I can figure out how to force the textures to choose a correct lightmap value.
Nice, hope this gets a release soon gonna be awesome with RTG alongside
moar realismzzzzzz....
.. you know I'm going to set the cover blocks for different biomes in the RTG config to different colored glowstone right? It'll be like Tron, but with realistic terrain - you'll love it!
Gonna start work again in a few minutes; fixing textures has a temp fix that I may leave in for release, but need to add spotlights now. Would development streams be something that would be of interest?
All the alpha file would do would be initializing lights and tinting the world. If you still want it, HMU. I'll create an IRC on espernet called #KColoredLight if you would like to join me there.
I'm not a streams guy, but having access to dev releases would help me test in a more timely manner (I almost always used latest releases from Cpt's dev server while he was actively working on his version).
I'm not a streams guy, but having access to dev releases would help me test in a more timely manner (I almost always used latest releases from Cpt's dev server while he was actively working on his version).
I don't currently have a build system set up other than the default gradle and haven't used Jenkins or the sort before, but I'll look into it. It'd certainly be better than simply sending you a release VIA PM or something.
No, that's what I'm trying to avoid. I'm trying NOT to use ASM in the mod.
Cool, I'll post here when I get those up and ready for you.
I don't currently have a build system set up other than the default gradle and haven't used Jenkins or the sort before, but I'll look into it. It'd certainly be better than simply sending you a release VIA PM or something.
Understood - whatever works best for you. I'll remind myself to check my PMs if a build system doesn't pan out for you.
IDK why MC doesn't have colored lighting to begin with, such a minor change that adds in such a dynamic and major update to the flavor of the game.
and thank you for continuing the work.
The actual OpenGL code used to render the light is only 24 lines of code long; it's not too bad. The main reason why it's not already in the game is because in the game's early state, the lighting system was written BY HAND, and has predominantly stayed that way, with the devs choosing not to use a lot of OpenGL's lighting. (In fact, GL_LIGHTING is DISABLED in Minecraft's code).
I'll help test mod interactions with this new iteration as soon as it's released. May I suggest setting up a Google spreadsheet in the same way Cpt did? That made it really easy to publish issues/crashes without filling the forum thread.
A question to head off others that may ask: will this work with Optifine/FastCraft/Shaders mod?
And so it begins. Following this closely as I see it being very valuable for my upcoming super-sized adventure map. Thank you for continuing this, it's so very needed.
PS: I'm as giddy as a little girl knowing this is being continued. No joke.
Same here. Colored lights have been my dream since the 1.6.6 beta days. There's a little imp in my head that sees colored lights in Terraria and starts grumbling, even though I know the technical challenge is much more complex than that.
Here's the link: https://docs.google.com/spreadsheets/d/1bH6otaeyLcKU_0OaVik_SPIlyTF1AjYBv6IQ2RBso28/edit?usp=sharing
PM me an email you want me to add as an editor. The mod should work with Optifine and FastCraft, as it modifies NO core files. It's quite possible it will work with shaders, but I won't be entirely sure until I have a stable version.
Cool, stay tuned for updates, I'll post things from time to time on progress.
UPDATE:
I've encountered a bug where enabling GL_LIGHTING kills grass and leaves color. To investigate, I tried to disable GL_TEXTURES_2D and see if there's an extra render step in grass and leaves. Turns out there was, here's side to side of what with and without lighting does to the blocks:
Without GL_LIGHTING enabled:
With GL_LIGHTING enabled:
I believe this is caused by an extra rendering step done by the engine on grass and leaf blocks, but I'm not quite sure of the similarities between the two in terms of code.
After digging a bit more, I found out that the problem was that it was rendering it with no color overlay, and would just point to the bland greyscale textures. I've replaced one of them, which seems to have fixed it:
This is going to be a temporary fix until I can figure out how to force the textures to choose a correct lightmap value.
I must be a psychic, didn't check forums for a very long time, and first time I did I caught this on the first day ^^
Glad to see the work continue.
P.S. I've been experimenting with 1x1 texture pack like this myself, looks kind of nice and smooth (I know there are no textures btw)
Yep! Quite convenient timing.
.. you know I'm going to set the cover blocks for different biomes in the RTG config to different colored glowstone right? It'll be like Tron, but with realistic terrain - you'll love it!
Gonna start work again in a few minutes; fixing textures has a temp fix that I may leave in for release, but need to add spotlights now. Would development streams be something that would be of interest?
All the alpha file would do would be initializing lights and tinting the world. If you still want it, HMU. I'll create an IRC on espernet called #KColoredLight if you would like to join me there.
Everyone's free and encouraged to join it and ask questions.
Well isn't this just doing GL11.color() whenever a lightmap texture is received? Thats a lot to ASM
Also do servers store the colored light or is it just client side
I'm not a streams guy, but having access to dev releases would help me test in a more timely manner (I almost always used latest releases from Cpt's dev server while he was actively working on his version).
No, that's what I'm trying to avoid. I'm trying NOT to use ASM in the mod.
Cool, I'll post here when I get those up and ready for you.
I don't currently have a build system set up other than the default gradle and haven't used Jenkins or the sort before, but I'll look into it. It'd certainly be better than simply sending you a release VIA PM or something.
Understood - whatever works best for you. I'll remind myself to check my PMs if a build system doesn't pan out for you.
It wouldn't really, just replace any lookups to the lightmap array with an Opcode.invokestatic to call a method that colors it automatically.
Seems like it would save you a lot of trouble
I set up a buildsystem. I'll PM you an account for access to development builds.
I COULD, but I could also not do it that way. That makes it really painful to do things I want to do later on with the mod.