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

3
votes
2answers
4k views

How do I properly check if a particular OpenGL version is available?

I can't find any information on glCreateContextAttribsARB returning errors if a version is unsuported by the driver. So how do i check if it is? I don't want the program to hard crash because ...
0
votes
1answer
62 views

Mesa: Howto enable OpenGL 3.x functionality via extensions?

How can I enable OpenGL 3.x functionality via extensions? I'm new to OpenGL development under Linux. Currently I have: #define GL_GLEXT_PROTOTYPES #include <GL/osmesa.h> #include ...
0
votes
1answer
237 views

What is “ping pong” in the context of graphics rendering?

I have to render a scene, once per light, and blend the result of the various passes. I heard and read that one way to increase performances and render targets to use would be ping pong. I'm new to ...
0
votes
0answers
38 views

How do I convert code from OpenGL 2 to DirectX? [on hold]

Some time ago, I developed a very large project using pure OpenGL and OpenAL for the sound. I've decided to port it to Windows APIs (OS and DirectX). I know OpenGL supports Windows, but I would like ...
0
votes
0answers
32 views

Problems texturing a sphere using a cubemap

I have a single problem which I've attempted two methods to resolve. Neither is giving me 100% results. I've read about 100 tutorials and looked at code but it's just not working out for me; I believe ...
1
vote
2answers
58 views

Weird GLM perspective problems with my 2D Game

