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

1
vote
1answer
73 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
204 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
53 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
170 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
43 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
1answer
46 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
40 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
51 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); ...
1
vote
0answers
63 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
71 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
653 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, ...
2
votes
0answers
40 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
35 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 assignment....
0
votes
0answers
27 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. http://www.geeks3d.com/20110405/fxaa-fast-approximate-anti-aliasing-demo-glsl-opengl-...
1
vote
1answer
77 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
105 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
22 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
54 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
57 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: ...
1
vote
1answer
73 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
47 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 ...
4
votes
0answers
51 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
32 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
32 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 ...
1
vote
1answer
61 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
49 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
38 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
42 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 I'...
0
votes
1answer
96 views

How should my engine Identify objects

I'm making a fairly basic openGL 3D engine, at the moment, when you load an object, you would write manager->LoadObjFile("cube.obj"); manager->AddParent("uvmap.bmp", "cube.obj", "cube", glm::...
4
votes
0answers
54 views

Irradiance Map ( Irradiance environment map)?

As irradiance map is generated for every possible normal for all the texels in environment map (as every texel act as a light source) so that we can look up irradiance map, based on normal of fragment ...
0
votes
1answer
37 views

OpenGL EBO vs Mesh representation

As an exercise set to myself, I wanted to make a Mesh loader using modern OpenGL. However, I have to ways of representing the notion of face of a mesh. Currently, I am using what seems the most ...
1
vote
2answers
54 views

OpenGL strange color issue

I recently made terrain generation for my game, and I created a lighting system (simply diffuse lignting), but there's a strange problem around the edges. I know, OpenGL interpolates the different ...
-1
votes
1answer
181 views

Create YUV texture for GL_TEXTURE_EXTERNAL_OES format

0 down vote favorite I need to create a yuv texture for GL_TEXTURE_EXTERNAL_OES format. source : https://github.com/crossle/MediaPlayerSurface/blob/master/src/me/crossle/demo/surfacetexture/...
1
vote
0answers
95 views

Turning On/Off Vsync no longer working when rendering to an offscreen buffer

I have this reaallly strange issue that as soon as I render to an offscreen framebuffer I am no longer able to toggle VSync while my application is running. I am using OpenTK as the opengl wrapper, ...
1
vote
1answer
52 views

opengl storing multiple indices into indices buffer

After parsing collada files I found out that we have to load two(or more) indices each pointing to say a vertex or normal etc. like this (<p>3 0 2 0 0 0</p>) Is there a way to load (and use)...
0
votes
0answers
55 views

How to properly use a 3D texture in OpenGL 4?

I working on a student project which consists to make clouds volumetric rendering and implement the feature in an existing engine based on OpenGL 4 and written in C++. To do so, I have set a compute ...
0
votes
0answers
36 views

Tilemap not rendering properly

I'm making a single-screen scrolling platformer (OpenGL/SDL) and I've made a tilemap out of a 2D array, pre-sized with variables of the LEVEL_HEIGHT and LEVEL_WIDTH. Each element in this 2D array ...
0
votes
1answer
50 views

Strange shadow behavior when light direction is parallel to a plane

i have a strange problem with shadow acne. It occurs when the light direction is parallel to a plane. Here is my code and a few images of the problem: //this calculates the shadow matrix //#####...
0
votes
2answers
49 views

OpenGL perspective matrix far plane

The near plane clips at exactly the value I set just fine but instead of clipping at 1000 the far plane clips at 1. Here is the code for the projection matrix: public static Matrix4f perspective(...
0
votes
1answer
63 views

Irrlicht app: Creating STL exception leads to segfault

I'm developing application with C++ language and Irrlicht engine. When I add std::runtime_error("err") expression into my code, I got segmentation fault at address 0 (before entering to main). If ...
1
vote
1answer
59 views

Opengl occlusion culling huge performance drop

Hello I tried to implement occlusiong culling to my engine in opengl using java & lwjgl. Occlusion works but... performance drop is huge I mean from 60-70 fps to 3-6 fps. Here is my question what ...
5
votes
2answers
585 views

Why would one use a separate alpha mask for sprites?

I've seen tilesets of the game Braid, and for each tileset in the main folder there is an alpha map for it in "alpha" folder. I wonder, why just not to draw your image as it is (with transparent ...
2
votes
0answers
61 views

GLSL shader with light colors wrong on nvidia optimus

So, I built some code to draw a spinning cube with a red light on the right side, and a blue one on the left. I run it on my laptop with optimus graphics, and on my desktop with nvidia. On the laptop, ...
0
votes
2answers
92 views

How can I better structure my code to reduce coupling between input and graphics?

I've been working through a few OpenGL tutorials, and decided to give myself the exercise of trying to draw a grid, with the added requirement of being able to press the - and + keys to change the ...
0
votes
1answer
28 views

Reset Opengl multisampling

I start using multisampling by doing ContextAttribs attribs = new ContextAttribs(3, 3).withForwardCompatible(true).withProfileCore(true); Display.create(new PixelFormat().withSamples(...
1
vote
1answer
112 views

Collisions being detected before objects are intersecting

I'm making space invaders (in OpenGL/SDL) and I'm currently having issues with getting the collisions (box collisions) between the bullets and the enemies to be properly detected. In my update() ...
-1
votes
2answers
71 views

How to lock the mouse cursor in the middle in a first person camera?

I want to get a first person camera (like Call of Duty or Minecraft etc.) but I don't know which is the best way to do it. I have some camera increase rotation methods (camera.increase Rotation(x,y,z)...
1
vote
1answer
91 views

How do I structure code with multiple VBOs?

As per my previous question, it seems it would be desirable to use more than a single VBO in my OpenGL program. But I've hit a wall when trying to do this. Currently my main function looks something ...
0
votes
1answer
51 views

Frustum culling only working at certain angles

So how I'm doing this is a little sketchy but I plan on changing it to either AABBs or spheres once I get it working. So the problem I'm having right now is that the frustum culling I've implemented ...
0
votes
1answer
86 views

Black Screen when using High-Performance NVIDIA Processor

I have an issue where my program renders a black screen on other computers. I narrowed it down to when a different graphics card is being used. When I run the program using Integrated Graphics (...