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

WoP's sky lens flare should read the sun coordinates from the q3map_sun key of the skybox shader to avoid mismatch with opengl2 sun rays feature #275

Open
kai-li-wop opened this issue Jun 25, 2024 · 0 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed
Milestone

Comments

@kai-li-wop
Copy link
Member

kai-li-wop commented Jun 25, 2024

WoP's sky lens flare requires two keys in the world spawn of a map (skylensflare and skylensflare_dir) to define the lensflare script and the position according to the cartesian XYZ coordinate system (cg_printDir is helpful), while the sunrays feature takes the position from the skybox shaders q3map_sun, q3map_sunExt (opengl1 shader files) or q3gl2_sun (opengl2 mtr files), which provide polar coordinates here. You could convert them to each other with some math, but mappers usually don't do that and find the “correct” position for the skybox sun by trial and error, so it's an estimate. This usually results in the sky lens flare spot and the sun ray sun spot not being exactly the same. This discrepancy is usually visible when r_drawSunRays is activated.

Possible solution:
Change WoP's sky lens flare feature to ignore the coordinates from the skylensflare_dir key in the world spawn and use the skybox shader sun coordinates instead. Choose q3gl2_sun (mtr files) over q3map_sunExt over q3map_sun (shader files) when searching for the coordinates.

Note: We cannot completely omit the skylensflare key in the world spawn, because all skyboxes with a q3map_sun or so would directly activate the sky lens flare, even for maps that don't want it. skylensflare defines the desired skylensflare script.

@kai-li-wop kai-li-wop added bug Something isn't working enhancement New feature or request labels Jun 25, 2024
@kai-li-wop kai-li-wop added this to the v1.7.0 milestone Jun 25, 2024
@kai-li-wop kai-li-wop self-assigned this Jun 25, 2024
@kai-li-wop kai-li-wop moved this to Todo in WoP 1.7.x Jun 25, 2024
@kai-li-wop kai-li-wop changed the title WoP's sky lens flare interferes with artifical sun created with opengl2 sunrays function WoP's sky lens flare should read the sun coordinates from the q3map_sun key of the skybox shader Aug 28, 2024
@kai-li-wop kai-li-wop changed the title WoP's sky lens flare should read the sun coordinates from the q3map_sun key of the skybox shader WoP's sky lens flare should read the sun coordinates from the q3map_sun key of the skybox shader to avoid mismatch with sun rays feature Aug 28, 2024
@kai-li-wop kai-li-wop changed the title WoP's sky lens flare should read the sun coordinates from the q3map_sun key of the skybox shader to avoid mismatch with sun rays feature WoP's sky lens flare should read the sun coordinates from the q3map_sun key of the skybox shader to avoid mismatch with opengl2 sun rays feature Aug 28, 2024
@kai-li-wop kai-li-wop added help wanted Extra attention is needed and removed enhancement New feature or request labels Aug 28, 2024
@kai-li-wop kai-li-wop modified the milestones: v1.7.0, backlog Nov 6, 2024
@kai-li-wop kai-li-wop moved this from Todo to Backlog in WoP 1.7.x Nov 6, 2024
@kai-li-wop kai-li-wop moved this from Backlog to Todo in WoP 1.7.x Dec 9, 2024
@kai-li-wop kai-li-wop modified the milestones: backlog, v1.7.1 Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
Status: Todo
Development

No branches or pull requests

1 participant