OpenGL is a graphics standard and API which targets the desktop and workstation markets. It is designed to be easy to accelerate with dedicated computer hardware, and hence most implementations give greatly improved performance over traditional software rendering. Currently, OpenGL is used for ...

learn more… | top users | synonyms

4
votes
0answers
45 views

Environment mapping without cubemap (need coordinates projection)

I'm working on a project with C++ and glsl (4.1). I have implemented a mirror object which is a plane at height 0 that works as follow: I render the scene with a MVP computed such that the camera ...
0
votes
1answer
41 views

glGenBuffers is NULL

I'm using GLEW 1.13.0, (GLUT), SDL2 and OpenGL 3.3 core. #include <GL/glew.h> #include <GL/glut.h> int main(int argc, char* args[]){ Engine::init(); // Initializes SDL_GL_* attributes ...
0
votes
0answers
22 views

What ways can I draw a single pixel or single fragment with Modern OpenGL? [duplicate]

I've been researching around the internet looking for ways to plot a single fragment or single pixel which ever is more usable for the case I will present now: I want to plot a pixel every click of ...
3
votes
1answer
127 views

When should i use GL_TRUE or GL_FALSE values?

When using GLboolean, should i just use true and false or should i use GL_TRUE and GL_FALSE, when should i prefer using GL_TRUE and GL_FALSE? or maybe i shouldn't care at all (Because both works)? ...
1
vote
1answer
65 views

Rendering issues in Monogame when using shaders

I am currently fiddling with Monogame, trying to work with Shaders and I have encountered a really weird issue. If the first ever draw in the application's lifetime is with a custom shader all further ...
3
votes
1answer
85 views

Just how expensive is it to bind textures in OpenGL? (LibGDX)

I'm using LibGDX on top of OpenGL and currently my game engine does something along the lines of the following per frame Bind a terrain texture sprite atlas and a set of transparency masks in ...
1
vote
1answer
40 views

How do I make my indices anti-clockwise, so I can cull triangles in OpenGL? (immediate mode)

At the moment, I'm attempting a basic game engine in OpenGL using immediate mode. I'm trying to render a cube. Cube is a class with the vertices, normals, and indices. Here is part of the Cube class: ...
1
vote
1answer
90 views

Android OpenGL Sprite Component Pattern

Ok so I have a 2D OpenGL project that was originally a class assignment, and now I am using it to experiment with and to broaden my knowledge. Originally, I had been using the Normalized Devices ...
0
votes
1answer
72 views

Getting the Right Vector from the Forward Vector

I'm currently working on a small Camera (ArcBall) and I finally am starting to understand how it will work. I will first create a basic View Matrix using a LookAt function. Then, I will send the ...
1
vote
0answers
68 views

Transparent textures being handled oddly [closed]

In OpenGL why is it that when rendering transparent textures it changes the color values of all the pixels? Ex. when this transparent texture is rendered it comes out as this. Also if I change the ...
2
votes
2answers
69 views

Input before or after update/draw?

This is how I understood the game loop, and I wanted to know if I'm correct or not: 1) Draw/render -> input CPU | GPU ------------------ Update | Draw | Input | Rendering 2) Input -> ...
1
vote
0answers
158 views

OpenGL ArcBall Camera

I'm currently working on a OpenGl Project and I have alot of difficulty understanding how arcball camera work. From what I have read online, all I have to do is to rotate a camera around a target and ...
0
votes
0answers
47 views

Renderering problem with flat terrain

i was testing out my game engine last night, but stumbled across this unexpected result. Here is a picture: As it appears, it is renderering 1 triangle and not renderering the other triangles. I ...
20
votes
7answers
5k views

What advantage do OpenGL, SFML and SDL have over software rendering?

I started watching the Handmade Hero stream, where Casey Muratori creates a game engine without using frameworks or such. Yesterday I got to the part where he showed how an image is drawn onto the ...
4
votes
1answer
183 views

OpenGL(Libgdx) - How to texture a 2D terrain surface?

I want to texture the surface of my terrain. I have created the ground mesh and surface mesh separately and everything is okay for ground mesh. But I couldn't texture the surface mesh correctly. As ...
4
votes
2answers
187 views

Poor performance wth custom particle system in LibGDX