I am trying to create the graphics system of a 2D game using OpenGL 3.3. To help me in this task I am using the GLM math libraries. However I am having some trouble. When my objects (for now they ...
3
votes
1answer
106 views

Using textureGrad for anisotropic integration approximation

I'm trying to develop a real time rendering method using real time acquired envmap (cubemap) for lightning. This implies that my envmap can change as often as every frame and I therefore cannot use ...
1
vote
1answer
187 views

Understanding implementation of glu.PickMatrix() [on hold]

I am working on an OpenGL project which requires object selection feature. I use OpenTK framework to do this; however OpenTK doesn't support glu.PickMatrix() method to define the picking region. I ...
1
vote
2answers
97 views

How can rotate a 2D textured quad in legacy OpenGL immediate mode?

I have a texture of a tank, and I want to it appearance on the screen depends on its current direction, so I decided to use rotating texture functions of OpenGL. I followed some advices through Google ...
-1
votes
0answers
92 views

How to learn C++ from a game development perspective? [closed]

I already know pretty much C++. I want to relearn C++ because I want to be a hardcore game developer. Which C++ topics should I give emphasis to? Which books should I read? which libraries should I ...
1
vote
2answers
137 views

Application of classes with critical non-static fields in LWJGL

I'm going to be as specific about this question as I can. Ultimately, how is it that I apply a class that uses non-static fields in LWJGL? More specifically, I know that OpenGL is quite nearly more a ...
3
votes
0answers
75 views

Are there alternatives to multiple buffering? [duplicate]

I'm learning about game programming. So far, my sources lead me to believe that multiple buffering is the best technique for redrawing in OpenGL. Are there other redrawing techniques? What are their ...
2
votes
1answer
61 views

OpenTK GL.DrawElements is never called

I found this C++ code here. It draws simple rectangle. Works great. #define GLEW_STATIC #include <iostream> #include <glew.h> #include <freeglut.h> const GLchar* vertexSource = ...
0
votes
1answer
211 views

Is there a standard way to track 2D tile positions both locally and on screen?

I'm building a 2D engine based on 32x32 tiles with OpenGL. OpenGL draws from the top left, so Y coordinates go down the screen as they increase. Obviously this is different than a standard graph ...
2
votes
1answer
184 views

How do I use unpackHalf2x16?

I'm trying to use (un)packHalf2x16, without success so far. I'm drawing with: glVertexAttribIPointer(0, 2, GL_UNSIGNED_INT, 0, 0); glEnableVertexAttribArray(0); glBindBuffer(GL_ARRAY_BUFFER, vbo); ...
0
votes
2answers
65 views

Taking fixed direction on hemisphere and project to normal (openGL)

I am trying to perform sampling using hemisphere around a surface normal. I want to experiment with fixed directions (and maybe jitter slightly between frames). So I have those directions: vec3 ...
2
votes
1answer
111 views

Indexed Drawing in OpenGL not working

I am trying to render 2 types of primitives- - points ( a Point Cloud ) - triangles ( a Mesh ) I am rendering points simply without any index arrays and they are getting rendered fine. To render ...
-1
votes
0answers
30 views

My LWJGL rendering code isn't working after I moved it into a separate class [closed]

I started making my first game with LWJGL today, and built some simple rendering code that sets up the openGl instance and a method for drawing textured quads. This was all done in the main class and ...
0
votes
1answer
56 views

Having trouble with projection matrix, need help

I'm having trouble with what appears to be the projection matrix. Given a wide enough of a screen, when a cube is on the left and right most edge, the left or right wall will appear stretched to the ...
0
votes
0answers
15 views

Using normal maps in irrlicht lime with Direct3D9

I am using Irrlicht Lime, a .NET wrapper for the Irrlicht Engine. In my scene I render some simple geometries, that I construct "by hand". These are textured and shoud get a better look through normal ...
0
votes
1answer
76 views

OpenGL segfault in DrawElements

I've asked this question on regular StackOverflow but without much success yet. The below program produces a segfault on the call to glDrawElements. I've looked at my max and min index values and they ...
0
votes
0answers
19 views

Is it possible to loop over an array of samplerCube/samplerCubeShadow using OpenGL/GLSL?

I try to manage a scene with several point lights. For the moment my program works perfectly with just one point light. So I have in my fragment shader the following uniform declaration: uniform ...
1
vote
2answers
87 views

How do I ensure my skybox is always in the background, with OpenGL?

I created a skybox in OpenGL (through LWJGL), but the only way I found to render it behind all objects was to make it very big. This leads to ugly edges between the 6 skybox planes. Optimally, I ...
1
vote
1answer
50 views

Problems with texture orientation in space

I am currently drawing texture in 3D space and have some problems with it's orientation. I'd like me textures always to be oriented with front face to user. My desirable result looks like ...
4
votes
1answer
2k views

Implementing a skybox with GLSL version 330

I am trying to get a skybox working with OpenGL 3.3 and GLSL version 330. I could not find a completely modern OGL skybox tutorial anywhere on the web, so I modernised an older one (using ...
0
votes
1answer
69 views

New to OpenGL , having trouble understanding matrix transformation

I have modest experience of developing games with sdl , libgdx , unity etc. But never got into learning any low level API. So I thought about learning OpenGL and got started with tutorials provided by ...
1
vote
1answer
152 views

Render 2 images that uses different shaders

Based on the giawa/nehe tutorials, how can I render 2 images with different shaders. I'm pretty new to OpenGl and shaders so I'm not completely sure whats happening in my code, but I think the shaders ...
2
votes
1answer
157 views

Mouse Speed in GLUT and OpenGL?

I would like to simulate a point that moves in 2D. The input should be the speed of the mouse, so the new position will be computed as following new_position = old_position + ...
1
vote
1answer
144 views

OpenGL (ES 2.0) Function Dependencies

In OpenGL (ES 2.0), there are many functions that can be called in any order, and still others that must be called after other functions had been called and not before. For example, attaching a shader ...
1
vote
1answer
94 views

Architecture to draw many different objects in OpenGL

I have some objects that I want to draw. I am not sure how I can create my architecture in a way where I can draw everything as fast as possible. As example: class MyObject { float[] vertices; ...
0
votes
0answers
20 views

How to get the exact vector location of a loaded model in jMonkey engine

I am new to game developing and using the jMonkey engine. I started to develop an endless running type game. To run, I have created a map with blender and imported it to jME. As the shows, I have ...
1
vote
0answers
78 views

OpenGL - Texture disappears

I'm making a simple program with C++, SDL and GLEW. So far it is going great but I ran into a weird problem. One of my four textures would not show up on screen even though it used the same code as ...
1
vote
1answer
69 views

OpenGL ES draw pre-rendered background onto depth buffer

I want to create a scene with 2D pre-rendered background and 3D models for characters (like those classic Final fantasy games). For the background, I have 2 textures: one to be displayed, with ...
1
vote
1answer
61 views

Tons of textures using vbo

I recently learned how to create shaders and was looking to make a simple top down game, starting with a tilemap. The problem I encountered, Whilke I can store a vbo of all the blocks in a "chunk" of ...
0
votes
1answer
102 views

WebGL wrong scaling of rectangle

I'm working with this tutorial http://www.html5rocks.com/en/tutorials/webgl/webgl_transforms/ and my result is, that the rectangle moves in the direction of it's scaling values, and also scales at ...
2
votes
0answers
45 views

Text rendering overlap

I'm trying to display text with a texture and font description created with BMFont in OpenGL 3.3, but whenever I display the text there is some overlap between certain characters. Here is the text at ...
1
vote
1answer
114 views

How do I add a border to rectangles using a shader?

I want to draw some rectangles with a border. Currently I render the fill with glDrawArrays(Triangles, ...) and the border with glDrawArrays(LineLoop, ...). Is there a neater way? I'm targeting ...
3
votes
1answer
768 views

exporting bind and keyframe bone poses from blender to use in OpenGL

EDIT: I decided to reformulate the question in much simpler terms to see if someone can give me a hand with this. Basically, I'm exporting meshes, skeletons and actions from blender into an engine ...
6
votes
2answers
759 views

atmospheric scattering and sky geometry

I'm trying to implement an atmospheric scattering in my graphics (game) engine based on the gpu gems article: link. An example implementation from that article uses a skydome. My scene is different - ...
-1
votes
0answers
25 views

changing the color of gl_quads inside loop

I am trying to make a chess board with black and with quads , it should display black and whiote alternate quards but its not doing that for some reason here is my code #include <glut.h> void ...
1
vote
1answer
58 views

Correct multiplication order for a 2D Matrix

I'm currently trying to create a camera and entity/model matrix for my 2D game similar to that of Unity3D. I've already tried to find answers to this question on stackoverflow/gamedev but i couldn't ...
3
votes
2answers
143 views

Possible to create transparency shader which doesn't stack alpha values

The image above best demonstrates what I'm trying to achieve. It's a transparent shader for objects, but wherever the objects with this shader intersect they don't add together but simply merge with ...
1
vote
1answer
160 views

Random lines away from images in java2d opengl game

Working on a java game that uses some pngs images for icons/textures. A few images ( fewer than 5, out of dozens ) are showing some odd parallel "artifact" lines. They move with the image, are ...
0
votes
1answer
91 views

3D position of an arbitrary UV coordinate

I have a UV map for a 3D mesh that encodes "links" between pairs of UV coordinates. I have previously defined this links (or pairs), one to one. The links are enconded using the function rgb_color(u1, ...
3
votes
2answers
100 views

Rendering Many Objects in OpenGL4

Sorry for asking such a basic question. I am reading books on OpenGL4 but in most examples they generally render only objects. So I understand how to deal with vertex buffers and vertex array buffers, ...
5
votes
1answer
976 views

Exponential Variance Shadow Mapping - implementation

I use a variance shadow mapping with a "standard" light bleeding fix in my graphics engine which is based on deferred rendering.. I have a single shadow map for a directional light beacause a test ...
1
vote
1answer
96 views

How to implement camera pan like in Maya?

I am trying to implement camera pan like the one in Maya. I've got it almost working. The problem is that the mouse cursor is moving faster than the 3d mesh (in fact I am moving the camera but I ...
1
vote
1answer
216 views

Calculating shadowmap coordinates for cubemap in shading pass?

I'm trying to implement shadow mapping with cube maps. I believe I've done the first stage by filling the cube map, but for the final shading pass I am unsure how to exactly calculate the cubemap ...
3
votes
0answers
72 views

Why does accessing a uniform float make my shader more than twice as slow?

My fragment shader was significantly slowed down by a recent change, and I've been trying to understand why. I isolated the main slow-down to accessing a single particular uniform float. If I include ...
2
votes
1answer
28 views

Swapping Framebuffers or swapping attachments?

I wanted to know what the better approach would be for post-processing: swapping between framebuffers or swapping between textures attached to one framebuffer?