0
\$\begingroup\$

How can one make a triangle look pixelated without modifying the size of the window in GLFW3?

Preferably, I'd like to accomplish this without the use of shaders. For example, by setting the size of the frame buffer to be 1/8th the size of the window.

I've created an Xcode test project for this and tried setting a small window size to create a small framebuffer, then changing the window size to be big afterwards, but the framebuffer size always changes to match the window size.

Example project output:

enter image description here

Desired output:

enter image description here

\$\endgroup\$
3
\$\begingroup\$

Render to a small render target texture (FBO) first and then render an orthographic quad to the screen using the render target as a texture (with nearest neighbour sampling). There are plenty of tutorials for this such as this one.

\$\endgroup\$
  • \$\begingroup\$ I can confirm I got this technique working with a different example project. \$\endgroup\$ – Nathanael Weiss Sep 8 '15 at 17:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.