Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color displays as black if Horizon color is too low #1

Open
ABelliqueux opened this issue Jun 24, 2021 · 1 comment
Open

Color displays as black if Horizon color is too low #1

ABelliqueux opened this issue Jun 24, 2021 · 1 comment
Assignees
Labels
need checking Looks like it's fixed, but maybe not

Comments

@ABelliqueux
Copy link
Owner

ABelliqueux commented Jun 24, 2021

If Far color / Horizon color is < 100 (0.10 in blender), the corresponding channel color will display as black.

Example level0.c file :

CVECTOR level0_BGc = { 100, 218, 216, 0 };

results in :
2021-06-24-211924_682x505_scrot

CVECTOR level0_BGc = { 0, 218, 216, 0 };

2021-06-24-211901_685x506_scrot

Might be an error in the linear to RGB conversion function.

Also could be due to psyq dpq calculation. See LibRef47.pdf, p.450 and LibOver47.pdf, p.133, "Light Source Calculation" :

LLM == Local Light Matrix
LLV  == Local light vector
LC    == Local Color
BK   == Back Color
FC   == Far Color
p     == interpolation coefficient

LLV = LLM * v0
LC = BK + LCM * LLV
v2 = (1 - p) * v1 * LC + p * FC

v0 -> vx, vy, vz
vl -> r, g, b
p
NormalColorDpq(): v2 -> r, g, b
@ABelliqueux
Copy link
Owner Author

BG and BK colors now haw a minimal value of 63 : ABelliqueux/blender_io_export_psx_mesh@67d9d3a

This + 800be60 should make for more comparable colors.

@ABelliqueux ABelliqueux added need checking Looks like it's fixed, but maybe not and removed bug Something isn't working labels Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need checking Looks like it's fixed, but maybe not
Projects
None yet
Development

No branches or pull requests

1 participant