Skip to main content

All Questions

Tagged with
0 votes
0 answers
53 views

Flexible llighting method in 2D (using OpenGL)

I'm working on a simple 2D game engine. I'd like to support a variety of light types, like the URP in Unity. Lighting would be calculated according to the normal and specular maps attached to the ...
Kavefozogepezet's user avatar
2 votes
0 answers
225 views

How can I switch between 2 shaders without adding more and more draw calls?

I would like to create a renderer class that can switch between 2 or more shaders without adding more and more draw calls. What I mean is to have 2 shaders - A and B - and method that takes shader, ...
user avatar
0 votes
1 answer
384 views

How to use OpenGL to render 2D points on an x-axis timeline representing a wide time range?

I'm writing an OpenGL 2D plotting application to visualize real-time data. The x-axis timeline represents time in nanoseconds, however, the application will be plotting data that is collected over ...
jaybird19's user avatar
1 vote
1 answer
133 views

Open GL Translucid Sprites

So, my goal is to draw sprites with translucid pixels. First, I render the sprites with a shader that only renders the opaque pixels. Then, I disable depth buffer writing and render the same sprites ...
user4696876's user avatar
1 vote
1 answer
2k views

OpenGL 2d (orthographic) rendering for GUI, the modern way

I want to render GUI components in my OpenGL program. They are still just simple textured (vbo) rectangles. I would like to get the following things done, the right way. Drawing using screen ...
user2190492's user avatar
  • 1,194
0 votes
2 answers
626 views

I have a SpriteBatch, but what about batching geometry?

I have written a SpriteBatch utility that can batch sprites together and render them using GL_TRIANGLES ( 6 vertices per sprite ). I would also like to be able to have a way to draw other primitives, ...
Dooskington's user avatar
0 votes
1 answer
1k views

OpenGL 2D pixel perfect rendering

I'm trying to render a 2D image so that it will cover the entire window exactly. For my test, I setup a window so that the client area is exactly 320x240 and the texture is also this size. I setup my ...
Photon's user avatar
  • 3,212
1 vote
1 answer
582 views

opengl/pyopengl - exact same frame rendered in multiple viewports?

I'm writing a simple tool in PyOpenGl for displaying visual stimuli that are used in a physiology experiment. Currently I render my stimuli on a single viewport inside a wxGLCanvas, which I display ...
ali_m's user avatar
  • 73.8k
2 votes
2 answers
5k views

OpenGL: How to optimize 2d rendering with multiple layers overlapping each other in 3d mode?

I know how to speed up rendering in 3d by simply rendering the nearest planes first. But how do i get advantage of this type of method in 2d mode? I cant use depth testing because they are all in the ...
Rookie's user avatar
  • 3,803
3 votes
3 answers
3k views

2D openGL drawing lines that don't exactly fit pixel raster

I'm drawing something similar to a LED VU meter in OpenGL. Result should be like on vertical bar of this: Unfortunately, my drawing space is restricted, and I have to fit exactly 18 bars on it. That ...
Philipp's user avatar
  • 31