0
\$\begingroup\$

I've been implementing frustum culling in an OpenGL application that appears to be working correctly.

The issue I have been having when trying to render the frustum shape from the camera, my debug lines appear to only outline the application window borders. When the application starts I would see the four yellow debug lines in a rectangular pattern around the OpenGL window, but nothing else related to the frustum.

I managed to get the frustum shape to render in a previous attempt, but it would not stay with the camera's movement.

GitHub link: https://github.com/JoshTyra/OpenGLFrustum_Culling

I have tried different methods that I could find online, and in papers covering this topic. Beare in mind some of the code was experimental.

\$\endgroup\$
4
  • 2
    \$\begingroup\$ Just checking: are you displaying frustum of the same camera that you use to look at it? Then it would make sense it always maps to the window borders. \$\endgroup\$ Commented May 18, 2024 at 0:15
  • \$\begingroup\$ Thanks for the reply. Yes I am using the same camera. I was under the impression that you could render a simple representation of the frustum from the camera perspective. Am I mistaken? \$\endgroup\$ Commented May 18, 2024 at 0:44
  • 1
    \$\begingroup\$ I mean... The sides of the frustum are the edges of the viewport. Isn't that the point? Things outside the frustum are the things that would be outside the window borders. To debug frustum culling, you need a second camera. \$\endgroup\$ Commented May 18, 2024 at 0:55
  • \$\begingroup\$ Okay. From online sources on the topic I was under the impression that you would see the truncated pyramid on your screen. Like this topic: gamedev.stackexchange.com/questions/194431/… \$\endgroup\$ Commented May 18, 2024 at 1:37

1 Answer 1

0
\$\begingroup\$

HolyBlackCat is perfectly right.
To see one's camera frustum you need to look at it from another camera:
enter image description here
YouTube source: youtube.com/watch?v=VqH8kcmD-HI

\$\endgroup\$
2
  • \$\begingroup\$ Okay. It appears that perhaps I was reading conflicting information on this subject. \$\endgroup\$ Commented May 18, 2024 at 20:37
  • \$\begingroup\$ So what is the user in the post I linked above doing? Just out of curiosity. \$\endgroup\$ Commented May 18, 2024 at 20:50

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.