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
2answers
2k views

Drawing multiple objects from one Vertex Buffer Object in OpenGL/OpenTK

I am trying to experimenting drawing method using VBO in OpenGL. Many people normally use 1 vbo to store one object data array. I was trying to do something quite opposite which is storing multiple ...
0
votes
1answer
882 views

GLSL billboard move center of rotation

I have successfully set up a billboard shader that works, it can take in a quad and rotate it so it always points toward the screen. I am using this vertex-shader: void main(){ vec4 tmpPos = (MVP * ...
14
votes
1answer
1k views

Normals vs Normal maps

I am using Assimp asset importer (http://assimp.sourceforge.net/lib_html/index.html) to parse 3d models. So far, I've simply pulled out the normal vectors which are defined for each vertex in my ...
1
vote
1answer
1k views

How to use mipmap in OpenGL-ES

I have recently entered in the OpenGL world. I am very pleased with the performance that I got with opengl compared to those obtained with a SurfaceView and its canvas. At the same time because of the ...
2
votes
1answer
1k views

OpenGL slower than Canvas

Up to 3 days ago I used a Canvas in a SurfaceView to do all the graphics operations but now I switched to OpenGL because my game went from 60FPS to 30/45 with the increase of the sprites in some ...
3
votes
1answer
431 views

Why is SpriteBatch.end() generating null pointer exception in this code?

I am getting a null pointer exception using libGDX that the debugger points as the SpriteBatch.end() line. I was wondering what would cause this. Here is the offending code block, specifically the ...
0
votes
2answers
112 views

view if GL_CULL_FACE is enabled/disabled

Im using GL_CULL_FACE, an i'm trying to map a key for enable/disable the gl_cull_face. Is there any posibility of viewing if it's enabled or not? Thanks
1
vote
1answer
249 views

How to only render part of an image in lwjgl/openGL

I'm making a mining/building game in java using slick2D and I want to make it so you can only see a few blocks in any direction while you are underground. The best example I could find of what I want ...
0
votes
1answer
462 views

How to deallocate/release/delete of a glTexStorage2D?

I tried to find this but found nothing. Does anyone know how to 'deallocate' textures/mipmap from glTexStorage2D once you don't need it anymore?
0
votes
1answer
575 views

I get GL_INVALID_VALUE after calling glTexSubImage2D

I am trying to figure out why my texture allocation does not work. Here is the code: glTexStorage2D(GL_TEXTURE_2D, 2, GL_RGBA8, 2048, 2048); glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 2048, 2048, ...
3
votes
1answer
363 views

Material, Pass, Technique and shaders

I'm trying to make a clean and advanced Material class for the rendering of my game, here is my architecture: class Material { void sendToShader() { program->sendUniform( ...
0
votes
1answer
139 views

Mesa 9.2 does not support OpenGL 3

I'm trying to install OpenGL 3.0 for studying examples about GLUS , which require OpenGL 3 or 4. I read on the official Mesa website that Mesa 9.2 support OpenGL 3.0, but after I installed Mesa 9.0, ...
0
votes
0answers
90 views

Triangle Clipping

I want to determine which part of a triangle is visible in a frustum in OpenGL, is there a way to get visible coordinates of triangle in the viewing frustum?
3
votes
1answer
217 views

How to Construct a Perspective Projection With 4 Vanishing Points

Is it possible to construct a projection matrix which will create a perspective with four (or more) vanishing points? This question have an OpenGL tag, but general insights are welcomed as well.
2
votes
1answer
472 views

Xbox Controller Not Connecting in Monogame Project

I have recently been playing around with the support of the wired XBox 360 controller in Windows development. I am developing in C# in Visual Studio 2012. I have created 2 projects. The first ...
0
votes
1answer
185 views

Implementing smooth object rotation

I declared two variables on class level. One is the angle the object is rotated by. The second is a stopwatch. float yRot = 0.0f; static CStopWatch rotTimer; I rotate the cube using the SpecialKeys ...
2
votes
1answer
191 views

How stencil buffer and glFrontFace help making a shadow?

I'm trying to understand the tutorial 27th in Nehe website. This is about how to cast a shadow of an object using stencil buffer in OpenGL. The idea here is checking the directions of all the faces of ...
0
votes
1answer
76 views

Displaying normals of a geometry

I have a rectangle which is created by 2 triangles and it is in x-z plane, and i have object on it. Now, the normals of two triangles (face normals) are y axis i.e. (0,1,0). I want to display normals ...
4
votes
3answers
2k views

Implementing skeletal animation and GPU skinning (DOOM MD5)

DISCLAIMER This question has been completely rewritten to narrow the scope of the question in light of previous suggestions and answers, but the same problem still persists. Currently I'm trying to ...
0
votes
1answer
2k views

rotating 3D object around the center

I have object moving from A to B on x-axis and there is no translation of object apart from it. Now, while moving, i want to rotate it around y-axis and the motion should change accordingly, i mean if ...
0
votes
1answer
107 views

What input and window handler should I learn for complement OpenGL? [closed]

I have a good base in C++ programming and I did some 2D games using SDL. Now I want to start making 3D games, but as much as posible, I want to learn following the standars of the profesional ...
0
votes
1answer
478 views

How to move a rectangle properly?

I recently started to learn OpenGL. Right now I finished the first chapter of the "OpenGL SuperBible". There were two examples. The first had the complete code and showed how to draw a simple ...
0
votes
1answer
334 views

How to draw a rotatable and zoomable sphere?

My game is a sort of business simulation game of Earth, and I want the main interface to be just like a google earth view. Is there a way to do this with built in OpenGL features or do I have to ...
5
votes
1answer
635 views

OpenGL ES 2.0 obscured texture is visible

Hi, I am using LibGDX and OpenGL 2.0 to create a game. So far I have created two meshes. The front mesh is the one with the brown circle texture and another mesh on the top with a green to white ...
3
votes
1answer
190 views

Convert global rotation into local rotation

I have an object in my game and I have its location, rotation and scaling in separate float[3]. The location rotation and scale are all on the global axis; these do not change based on the objects ...
2
votes
1answer
258 views

Proportional speed movement between mouse and cube

Hi i´m trying to move a cube with the freeglut mouse "glutMotionFunc(processMouseActiveMotion)" callback, my problem is that the movement is not proportional between the mouse speed movement and the ...
0
votes
1answer
146 views

Can JOGL help me learn OpenGL?

I've decided to learn OpenGL. I worked through several tutorials. I've found it far too complex performing a simple task like doing sprite animation in openGL. Now I read about JOGL which seems to be ...
-1
votes
1answer
285 views

undeclared Identifier error [closed]

I am learning computer graphics using opengl and c++. when I am trying to run my code It shows the following error: 'myDisplay' undeclared identifier. Although thats already declared. please help me ...
17
votes
6answers
3k views

Separating game data/logic from rendering

I'm writing a game using C++ and OpenGL 2.1. I was thinking how could I separate the data/logic from rendering. At the moment I use a base class 'Renderable' that gives a pure virtual method to ...
2
votes
1answer
801 views

Uncharted 2 tone mapping and an eye adaptation

I found an example of uncharted 2 tone mapping on this site. Here is the code: float A = 0.15; float B = 0.50; float C = 0.10; float D = 0.20; float E = 0.02; float F = 0.30; float W = 11.2; float3 ...
0
votes
2answers
327 views

LWJGL texture bleeding fix won't work

I tried a lot of things to fix texture bleeding, but nothing works. I don't want to add a transparent border around my textures, because I already got too many and it would take too much time and I ...
-1
votes
1answer
108 views

Problem in animating polygon [closed]

Hi I am trying to move my black colored polygon downward. But As soon as I run my application my polygon gets invisible! I think My logic of move function is wrong. Can anyone help me out in figuring ...
1
vote
1answer
107 views

How to use GLX from Java? [closed]

I am trying to use Clojure to create an opengl window under Linux. Is there a tutorial on how to use GLX and X Window directly. I'd rather learn how to do this directly, which I already know how under ...
1
vote
1answer
775 views

shadow mapping and linear depth

I'm implementing ominidirectional shadow mapping for point lights. I want to use a linear depth which will be stored in the color textures (cube map). A program will contain two filtering techniques: ...
0
votes
3answers
716 views

OpenGL ES 2 - Developing snowfall particle system

I've recently begun OpenGL ES 2 and I'm trying to implement a snowfall (on Android), but I'm not sure what's the best approach. I would like to develop it myself rather than use a library. It really ...
0
votes
1answer
827 views

OpenGL resize problems

I'm developing a minesweeper game. I'm having a problem with reshaping(resize) the window. I'm using Ubuntu Linux. Following are the code snippets and the entire code is here: This is my initializing ...
0
votes
1answer
111 views

How to implement “model quality” in OpenGL

In many games, there is an option named: "Model Quality", which ranges from Low to High. Low model quality simply removes a lot of vertices from the model, to make it faster, while High preserves the ...
0
votes
1answer
495 views

Simulate camera movement in two dimensions (OpenGL)

I've been told by the folks over at Stack Overflow that there's no way to move the camera in OpenGL. I'm developing a 2D RPG with LWJGL and need to know the proper way to simulate camera movement as ...
-1
votes
1answer
165 views

Texture doesn't draw correct

I'm writing a game using SFLM and Opengl but when I create a terrain i got some OpenGl problems. I use heightmaps to generate a terrain but when I load the texture on it the texture is not correct ...
1
vote
2answers
139 views

Modern opengl for direct3d programmers [duplicate]

I don't think this is quite the same questions as this one but if you disagree feel free to close this :) With SteamOS being announced yesterday I can see that it's entirely possible that opengl will ...
1
vote
0answers
253 views

Unity Pro - Shadow rendering issue

I am using Unity Pro 4.2.1f4 and I always have this sort of glitch. This is due to the shadows and the bias. Even with a low bias this is happening. I've found a thread that talks about that ...
1
vote
1answer
270 views

WebGL immediate mode

I know that WebGL is based on OpenGL ES 2.0 and that glBegin and glEnd have been removed and replaced with vertex buffer objects. I understand that VBOs are faster and use less code but is there a ...
1
vote
1answer
222 views

Reading from depth textures always returns 1

I create a packed depth/stencil texture and attach it to a framebuffer like this: glGenTextures(1,&_depthStencilTexture); glBindTexture(GL_TEXTURE_2D,_depthStencilTexture); //set filtering to ...
4
votes
2answers
2k views

What does changing GL_TEXTURE_WRAP)_(S/T) do?

I am working through some beginner OpenGL tutorials, and the current one teaches how to apply a texture to a simple rectangle. The tutorial states tells me to set the texture parameters ...
0
votes
1answer
2k views

Why would one bind several textures to the same OpenGL texture unit?

This OpenGL documentation article says you can bind 4 (=several) textures to texture units 0, 1, etc. This OpenGL documentation article too. I found in this Stack Overflow answer an example of why it ...
2
votes
2answers
260 views

Orthographic Zooming with 0,0 at top/left

I'm trying to implement zooming on my 2D game. Since it's using orthographic projection, I thought it would be easy to implement zooming. After looking around the internet, I found a bunch of ...
1
vote
0answers
462 views

c++ opengl unproject not working [duplicate]

first of all, sorry for the bad english. I need to convert my mouse coordinates to world coordinates, I'm trying to use the glm unproject method. 1280x720 is the size of the window, It's hard coded ...
2
votes
1answer
152 views

Can Entities Have Their Own Shader In Deferred Rendering?

Since you need to use the general g-buffer shader to fill g-buffer, how can entities have their own shaders, like giving a box normal mapping feature ? As I remember, you can't use two shaders at the ...
2
votes
2answers
537 views

How to draw point sprites with transparency in OpenGL without depth sorting?

I am trying to render point sprites with alpha transparency and because I render millions of points depth sorting would kill performance. My issue as you can probably imagine is that artifacts appear ...
3
votes
4answers
311 views

How do I find the 2D direction to a 3D location?

I'm writing a 3D space flightsim, and I'm trying to display a 2D arrow on screen that points to the player's selected target. To clarify, the arrow needs to point in the direction that the player has ...