-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
The far
member of PerspectiveProjection
is irrelevant
#4596
Comments
maybe related to #4457 |
We could still cull meshes to a fake far plane. I just chose not to to preserve behaviour at the time I think. I’m not sure whether we should or shouldn’t cull to a fake far plane. We do for point lights but not for meshes. We could make it optional but then I don’t know what the default should be. I kind of feel like we could make it an Option and if present then we cull to it, if not, we don’t. |
I meant to @cart and ask what you think about that ^ ? |
Yeah I think providing optional configuration for people to cull at a given distance makes a lot of sense. |
(The above is a bullet point because that's the only way I know to force github markdown to show the linked PR title.) |
I have been thinking of culling smaller objects faster than large objects. This way large buildings would still be visible, but smaller objects inside or around it wouldn't be rendered. Would it be difficult to do that in the far-plane culling logic? |
What do you mean by faster? All meshes are chilled against the visible volume every frame. |
Sorry, by "faster" I mean at a closer distance. A small object (scale dimensions < 1.0) will not be as visible (size on screen) at a distance of 50.0 from the camera vs a larger object (scale dim. > 1.0). I have a 3d scene that has +40,000 objects (over 100,000 ECS entities). The object meshes are generated from primitive profile/path parameters and can have different textures on different faces. So right now one object could have multiple meshes. I had tried enabling the far plane culling like in your PR to see if it would help with FPS. It does, but there is a hard cut-off, where even large objects go invisible. I am now using an adaptive culling based on distance and the Transform.scale of the mesh. For the scene that I have tested with (large buildings with many smaller objects inside), it allows the buildings that are far away to still be visible while hiding the smaller objects that are not as noticable (even when the build has lots of windows). |
The
far
member ofPerspectiveProjection
is irrelevant, because the far plane is at negative infinite Zbevy/crates/bevy_render/src/camera/projection.rs
Line 25 in 989fb8a
The text was updated successfully, but these errors were encountered: