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

r_vbo breaks lightmap drawing with r_lightmap #79

Open
Aciz opened this issue Sep 26, 2022 · 11 comments
Open

r_vbo breaks lightmap drawing with r_lightmap #79

Aciz opened this issue Sep 26, 2022 · 11 comments

Comments

@Aciz
Copy link
Collaborator

Aciz commented Sep 26, 2022

r_vbo 0; r_lightmap 1
2022-09-26-183349-warbell

r_vbo 1; r_lightmap 1
2022-09-26-183403-warbell

r_vbo 0; r_lightmap 1 (Oasis is compiled with -approx so some surfaces are expected to not have lightmap)
2022-09-26-183422-oasis

r_vbo 1; r_lightmap 1
2022-09-26-183429-oasis

Looking closer at the surfaces with vbo + lightmap, there is some weirdness with blending going on
2022-09-26-183806-oasis

And as a bonus: r_detailtextures 0; r_vbo 1; r_lightmap 1 is completely borked, with only very few surfaces being lightmapped (the canopys in this scene)
2022-09-26-184033-oasis

@Mateos81
Copy link

The "weirdness" seems to be the detail part of the shader

@ensiform
Copy link
Member

At the moment I'm not sure if I've derped in the port or if this also affects Quake3e.

@Aciz
Copy link
Collaborator Author

Aciz commented Sep 26, 2022

Seems to work fine on q3e/oDFe, both OpenGL and Vulkan.

@Aciz
Copy link
Collaborator Author

Aciz commented Sep 26, 2022

Never mind, on another map I do have issues (dfwc2012-3), but this seems to be limited to OpenGL. I see 0 lightmapped surfaces with r_vbo 1.

shot-20220926-232632

shot-20220926-232637

@ensiform
Copy link
Member

Maybe @ec- has some ideas where we can look.

As I said above, not sure if this is because of external lightmaps or something entirely different.

@Aciz
Copy link
Collaborator Author

Aciz commented Sep 26, 2022

I can test tomorrow in ET with a map I know for a fact that uses internal lightmaps. Did not check if dfwc2012-3 used internal or extlmhack

@Aciz
Copy link
Collaborator Author

Aciz commented Sep 27, 2022

Doesn't seem to be limited to external lightmaps, this map (Snatch 3) uses internal lightmaps. DFWC2012-3 is also using internals.
2022-09-27-084116-snatch3
2022-09-27-084125-snatch3

@ensiform
Copy link
Member

Is that map also available in Q3 to check there

@Aciz
Copy link
Collaborator Author

Aciz commented Sep 27, 2022

Snatch 3? No, but the reason I brought that up is that it's one of the few ET maps that uses internal lightmaps, which is the standard for most (especially older) Q3 maps, which also have this problem, therefore I doubt it's got anything to do with internal/external lightmaps.

@ec-
Copy link
Collaborator

ec- commented Sep 28, 2022

\r_lightmap is a debug feature which:

  • correctly works only in pair with \vid_restart
  • not intended to use with performance-focused features like \r_vbo 1

Personally I wouldn't bother making code more complex so just disable \r_vbo if you need \r_lightmap for some reason, for now

@ensiform
Copy link
Member

I did find that this code block,

https://github.com/etfdevs/ETe/blob/master/src/renderer/tr_shade.c#L1237-L1245

Does not have VBO equivalent but I tried implementing as the following it and it made no visual difference.

if ( r_lightmap->integer && ( pStage->bundle[0].isLightmap || pStage->bundle[1].isLightmap ) ) {
			stateBits &= ~(GLS_SRCBLEND_BITS | GLS_DSTBLEND_BITS);
			stateBits |= (GLS_SRCBLEND_ONE | GLS_DSTBLEND_ZERO);
		}

Another note, I guess I might want to check the fading code above the r_lightmap block too as I do not know if that is implemented either. 😅 But do not know what effects make use of it to verify broken-ness.

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

4 participants