Khlorghaal
  • Member for 8 years, 9 months
  • Last seen more than 2 years ago
C++, OpenGL: Building a polyhedron via geometry shader
2 votes

Instead of building the cube in geometry shader from a point, its better to do an instanced render of a simple cube VBO, and forego a geometry shader entirely. The only time you wouldn't want to do ...

View answer
Swapping Framebuffers or swapping attachments?
2 votes

It's almost always better to change a state's object instead of changing an object's state. Mostly for readability, as thats how GL is expected to be used. Even if you have multiple attachments in ...

View answer
Rendering terrain only with GPU
2 votes

You don't want todo this every frame. Use either transform feedback or the CPU to calculate it once, then store in a VBO. If you want a large world then divide it into chunks as needed. Also since ...

View answer
PhysicsJS on mobile devices: how to optimize for speed
1 votes

Theres the parameter maxIPF given to the Physics constructor, set that lower for a faster but less precise simulation. But this may be a question more of whole program optimization, do some profiling.

View answer
Collisions being detected before objects are intersecting
1 votes

When colliding two boxes, you must do more than check if one has edges inside the other. _________ |A ___ | | |B| | | |_| | |_______| If checking B has edge inside A, it will be correct, but if ...

View answer
Reset Opengl multisampling
Accepted answer
1 votes

Either recreate the display or Keep your default framebuffer with no multisamples, make a framebuffer with multisample that is blitted to the default fbo, which may be recreated.

View answer
How do I structure code with multiple VBOs?
1 votes

glBufferData reallocates the VBO in VRAM, use glBufferSubData when updating data. Generally each mesh has its own VBO(s); and own VAO if not batched. There are optimizations where you use a single ...

View answer
Tiled Rendering - Projection matrix
1 votes

All you have to to is set glViewport then invert its transformation. Create a matrix s= tilecount; for(int x=0; x!=tilecount; x++) for(int y=0; y!=tilecount; y++) [s 0 0 x] [0 s 0 y] [0 0 1 0] [0 ...

View answer
Creating a separate renderer for entities in a 2D game
1 votes

You only truly need a separate class if you're multithreading, so you can have separate constructors, one ran in the render thread. Even then its up to you whether or not you want to do that. The big ...

View answer
Manipulating vertices after multiplication with MVP matrix (OpenGL)
Accepted answer
1 votes

From what I understand you are trying to render a scene many times from many views into a tilemap. To do that I would make each tile a layer of a Texture_2D_Array, and bind to a 3D framebuffer. In ...

View answer
Optimized linear to sRGB GLSL
1 votes

If you're worried about optimization then use vectors more, the optimizer may or may not do that for you. Avoid conditionals, all branches of them will be executed. But the major bottleneck on modern ...

View answer
Wrapping things up in opengl based library
Accepted answer
0 votes

Looks not too bad to me. Only thoughts are to consolidate your camera to have a setMVPUniform(GLuint uloc, matrix model) or similar function. Likewise make similar classes for Lights, textures, VAOs, ...

View answer
Resizing a Framebuffer Object (ie: its attachments) on Screen Resize
0 votes

Double check if you are truly using viewport correctly. You're not rebinding the texture to the FBO. That SHOULDN'T be necessary, however the spec makes no guarantee that glTexImage won't screw up ...

View answer
Standard key bindings for movement along three axes?
Accepted answer
0 votes

For something with rotation its generally wasd for throttle and roll, shift+wasd or uhjk for strafe orthogonal to forward. Or ws throttle ad strafe qe roll For purely translation, then wasdec or ...

View answer
Optimizing Texture Text Rendering?
0 votes

For my font renderer I store all characters in a texture_array, which eliminates the need for atlas mapping and worrying about uv float precision. For drawing use pointsprites and give each vert only ...

View answer