I'm using a custom particle system for my LibGDX / Java based game project (because I used Slick2D earlier on, need more parameters so I made my own and then ported). The system is fairly standard as ...
0
votes
0answers
82 views

Problem with a TinyOBJLoader Renderer

I was working on implementing a renderer for SYOYO's tiny obj loader and when it came to testing time, it failed to render. Here is an image of the result: I believe that i have made the error with ...
1
vote
1answer
81 views

2D Sprite batching in OpenGL: How to send transformation data to GPU

OpenGL newbie here. So I'm trying to implement sprite batching to draw ~100 sprites per draw call. I've created a VBO that contains texture coordinates, vertex coordinates, color data (for tinting), ...
1
vote
0answers
75 views

How to draw 2D pixel data with OpenGL

I am fairly new to OpenGL. I have a 2D game in SDL2 that uses currently works by creating a SDL_Surface from the pixel data, copying it into a SDL_Texture, and rendering it to the screen with ...
1
vote
3answers
97 views

Array Texture 2D with different sizes for the textures?

I'm making a 2D game engine, and I need a way to batch all textures into one so I only make one glBindTexture call throughout a scene. I am trying to use 2D texture arrays, but they only support ...
2
votes
0answers
39 views

How to store sprite data in a VBO?

I'm planning on rendering many sprites in my games, but I am not sure which method of storing their data to use. I haven't tried all of them yet, but I want to see if I also have anything important ...
2
votes
1answer
120 views

How can I draw multiple lines connected via “nodes” in libgdx Scene2D?

I have two Vectors which indicate the ending points of each line. I am trying to draw similar lines to football formation lines like these. My main problem using ShapeRenderer is: ShapeRenderer ...
0
votes
0answers
69 views

How can I use ImGui to render simple text instead of using stb_truetype directly?

Since ImGui builds on top of stb_truetype for its font rendering, I thought it could be nicer to use its already built font-processing capabilities (ImGui::GetIO().Fonts), and render with those, ...
1
vote
0answers
43 views

How can I render text with modern OpenGL and stb_truetype, and why are the loaded textures black?

I've spent the past couple of days just desperately trying to get stb_truetype to render anything using the simple example provided https://github.com/nothings/stb/blob/master/stb_truetype.h#L242-L281,...
14
votes
1answer
2k views

Does multiple downsampling have a benefit?

So i came across this site and you can see these lines on the first and second paragraph: For a crude but easy effect, draw the bright portions of the scene (eg, light sources) into an FBO, then ...
1
vote
1answer
47 views

Normals showing unexpected results

I am making a game in c++ with opengl and glm and was working on my terrain when this happend : as it appears it is renderering just the way i planned it, but my question was, how do i make it ...
1
vote
1answer
45 views

Shader only rendering 1/4th of the screen

I've asked the same question on SO here and they suggested I should ask here instead. I'm currently trying to create a gaussian blur shader, and while I've successfully created the blur effect my ...
0
votes
1answer
59 views

Opentk hdr rendering with framebuffer white screen problem

I am trying to do hdr rendering with two shader programs: one simply draws a hdr texture on a fullscreen quad and the other one does tonemapping. I am trying either linear tonemapping colorOut = ...
0
votes
0answers
32 views

How could I add XBox 360 Controller handling support to my game?

The title says it all. I'm making a 3D Open World game with OpenGL and LWJGL in Java, and I really need to move in several angles to fully feel inside the game. The problem is that I couldn't find any ...
2
votes
1answer
65 views

Is there any way in open-gl to “bit crush” everything on the screen?

I am making an educational game and am looking for options for a visual effect to show when something is "incorrect". So, I am looking to see if there's an easy way in openGL to temporarily distort ...
0
votes
0answers
32 views

How should I go about creating a generic Scene object for managing VBO data?

To simplify managing multiple types of data with different shaders and textures, I thought about creating a generic Scene object (is there a name for this?) which would allow me to pre-configure how I ...
0
votes
2answers
65 views

Opentk Textured Full Screen Quad

I want to display a texture on a full screen quad. What I get is a completely green quad and after a week of debugging I cannot understand why. I am currently using OpenTK 1.1.2225 and Magick.NET-Q16-...
0
votes
1answer
89 views

Is glxinfo saying that the 980 GTX doesn't support a 32 bit depth buffer?

