cm0002 to Color@lemmy.cafeEnglish · 3 hours agoShould you normalize RGB values by 255 or 256?30fps.netexternal-linkmessage-square1fedilinkarrow-up13
arrow-up13external-linkShould you normalize RGB values by 255 or 256?30fps.netcm0002 to Color@lemmy.cafeEnglish · 3 hours agomessage-square1fedilink
minus-squareinsomniac_lemon@lemmy.cafelinkfedilinkEnglisharrow-up1·edit-22 hours agoSomewhat similar thing, this is what I came up with to quantize to 12-bit-RGB (shorthand hexadecimal, e.g. #AC3 --> #AACC33) in a Godot shader: COLOR = vec4((round(color.r * 15.0) / 15.0), (round(color.g * 15.0) / 15.0), (round(color.b * 15.0) / 15.0), color.a); Maybe there’s a better way (I’m wasn’t sure how to see actual numbers, other than knowing it’s linear color space) but it works. For example it takes #135531 in a bit of AA (between label outlines) and turns it to #115533.
Somewhat similar thing, this is what I came up with to quantize to 12-bit-RGB (shorthand hexadecimal, e.g.
#AC3-->#AACC33) in a Godot shader:COLOR = vec4((round(color.r * 15.0) / 15.0), (round(color.g * 15.0) / 15.0), (round(color.b * 15.0) / 15.0), color.a);Maybe there’s a better way (I’m wasn’t sure how to see actual numbers, other than knowing it’s linear color space) but it works. For example it takes
#135531in a bit of AA (between label outlines) and turns it to#115533.