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 125 commits into
base: master
Choose a base branch
from
Draft

Rend2 SP #1179

wants to merge 125 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 <[email protected]>
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 <[email protected]>
Adding mdr structs, one more texture compression algorithm, some zone tags, and SkipBracedSection function

Co-Authored-By: AntiAnti <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 and others added 30 commits June 12, 2024 20:36
Vanilla doesn't use rgbGens for surface sprites, only the approximated lighting from the emitting surfaces vertex colors.
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.
The only thing missing is weather sprites fading out without weather I think
Requires dynamicglow to be enabled. Effect can be scaled with the cvar r_dynamicGlowBloom. Range 0.0 to 2.0.
Bind the correct shadow map array when sunlightmode is set.
Requires tonemapping to happen, else smaa wont be displayed. Will fix this later when I try adding smaa S2x.
I incorrectly changed them at some point. The new values are for linear space.
Also fixes UB when dlight shadows are enabled as now the shadowarray will always be bound to the right texture unit and not left blank.
- Reduced some texture reads in the weather vertex shader
- Added alpha fade for the lower two billboard vertices when beneath surface
And don't draw weather in other scenes than the main one.
Also correct the velocity offset that is used for culling to its previous sign.
Wasn't implemented to begin with and just created UB because the attribute was also unbound.
and use it when copying the depth buffer to the "hdr" depth buffer for linear sampling.
Bone ubo only needs to change when there's ghoul surfaces rendered and we don't need to upload and bind entity ubos that are the same as the default entity buffer object.
Unified shader instructions for generating a screen covering triangle with correct texture coordinates. Switched most of the post process copies to using the screen triangle method which requires no vertex buffer setup, so less overhead overall. Also made the tonemapping shader work like that as well.
Missing attributes are instanced attributes so they only need to have one value in the vbo. This silences performance warnings about recompiling vertex shaders because of disabled vertex attributes.
Also reordering some glsl defines -> no change in functionality
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