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

Problem with fog and sky #176

Open
Yberion opened this issue Aug 31, 2024 · 0 comments
Open

Problem with fog and sky #176

Yberion opened this issue Aug 31, 2024 · 0 comments

Comments

@Yberion
Copy link

Yberion commented Aug 31, 2024

Hello,

Someone on JKCommunity's discord pointed out there might be a problem witht he following line:

It appear that the fix should be something like that:

if ( stage == 0 && !shader.sky && !shader.isSky ) {

I'm not sure about !shader.isSky as in the discord's conv they are talking about !issky and I don't know from where that comes from as it's not on jk2mv code.

The explaination is the following:

it causes sky to be drawn in front of transparent elemtns 
which ruins stuff like speed ghosts
or applied ent alpha
...
basically the place where SS_FOG is applied to stuff
but it shouldnt be applied to sky

Edit:

Additional context:

A: only one !issky check is needed

B: there is no issky in jk2mv code

A: well issky or sky, same thing
A: the check should be whether its a sky shader thats all

It seems that the following should be enough, said person A

if ( stage == 0 && !shader.isSky ) {
A: this is how it looks for me
A: sky, at least in my fork, is a skyParms_t struct
A: issky is a qboolean

I think OpenJK fixed it this way https://github.com/JACoders/OpenJK/blob/master/codemp/rd-vanilla/tr_shader.cpp#L3185

A: so openjk has a "fix" but it doesnt reference the qboolean issky but the sky struct. maybe it works by accident
A: right. it should be only !issky probably. maybe it still works with !sky because by default that struct evaluates to 0
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

No branches or pull requests

1 participant