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

0
votes
0answers
7 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
39 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 ...
0
votes
1answer
52 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
44 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
16 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
29 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); ...
3
votes
1answer
79 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
66 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
48 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 ...
0
votes
0answers
50 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
56 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
48 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
33 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 ...
-2
votes
0answers
20 views

Help with first person camera | Java OpenGL [closed]

Hey i cant seem to find out how to make a first person camera Could anyone suggest wasy to make it and/or suggest codes
0
votes
0answers
6 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
29 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
21 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
43 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
40 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
49 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
27 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 ...
1
vote
1answer
52 views

Creating a DPI and Resolution Independant GUI

How would one best go about it? Assuming I'm using OpenGL to do all the drawing. It seems like the best approach is to have the GUI elements maintain the same physical size regardless of the screen ...
2
votes
1answer
100 views

What is the best way to interpolate vertex data in OpenGL?

I am working on a game which has a board of falling down blocks, similar to Tetris. Each block is represented with for vertices and two triangles, each vertex consisting out of its location and ...
0
votes
1answer
42 views

How can I easily determine the z-ordering of objects in multiple glDraw calls?

I have a simple 2D tile-based scene that I'm rendering with OpenGL. On each frame I first draw the static background, and then draw the dynamic elements (monsters, etc.). This way it seems that the ...
3
votes
1answer
155 views

Having issue's with a confusing access violation? - C , OpenGL 3.3+ , SDL 2.0+

Hello this code seems so well done and yet I'm getting this weird access violation error when I use anything but 0 in glShaderSources 2nd argument : glShaderSource( fragshader, 0, fragfilebuff, NULL ...
0
votes
0answers
25 views

indices for surface of revolution

I'd like to implement a surface of revolution. I already implemented creating Vertices based on a 2D line. I now want to get the indices to render the mesh with GL_TRIANGLES Here's the code to ...
0
votes
0answers
48 views

Using different shaders for different objects openGL

Basically, I want to draw one object with one shader, and another object with a different shader, but the second object wont show. Currently working on some openGL stuff, and am trying to get one ...
0
votes
1answer
39 views

Trouble applying a texture to a cube

Currently working on applying a texture to a cube and I am at a road block. I am using UV coordinates to apply the texture. Currently using 24 uv coordinates with indices. I am using glDrawElement and ...
0
votes
0answers
28 views

Pixel Perfect Texture Sampling

Right now I am using the following two shaders to render a sprite from a texture used as a sprite atlas onto a canvas that has canvas_size pixels in screen coordinates. I use a static quad as input ...
1
vote
1answer
49 views

How to tell OpenGL to use normals for lighting?

Let's say I have glGenBuffers(1, &vertexbuffer); glGenBuffers(1, &indexbuffer); glGenBuffers(1, &normalbuffer); glBindBuffer(GL_ARRAY_BUFFER,vertexbuffer); ...
0
votes
0answers
47 views

C++ Modern OpenGL - Calculate Vertex Normals

I'm learning modern OpenGL and i just got started so go easy on me :). Right now im trying to understand normals but im having some difficulties. On my program i have this class which i use to draw ...
0
votes
1answer
67 views

How do i make floors of varying height in OpenGL?

So I am currently working on a small Game(/engine) in OpenGL and I want to build a little world editor. Nothing too fancy: Just some functions to add objects to a scene and manipulate them (rotation, ...
3
votes
2answers
623 views

OpenGL 2.1 vs Modern OpenGL

I want to make a 3D voxel game, randomly generated planets, some with live (one minimum with life) , and they are spinning around the sun. For now I have this in OpenGL 2.1 (using fixed pipeline, ...
1
vote
0answers
27 views

How to calculate specular contribution in PBR?

I'm trying to implement PBR in our project (we started a small game engine for academic and learning purposes) and I cannot understand what is the right way to calculate specular and diffuse ...
1
vote
0answers
30 views

OpenGL texture not loading onto the model

I am still learning and I'd like to apologize if I don't explain something clear enough or anything like that. please forgive me :) So I am experimenting with 3D graphics for my university ...
0
votes
0answers
20 views

Inverted FXAA Shader

I'm trying to use an existing FXAA shader which works but when I try to run it the filtered image is inverted. ...
0
votes
1answer
55 views

How should I structure VBOs for my 2d world data?

My game is played on a fixed-size hex based arena, where each hex can be of a different type, and possibly contain some creatures/items/anything on it. When I started out, I got the advice to have a ...
3
votes
1answer
87 views

Sine-based Tiled Procedural Bump

I am trying to implement this formula to generate bump but I am facing some issue. The result doesn't look the same it's much darker. Here is my result (without same parameters) but it is much ...
0
votes
0answers
18 views

Skin Mesh Animation Shader Issue

I'm having troubles with properly animating a skin mesh from an .fbx file. I feel like the issue is in the shader, but not sure what is going on. All I know is that I am getting unexpected results ...
0
votes
0answers
48 views

vertex shader doesn't work properly

Linux, OPenGL 3.0, GLSL 130 (Intel card) I'm learning OpenGL and successfully rendered a triangle, but as soon as I create the matrix of projection I get an error. The shader compiles and works ...
1
vote
0answers
52 views

Slick2D fails to load small textures

I'm trying to load a small 32x32 png texture using Slick2D, however it doesn't seem to render correctly. What's odd is that larger textures do load correctly. The 32x32 texture I'm trying to load: ...
0
votes
1answer
40 views

GL uniform variables

I have been studying on glsl lately, starting from very simple vertex and fragment shaders creation for Blender3d, I was quickly drawn to writing the OpenGL context in C++. I find it difficult to ...
0
votes
1answer
19 views

draw two models changing the MVP matrix (android opengl)

I'm newbie with opengl2 in android, and I'm making an app in which I'm testing some things. Now I was trying to duplicate a sphere object with a texture, so I thought it was enough to change my MVP ...
3
votes
0answers
43 views

Spherical Area Lights do not match reference

So I'm adding spherical area lights to my application, and comparing my results with mitsuba, I am getting some differences (left is my approach, right is mitsuba - a pathtraced reference): What I ...
1
vote
1answer
29 views

Storing and using UV and Normal Data with OpenGL [duplicate]

I'm having trouble mapping UV coordinates to vertices in OpenGL. I'm binding my buffers and enabling all of my attrib arrays perfectly well and things are rendering - but what I'm stuck on is how to ...
0
votes
1answer
27 views

Send OpenGL video flux via UDP [closed]

It is possible to send the video flux of an OpenGL desktop app via UDP on Linux ? I looked up FBO and off-screen rendering but I still can't figure out how to extract the video flux and send it. I'm ...
0
votes
1answer
43 views

Solution for Shipping Optimized and Minified GLSL?

I've tried to find a reputable optimizing compiler for GLSL that takes source shaders, performs what optimizations it can statically assume, and outputs a minified GLSL file with optimizations, ...
0
votes
1answer
44 views

OpenGL: Generating a single square with a Quad Strip

I am currently trying to create a terrain generation system (for my 3D game) with OpenGL 2.1. The way I am doing it requires the creation of a massive 2D square that consists of multiple smaller ...
0
votes
0answers
34 views

How to spin a 2D quad in place using only matrices?

In short, I have a textured 2D quad (a sprite). I would like to rotate/spin it about the z-axis (coming out of the screen) using nothing but matrices. If I do the following to a transform with scale ...
0
votes
1answer
20 views

Translation matrix applyed to the view matrix not working (android opengl2)

I have managed to do an small app using opengl2 in android. It consists on a sphere moving over a rectangle, both with a texture. It's just a test in which I'm testing my first steps in opengl. Now ...