Skip to content

Rend2 SP #1179

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

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

Rend2 SP #1179

wants to merge 159 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.
Now has to upload the gore data per gpu frame, so basically twice as often, but therefore the vbo that is uploaded to is not in flight anymore. Should prevent lag spikes when gore data is uploaded.

Also annotated most gpu resources for easier debugging in renderdoc

[rend2] Fix OpenGL error on annotating framebuffers

The fbo has to be bound before the annotation can be made as the driver might actually allocate the buffer at first bind.

Also removed two asserts that always trigger in rend2, need to investigate this at some point.

[rend2] Fix compilation on Apple

GL_VERTEX_ARRAY is not available on apple.
[rend2] Increase tr.distanceCull to SP default
[rend2] Increase number of renderable g2 surfaces
[rend2] Increase MAX_FBOS
Could be hit with cg_shadows 4 and r_smaa 2
- Removed incorrectly committed light value scaling via uniform
- Corrected density factor
- Fixed most blended stages
Mappers use blended depthwritten occluders to mask map geometry and still want to see the sky behind them. Only use depthtest for skies when there was something written to the image before the skydraw like portals or skyportals.
When multiple skys are rendered per frame, they could pop randomly because of inconsitent sorting. Also makes sure sky stages are rendered after the actual sky image.
@SomaZ SomaZ force-pushed the rend2-unified-wip branch from 8fe80d3 to 8ff9323 Compare February 25, 2025 22:41
When redsaurus fixed the save screenshot (in ff21085 ), they must have missed the double usage of SCR_GetScreenshot. Besides being used for the savegame thumbnails, it's used directly as an argument for DrawStrechRaw. DrawStrechRaw expects a RGBA buffer to draw to the screen. For drawing the level transition screen correctly I also had to flip the image in RE_GetScreenShot, so I also changed the flipping behaviour when saving the savegame.
except for the ones that need info about the entity time or have the volumetric flag.
Fixed dynamic lights when r_specularMapping and r_normalmapping == 0.
Also removed specular calculations when r_specularMapping 0 but r_normalmapping 1.
@SomaZ SomaZ force-pushed the rend2-unified-wip branch from 55fd784 to 616ade6 Compare March 2, 2025 12:44
SomaZ added 2 commits March 2, 2025 16:15
Also stencil buffer is not needed for refractive surfaces
Added debug group annotations and better shader names for captures with debug software like renderdoc.
@SomaZ SomaZ force-pushed the rend2-unified-wip branch from b549e37 to d36ea14 Compare March 3, 2025 21:00
SomaZ added 8 commits March 4, 2025 21:14
Prevents drawing a giant blob shadow beneath players when cg_shadows 4 is set after loading a map without it being active.
Drawing the sky is somewhat special as we need to draw every surface and its stages in order. The tesselator for the sky often creates overlaps and this leads to doulbe and tripple applied stages with our usual sorting. Also, all other surfaces in the same sort as the sky need to be rendered after the sky has been rendered.
Fixes incorrectly displayed models and incorrectly discarded models.
byBlank can be allocated on autosave and it can still fail to read the levelshot image.
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