Light Colorations

This forum is for anything that doesn't specifically have to do with Better Than Wolves
Post Reply
User avatar
DocHussey
Posts: 190
Joined: Fri Jul 06, 2012 1:02 pm
Location: Jackman, ME

Light Colorations

Post by DocHussey »

Alright, I noticed that in the Dev Diary thread someone mentioned about light colorization. I made an uninformed post, and was told to move it here, which seems like a good idea.
Why can't light sources from different blocks be colored independently? They all reference the file "light_normal.png" for their colors, but couldn't that little snippet of code be changed to reference say "light_lava.png"? I really don't know anything about Java, and in other coding I've done/seen, it's a simple task to change that ref line. Anyone know why this isn't possible/hasn't been done yet?
FlowerChild wrote:I'm drawing a line in the soul sand.
finite8 wrote:Give me all your diamonds and your enchanted gear or your base is going to resemble a Chunk Error.
User avatar
Anbaric
Posts: 217
Joined: Tue Aug 21, 2012 10:22 am

Re: Light Colorations

Post by Anbaric »

See, it seems like the easiest thing in the world. Make like five or six copies of the light_normal.png, and change that single line of code in each light-giving source to use a different file. Then you can color each of those files whatever you want. Not quite sure why it hasn't been done yet, but soon I'll be wanting to start programming, and this kind of easy change would probably become my first mod.
Things about me.
Show
1: I hate all updates past 1.2.5. Server lag in SP?!?
2: I've never made it to SFS.
3:
User avatar
Magnavode
Posts: 42
Joined: Fri Sep 14, 2012 6:51 pm

Re: Light Colorations

Post by Magnavode »

Having lurked this forum for a while now and being a java dev myself I thought it would be a good time to register and post something useful.

It's because Minecraft stores it's light values in 2 arrays of 4 bit values. One array for sky light and one array for block lights. It stores a light value from 0 to 15 (16 = 4 bits) this is the block light values that everyone who plays Minecraft should be familiar with.

To get new colors in this system you would either have to;
- create a third array to store light values for each block.
or
- change the system to store rgb values. This could end up rather complex.

This is obviously quite difficult to do, not to mention the extra cpu time the system would need to calculate everything.
Also: blending.
Last edited by Magnavode on Fri Sep 14, 2012 7:59 pm, edited 2 times in total.
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Light Colorations

Post by FlowerChild »

Anbaric wrote:Not quite sure why it hasn't been done yet
...
this kind of easy change would probably become my first mod.
Seriously, don't you see a bit of a problem with the above?

Guys, if you haven't looked at the code, and are assuming something is "easy", and nobody has yet to do it, guess what? You're probably wrong.

I didn't want this discussion going on in the dev-diary thread as it was so full of face-palm I risked giving myself a concussion.
User avatar
PatriotBob
Posts: 276
Joined: Mon Sep 10, 2012 10:47 pm

Re: Light Colorations

Post by PatriotBob »

Because nearly the entire rendering pipeline would need to be overhauled.

I read the Jeb was looking into it, and died a little on the inside.
But such is the life of a dev that inherits terrible code.

I'll see if I can look up the link...
Image
User avatar
DocHussey
Posts: 190
Joined: Fri Jul 06, 2012 1:02 pm
Location: Jackman, ME

Re: Light Colorations

Post by DocHussey »

I didn't mean for this to turn into an all out derp fest, I just remember doing some modding for games like Neverwinter Nights and Diablo 2 and those kinds of things were common and easy to do. Struck me as odd, and I was hoping that someone could explain why it was so nasty...
FlowerChild wrote:I'm drawing a line in the soul sand.
finite8 wrote:Give me all your diamonds and your enchanted gear or your base is going to resemble a Chunk Error.
Post Reply