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

(Bug) OBJ models render hidden spheres #1386

Open
TheReeb opened this issue Oct 15, 2024 · 1 comment
Open

(Bug) OBJ models render hidden spheres #1386

TheReeb opened this issue Oct 15, 2024 · 1 comment

Comments

@TheReeb
Copy link

TheReeb commented Oct 15, 2024

This issue is out of my field frankly, but from my findings when using OBJ models in PAC, they leave behind a sphere that is usually right on, or close to models origin point.
Screenshot_8

To make sure I'm not imagining things, the model does not have any hidden sphere models in Blender.
Screenshot_9

PAC version is on latest.

@pingu7867
Copy link
Collaborator

pingu7867 commented Oct 15, 2024

I knew this one was gonna be a doozy so I dug. that's actually real, the default CS entity's model is set to scale 0.001, idk why it wasn't just set to 0, but normally it's covered up (it would be in your case, people don't make floating hair without a head), usually you only see the ball if you scaled the model tremendously in pac, and ideally you adjust your scales to fit Hammer Units (units you see in Blender are purely visual. only the numbers matter, and for reference a head is about 10 (HU)) in blender prior to exporting

the entity isn't actually the obj, but instead the obj is built into a separate IMesh that gets drawn separately. The actual entity's model is drawn first for hacky rendering reasons?? If it doesn't get drawn, the obj mesh takes the previous model rendered material (even from outside pac)??? I guess it was done that way so that the material can be defaulted as the default material, but why not just set the render material manually?

and LOL I just discovered a macro optimization
drawing the default ball + some torus I got from Blender takes 8-9 microseconds on average
setting the render material etc and only drawing the torus takes 4-5 microseconds on average
there's side issues because of how fragmented and hacky the rendering code is but it might be good if I can work my way around those

we rarely get this relative amount of optimization relative to the baseline so it's a W if I can make it work without negative side effects

but idk how many objs vs mdls are used by players so idk if it's gonna make a dent in actual use, it's probably not but hey, that's something

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

No branches or pull requests

2 participants