CptSpaceToaster / CptsModdingLight

Do What The F*ck You Want To Public License
38 stars 15 forks source link

Colors aren't handled very well in the lighting engine, and could be improved. #11

Closed CptSpaceToaster closed 9 years ago

CptSpaceToaster commented 10 years ago

Blocklight colors are set with RGB components 0 to 15. In the lighting engine however, each step out to a new block will decrease the brightness of each component by 1, usually forcing at least one of the color components to 15. This works for some lights, like Red, or Cyan, which look good when their components degrade evenly from 15 to 0 over the span of their reach. non-uniform colors like light-blue and orange however aren't able to retain their color accuracy.

Orange in particular is hard to balance, as any green given to the "orange" color will degrade by 1 each block, and run out before the red has, leaving the center to appear yellow-ish orangish, while the edge just looks like a red light.

With the adoption of the fixed pipeline shader, there should be an alternative to render colors differently. It should be possible to alter the lighting engine to maintain constant color, and handle brightness through the old L-value that's kept for backwards compatibility.

If properly implemented, this allows for all 4096 colors without having to worry about the lighting engine interpreting the colors to be something else. Also, we have the ability to set Black (r=0, g=0, b=0) to something like an oscillating Hue slider every tick... Rave lights anyone?

CptSpaceToaster commented 10 years ago

Old: BlockTexture * (Colormap + Sunlight)
New: BlockTexture * ((Colormap*oldL-Value)+Sunlight)

CptSpaceToaster commented 9 years ago

Hmmmm... this doesn't seem to be a good solution: Derpy Lights