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

OpenGL2: Fix sun rays being affected by the viewport size #635

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

zturtleman
Copy link

Using r_drawSunRays 1, r_hdr 0, cg_viewsize 50 caused the sun rays to only draw properly in the bottom right quarter of the world viewport.

The scissor rectangle for the world viewport was applied to the first FBO_FastBlit() in RB_SunRays().

Set glScissor() in FBO_FastBlit() as it's done in FBO_Blit() and FBO_BlitFromTexture(). Sun rays probably worked correctly with r_hdr 1 because the blit for HDR changed the scissor state.

Fixes #305.

Using r_drawSunRays 1, r_hdr 0, cg_viewsize 50 caused the sun rays to
only draw properly in the bottom right quarter of the world viewport.

The scissor rectangle for the world viewport was applied to the first
FBO_FastBlit() in RB_SunRays().

Set glScissor() in FBO_FastBlit() as it's done in FBO_Blit() and
FBO_BlitFromTexture(). Sun rays probably worked correctly with r_hdr 1
because the blit for HDR changed the scissor state.
@zturtleman zturtleman merged commit 7426ac2 into ioquake:main Feb 8, 2024
3 checks passed
@zturtleman zturtleman deleted the opengl2_sunrays branch February 8, 2024 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpenGL2: r_drawSunRays 1 + r_hdr 0 is broken with cg_viewsize < 100
1 participant