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

Add OccluderShapeCube to geometry occluders #5648

Open
elvisish opened this issue Oct 24, 2022 · 2 comments
Open

Add OccluderShapeCube to geometry occluders #5648

elvisish opened this issue Oct 24, 2022 · 2 comments

Comments

@elvisish
Copy link

Describe the project you are working on

Gridmap based First-person game.

Describe the problem or limitation you are having in your project

Using planes are too thin to provide side coverage and spheres are weirdly shaped for 90-degree angle games made out of mostly cubic shapes.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Allowing the use of a OccluderShapeCube would have all of the depth benefits of OccluderShapeSphere compared to the 2D OccluderShapePolygon but would fit the geometry of gridmap-based games using cube-shaped meshes primarily for design.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

It would be added to the occluder node as a shape option.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No because it needs to be part of the occluder node.

Is there a reason why this should be core and not an add-on in the asset library?

It needs to be part of the occluder node.

@Calinou
Copy link
Member

Calinou commented Oct 24, 2022

4.0 has a BoxOccluder3D resource, but implementing box occluders in 3.5 isn't trivial due to how occlusion culling works in 3.x. Allowing generic meshes to be used for occlusion was being worked in godotengine/godot#52347, but it ended up being scrapped in favor of a simpler solution with only quads.

Still, you can represent a cube occluder by using 6 quads (or 4 if you don't need floor/ceiling occlusion). The issue is that geometry overlapping several occluders will not be culled in 3.x, due to how geometry occlusion works (as opposed to raster occlusion, which can do this in 4.0). Therefore, using several small occluders will usually not result in anything being occluded. You need to use fewer larger occluders instead.

@elvisish
Copy link
Author

4.0 has a BoxOccluder3D resource, but implementing box occluders in 3.5 isn't trivial due to how occlusion culling works in 3.x. Allowing generic meshes to be used for occlusion was being worked in godotengine/godot#52347, but it ended up being scrapped in favor of a simpler solution with only quads.

Still, you can represent a cube occluder by using 6 quads (or 4 if you don't need floor/ceiling occlusion). The issue is that geometry overlapping several occluders will not be culled in 3.x, due to how geometry occlusion works (as opposed to raster occlusion, which can do this in 4.0). Therefore, using several small occluders will usually not result in anything being occluded. You need to use fewer larger occluders instead.

Thanks, yeah I tried making a cube but it didn't really work very well, I found a sphere worked a little better but has downsides too (things disappearing inside the sphere). I didn't actually know 4.0 had a much better occlusion technique so I'll probably just make bigger occlusion planes instead.

@Calinou Calinou changed the title Occluder node include OccluderShapeCube Add OccluderShapeCube to geometry occluders Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants