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

Rend2 SP #1179

Draft
wants to merge 104 commits into
base: master
Choose a base branch
from
Draft

Rend2 SP #1179

wants to merge 104 commits into from

Conversation

SomaZ
Copy link
Member

@SomaZ SomaZ commented Oct 8, 2023

So, this is basically a SP port of rend2. This also puts most of the rend2 code to the shared folder. I also started reducing the differences between SP and MP renderer APIs but I think I can do some more, so just a draft for now. This also needs testing.

Many thanks to @AntiAnti for doing the initial SP port and for the additions to the weather code.

@Razish Razish mentioned this pull request Oct 11, 2023
@xycaleth xycaleth mentioned this pull request Nov 12, 2023
SomaZ and others added 27 commits December 12, 2023 16:48
Theres a define in MP that clashes, so it was renamed in MP. Apply this to vanilla too.

Co-Authored-By: AntiAnti <17278566+antianti@users.noreply.github.com>
q_shared.h defines "int COM_GetCurrentParseLine( void )"

q_shared.cpp implemented "int COM_GetCurrentParseLine( int index )"

Fixed now, so function can actually be used.

Co-Authored-By: AntiAnti <17278566+antianti@users.noreply.github.com>
Adding mdr structs, one more texture compression algorithm, some zone tags, and SkipBracedSection function

Co-Authored-By: AntiAnti <17278566+antianti@users.noreply.github.com>
Cleaned up alot of noise. Code formating will happen in another commit.
All work based on: https://github.com/AntiAnti/OpenJK

Co-Authored-By: AntiAnti <17278566+antianti@users.noreply.github.com>
Chose the SP variant of this to get rid of the void pointer in the struct, so potentially less casting.
cg_showtris 1 shouldnt use depth culling. Had overseen this before.
The saber marks in SP use some additional scaling and there's some missing parts still.

Also fixed incorrect ifdeffed if else constructs.
Added working IsShaking

Co-Authored-By: AntiAnti <17278566+antianti@users.noreply.github.com>
Because there's a skyportal in this map, it always culled all the ui elements because they aren't sky surfaces.
when G2_PERFORMANCE_ANALYSIS
Compiles, haven't tested it though
You can now load yavin_swamp again.
SomaZ added 17 commits April 25, 2024 23:13
Gpu buffers, fbos, the gpu shaders and the image pool were allocated twice and leaking the second time... Looks like there's still something that leaks though.
// tr_shade.cpp @ 1549
// hModel is an enum so this is not a valid check null arithmetic
if (backEnd.currentEntity->e.hModel != NULL)

Thanks to @ensiform for finding it
From the Khronos description about the "new" platform header

    The OpenGL headers all depend on the shared <KHR/khrplatform.h> header from the EGL Registry . This is a new dependency, introduced in OpenGL-Registry pull request 183 for increased compatibility between OpenGL and OpenGL ES headers.
Now there shouldn't be any attempts at updating UBOs while being used anymore.
Those are handled via uniforms now. Less shaders to compile speeds up load times, having to switch less between glsl shaders speeds up ingame performance. Alphatest cases only commented out for now, will put these behind a cvar later, as some gpus might require to know if a discard can happen or not.

[rend2] Fix sky glowing when last rendered surface had a glow stage
SomaZ and others added 12 commits May 6, 2024 20:56
it's an UNsigned integer, make sure to use unsigned integers...

related bad fix:
9a61f07
Stages that are used to get some more detail shouldnt be collapsed with lighting because it will multiply lighting again and again which leads to incorrect darkening
Vanilla doesn't use rgbGens for surface sprites, only the approximated lighting from the emitting surfaces vertex colors.
Fixes #54

Co-Authored-By: AntiAnti <17278566+antianti@users.noreply.github.com>
Dynamic lights should also work on transparent surfaces that aren't sorted in the opaque sort bucket.
Disabling autoexposure should give you a comparable image to the vanilla renderer. Now it does. Before it was way to dark in comparison.
In vanilla this leads to glow being drawn but not the actual stage. So we mask the first render target in this case to achieve the same look. Currently having flickering issues with surfaces nearly perpendicular to the viewer and enabled msaa. This sometimes leads to fireflys and I have no idea why. Is this a driver issue or is this intended behaviour? Need to look into that.
I decided against overbrightening the screen like it did with the last edit.
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.

1 participant