52
« Last post by Holy_Diver on June 22, 2020, 04:22:17 am »
CORRECTION: For the record, back in this thread I made a lot of posts as I was trying to figure out how to map the texture's color to match the PlayStation in an emulator. Well, last week I began to notice that a lot of different formulas with different exponents could be made to approximate the same color, so even though I had matched 90% of the pixels in the screenshots to exact color values to the RGB 8-bit color codes, there were still some things I could not reproduce. And honestly, the color always seemed a little bit wrong to me.
And I knew the formula had too many terms in it to likely be the real formula, since so many others could be made to work.
So I went back to the drawing board and was able to determine that the real exponent was 1.25, or that's extremely close anyway, and it also happens to match the black fog's curve. I also realized that the curve could be moved to the center of the texture values and still look good, so I figured the real formula would do this, and so I think I now have an exact formula that is in the general ballpark. I'm no longer interested in exact matching because I don't necessarily like the PlayStation color I think, although the following formula must be extremely close to it, and it looks very nice, so I don't expect I will be tinkering with it any further. The reason I was so interested in matching is I had no other way to determine the lighting conditions. If the color was wrong I couldn't accurately say my lighting was right, but I know it's close enough now.
gamma_y = (pow(y+0.5,1.25)-0.42)*1.575
The 0.42 part is exactly 0.5^1.25 so the final 1.575 part is the only interesting part of the formula. If it was 1.66 it would be less interesting, perhaps that's what the PlayStation is using. It seems brighter. 1.66 is 1.5^1.25. In hindsight this is the simplest formula I can imagine and I'm sure the first formulas I must have tried were nearly identical. But I never thought the exponent was as low as 1.25, so I never tried it. And I just went with the first formula I tried that was a close match.
That was a mistake and a lot of my troubles I had with trying to make the color better (not necessarily accurate) would run into trouble with the contrast being too great, so I was relieved to find out 1.25 was the exponent, since that's much lower than anything I'd tried up to that point, so I was under the impression it would be low contrast. It actually took me a while to think to try it, but I had by that point realized the exponent had to be lower and I was pretty confident it would be right.
My project is going very, very well, much better than I'd expected it to, so I'm pretty confident it's going to work out without a hitch. I do fear it might ultimately prove unable to even satisfy myself, but so many things have been going super lately my attitude is one of anticipation as opposed to reservation.