kool kitty89, on Sat Sep 24, 2011 1:37 AM, said:
Why have the colorspace designed around only shading towards black rather than making intensity 0 black and 255 white for all hues, with 127 or 128 at "normal" saturation and intensity for any given hue? (128 shades is still pretty damn smooth, and allows a lot more flexibility for lighting effects)
This would be a cool feature, but it's not obvious to me how to implement it.
I don't want this thread to spiral out into a discussion of 3D lighting, but your approach seems to mix two unrelated kinds of blending: Additive and multiplicative. These are different effects used at different times.
Multiplicative blending is for standard lighting, including gouraud shading. If you have a pure blue floor (say 0,0,150), no matter how brightly you light it, it saturates at pure blue (0,0,255), not white.
Additive blending is for overlaying objects. If I want to place white fog over distant pixels, I might add white (150,150,150) to the blue floor (0,0,150) yielding a washed out whitish blue (150,150,255). Same trick is used with overlaying explosions, rain (subtraction), and other particle effects that are semi-transparent.
In CRY, the blitter does your additive blending, and Y does your multiplicative. In the PS1, the blitter can do both. The PS1's approach uses a lot more hardware and is slower than the Jaguar at shading pixels, but it's more versatile.
So, before we extend the range of Y, realize that this is only good for simulating VERY bright lighting conditions, not for fog, explosions, and other overlay effects. In other words, a lot of what we'll need to do is similar to the high dynamic range capabilities that appeared in 21st century consoles.
The problem with extending the range of Y comes down to how gouraud shading and multiplicative lighting work. Y
must have a linear relationship to perceived intensity, or shaded polygons will look blotchy and 'uneven'. CRY does this already. If I have red-purple (255,0,127) and I cut Y in half, I have half the perceived brightness and the exact same red-purple color (127,0,63).
Now how can we maintain this while increasing the range of Y? First, let me try Y=2.0 with my red-purple. On my first try, I don't have red-purple anymore, I have pure purple (255,0,255).
But much worse, I don't have double the perceived intensity. The human eye perceives blue as the 'least intense' color. We can use a common formula to estimate perceive intensity: 0.299R + 0.587G + 0.114B
With Y = 1.0, or 255,0,127, intensity is 90.7. With Y = 2.0, or 255,0,255, intensity is 105.3.
So to achieve the required intensity for smooth shading, the color we need to use is a very washed out white-purple, or 255,130,255, with intensity 181.625.
I'd encourage you to create equations to do proper, saturating, smooth gouraud shading with Y > 1.0. However, the best I can come up with requires 9 multiplies and 9 additions. This is WAY more hardware than the 3 multiplies and 0 additions used in the Jaguar's CRY. I can't think of a good way to fit any of this into a look-up table smaller than thousands of entries, which wouldn't fit on the chip, either.
Hardware isn't the worst part. To implement your proposal where Y=255 is white for all colors, while keeping Y linear for proper shading, Y=2.0 is not near enough. Let's say I start with blue and I want to light it with white hot sunlight. To get from (0,0,255) to (255,255,255), while keeping linearity in Y, requires Y = 8.7. Let's make it 8.0 for simplicity.
We haven't just halved our number of colors, we've cut it by a factor of 8. Now CRY has no advantage over 16-bit RGB, because the majority (>80%) of all colors are white.
I know we end up here a lot, but the Flare engineers were very good. Their problem was they started with the wrong requirements, not that they left low hanging fruit behind!
Quote
The other issue is with their comments on what colors the human eye is most sensitive to, especially their mention of red being most important when Green is universally considered to be the color of light the human eye is most sensitive to.
I think you're misunderstanding what they meant. It is true that red contributes less to perceived intensity. But when intensity is provided by an 8-bit channel already, this is not about intensity. Rather, this is about how your eye differentiates subtle differences in color at the same intensity. From this perspective, which is the one that matters when choosing CR, it is correct that green is less important.
Blue is actually most important. Humans are very good at differentiating shades of blue. Some people think this is related to outdoor depth perception, because distant objects turn very subtly blue due to atmospheric effects.
- KS
Edited by kskunk, Sat Sep 24, 2011 1:48 PM.