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

Frustum Culling #1534

Open
7 tasks
heinezen opened this issue Sep 16, 2023 · 2 comments
Open
7 tasks

Frustum Culling #1534

heinezen opened this issue Sep 16, 2023 · 2 comments
Labels
area: renderer Concerns our graphics renderer good first issue Suitable for newcomers improvement Enhancement of an existing component lang: c++ Done in C++ code

Comments

@heinezen
Copy link
Member

heinezen commented Sep 16, 2023

Frustrum culling

Required Skills: C++, computer graphics knowledge helps

Difficulty: Medium

With frustum culling we would only render objects visible by the camera. This could potentially save a lot of rendering time and let the renderer scale easily with larger scenes.

Implementing frustum culling in openage could be much simpler than in other engines since the camera has a fixed (dimetric) perspective using orthogonal projection, creating the well-known isometric view also seen in AoE2. Camera movement is currently limited to the x-z-plane. Furthermore, the camera supports zooming into/out of the scene.

Tasks:

  • Find objects inside camera view
    • Calculate camera view plane and the view frustum ( should be a 3D view "box")
    • Check if renderable objects are inside the view frustum (for simplicity, we can assume that objects are points or rectangle sprites)
    • Only draw renderable objects if they are inside the view frustum
    • Only update uniforms of renderable objects if they are inside the view frustum

The view frustum does not necessarily have to be perfectly accurate at first, i.e. it can be slightly larger than the camera view if it's easier to calculate. Our primary goal here is speed, not accuracy.

To test the implementation, there should be

  • a demo that showcases how frustum culling works
    • one way to do this is to use two cameras: the first camera is only used for culling, the second one is zoomed further out and used for rendering
  • a stresstest that compares performance with and without frustum culling

Further Reading

@heinezen heinezen added improvement Enhancement of an existing component area: renderer Concerns our graphics renderer lang: c++ Done in C++ code good first issue Suitable for newcomers labels Sep 16, 2023
@nikhilghosh75
Copy link

Hi, can I have this task if it isn't already taken?

@TheJJ
Copy link
Member

TheJJ commented Apr 1, 2024

Go for it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: renderer Concerns our graphics renderer good first issue Suitable for newcomers improvement Enhancement of an existing component lang: c++ Done in C++ code
Projects
Status: renderer
Status: 🔖 TODO
Development

No branches or pull requests

3 participants