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

Primitive storage and static model improvements #171

Closed
wants to merge 46 commits into from

Conversation

apanteleev
Copy link
Collaborator

This PR may look a bit odd coming from me, but I just want to have some more eyes on the changes before I merge them... It's large. The changes will be merged with squash most likely.
@res2k @Paril specifically

Summary:

  • Replaced the arrays of primitive attributes that were specific to BSP or models with a single, unified storage format: VboPrimitive.
  • Added support for static models with their own BLAS that never go through the instnace_geometry shader. This significantly improves performance when models become more complex, think hundreds of thousands of triangles.
  • Increased the limits for primitive and mesh counts, removed the limits on BSP or instanced buffer sizes.
  • Generally simpler and more logical code when it comes to primitive handling.

…and primitive offset with separate VBO index and primitive offset stored in a UBO.
… models, instance those BLAS instead of going through the shader.
@res2k
Copy link
Contributor

res2k commented Dec 18, 2021

I've found some minor things (typos etc), but there's nothing major (...that I noticed).

@apanteleev
Copy link
Collaborator Author

Thanks for the review! All feedback has been addressed.

apanteleev added a commit that referenced this pull request Dec 21, 2021
- Replaced the arrays of primitive attributes that were specific to BSP or models with a single, unified storage format: VboPrimitive.
- Added support for static models with their own BLAS that never go through the instnace_geometry shader.
- Increased the limits for primitive and mesh counts, removed the limits on BSP or instanced buffer sizes.
- Expanded support for translucent materials, so cl_gunalpha works now.
- Fixed some long-standing resource leaks on map changes.
@apanteleev
Copy link
Collaborator Author

Merged through squash in e7d671d

@apanteleev apanteleev closed this Dec 21, 2021
@Paril
Copy link
Contributor

Paril commented Dec 21, 2021

Somehow I missed this PR entirely in my inbox - I'm sorry! I'll go over the commits even though it's too late, haha

EDIT: looks good, no issues other than the one I mentioned which is more of a style thing.

CHECK(iqmData->jointParents = (int*)MOD_Malloc(header->num_joints * sizeof(int)));
CHECK(iqmData->bindJoints = (float*)MOD_Malloc(header->num_joints * 12 * sizeof(float))); // bind joint matricies
CHECK(iqmData->invBindJoints = (float*)MOD_Malloc(header->num_joints * 12 * sizeof(float))); // inverse bind joint matricies
CHECK(iqmData->jointNames = MOD_Malloc(joint_names));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this just reminded me, on my local branch I changed jointNames to be an array of char[MAX_QPATH] so that I can easily index the joint names at runtime. Currently, you need to loop over the string via strlen which is pretty inefficient.. not that it totally matters I guess since you shouldn't be looping through joint names every frame at runtime, but just a random note that I think a single long string of "name data" is a bit harder to parse through than just fixed-length string indices.

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.

3 participants