Add GeometryOptimiser, move some stuff there from tr_bsp#1640
Add GeometryOptimiser, move some stuff there from tr_bsp#1640VReaperV merged 3 commits intoDaemonEngine:masterfrom
Conversation
| /* | ||
| =========================================================================== | ||
|
|
||
| Daemon BSD Source Code |
There was a problem hiding this comment.
This file seems to have old code copy and pasted so it should have the GPL license.
src/engine/renderer/tr_bsp.cpp
Outdated
| vboIdxs[ vboNumIndexes++ ] = vboNumVerts + surfTriangle->indexes[ 1 ]; | ||
| vboIdxs[ vboNumIndexes++ ] = vboNumVerts + surfTriangle->indexes[ 2 ]; | ||
| } | ||
| // OptimiseMapGeometryMaterial( &s_worldData, numSurfaces, materialVerts, numVerts, materialIdxs, numTriangles * 3 ); |
|
Seeing work for more geometry optimization is great! Just a thought brought by reading the PR: For multi-licenses issues, when we have to put new functions into a file with a more permissive license, I think we may add specific comments to split the file without actually doing two files. I'm thinking about doing those for huge code blocks I entirely rewritten from It's harder to do when the new/old code is intricately mixed (not just whole functions or large code blocks living side to side). The easiest way is to use the old license when mixing new code with the old license to avoid marking each block, but we may start marking blocks at some point. |
|
The task of rewriting the entire engine with BSD-licensed code seems a bit hopeless, so personally I just write new code in old files if it would make my life any more difficult to do otherwise. Dealing with multiple licenses in one file sounds painful. |
|
I'll deal with that when #1635 is merged, I'll need to rebase on it anyway. |
a4f1447 to
b740cd9
Compare
Move some surface merging stuff there from `tr_bsp`, add some definitions for material system use.
Also use tempMemory with only the renderable surfaces, to avoid looping over everything and to remove useless checks for `surfaceType`.
cc2749e to
540444b
Compare
540444b to
b4a5ad7
Compare
|
Mac ci is tripping as the variable is incremented in the loop (possibly optmised out, but the next pr ensures it won't be, so, whatever...). |
|
Why is this being merged without LGTM? Doesn't seem very urgent. |
|
I'm simply following what the project head has said. |
Requires #1635
This moves some surface merging stuff into GeometryOptimiser.cpp, and adds a function that removes duplicate vertices there. Also removes some more duplicate code, and puts all renderer surfaces into temp memory at the start of
R_CreateWorldVBO(), to avoid going over more of them (i. e. it excludes portals, autosprite surfaces,SF_SKIPetc. at the start, rather than every time when iterating through all of the surfaces.Adds some functionality that will be needed for further improvements to geometry processing with material system (I've done some tests around that, which already show good results, but I need to make it use surfaces of up to a specific limit of triangles to make it work well in all cases).