I've been using the glxinfo command (glxinfo -v) to explore the supported framebuffer configurations. There are two values relating to depth, "depth" and "depthsize." According the source, it appears ...
0
votes
1answer
67 views

Parsing .OBJ to fit the gldrawelements() call. c++/opengl

I'm struggling trying to get this to work like it should. Ive been able to make an obj loader that fits the glDrawArrays() call, with uv and facenormals, but when trying to modify it to fit ...
0
votes
1answer
26 views

GLSL uniform array with size set by another uniform

Will the follwing GLSL code work? #version 330 uniform int size; uniform float[size]; void main() { //do something }
0
votes
0answers
33 views

Unable to translate the object such that it looks like it is moving

This is the code I'm using in the display function to translate the object. ` while(a<500.0) { glPushMatrix(); glTranslatef(a,0.0,0.0); glScalef(0.5,0.5,0.5); ...
4
votes
1answer
154 views

What causes seemingly random triangle artifacts in OpenGL?

When switching version of OpenGL from 4.5 to 4.4, I suddenly started seeing these weird random triangles flickering over my scene They move around somewhat randomly and are always pointed towards [...
0
votes
1answer
100 views

CPU and RAM usage in OpenGL too high in Swift

My game is set up so the the display controls the game loop, usual in Cocoa. The callback function calls run() which is this. The thing is, the thread running the callback is using 63% CPU and the RAM ...
1
vote
2answers
57 views

OpenGL [LWJGL3] - Matrix4x4 not rotating correctly

I tried today to make my own matrix4f class because of that LWJGL 3 does not include a class for it. So I arrived at rotation and it does not seem to work. I tried using the old util from LWJGL 2 and ...
1
vote
0answers
57 views

World texturing techniques in FPS game

Texturing for small objects (pickups and enimies) can easily be done UV-unwrapping the model, and use a texture of reasonable size to make the model look good. But how can texturing be done for the ...
-1
votes
2answers
75 views

What does a perspective projection matrix look like in OpenGL?

I've been trying to construct a perspective projection matrix myself and finding it extremely difficult. I realize that a perspective projection matrix is by default a frustum in OpenGL 3.3+ that is ...
0
votes
1answer
59 views

How do animation works with mesh?

I'm currently developing a game using OpenGL and my dev has run into a small problem. I'm having some problems understanding how "array of vectices works with animated object". For example, if we have ...
0
votes
1answer
91 views

Making a GUI shader in GLSL c++/opengl/freeglut

How do you make a shader that will draw ontop of everything else? Im using an approach where I draw square faces in 3d space to simulate a 2d box, but when I make a 3d object, it will clip over the 2d ...
0
votes
0answers
40 views

Qt 5 - QOpenGLWidget not updating the screen

I'm creating a level editor for my game using Qt for gui and i'm in really early stages. Right now i'm trying to dynamically add objects ( entities ) on screen when i click a button. So far the ...
0
votes
2answers
57 views

glUniformMatrix4fv - INVALID OPERATION?

I'm attempting to manually setup a matrix in my vertex shader purely because I like to learn as much as possible about anything I do usually. So the problem is that I'm getting an ...
1
vote
0answers
31 views

Applying different materials to an object

I'm currently implementing an Object Loader for the Wavefront File Format (*.obj). When exporting a model (with associated materials) from blender, a material for a group of faces is specified like ...
0
votes
1answer
53 views

OpenGL is box blur this slow?

I've never tried blur until recently, and by that i've noticed fps drop when doing box blur. My fps will go down from 4000-5000 fps to 1000-1500 fps. Currently rendering at 853x480 frame buffer and ...
0
votes
1answer
74 views

When do I need to call `glUseProgram`?

Looking at examples at http://learnopengl.com/#!Getting-started/Hello-Triangle and many different places, I've found that the draw sequence usually goes like this: // setup VBO, VAO, load shaders ...
0
votes
1answer
102 views

Create a crosshair openGL

How do I draw a white crosshair in the middle of screen in openGL, it's all well and good knowing how to render objects in 3d space, but I have literally no idea on how to draw something that sticks ...
0
votes
1answer
43 views

Drawn frustum does not match with glm::perspective

I am working on a personal project and I got a 3d viewport with moving camera working nicely. Now I am working on being able to freeze the time and switch to a debug camera and move in the game freely....