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
1answer
28 views

Render object with different shader depending on the camera

I have an object with a custom shader. When it is being rendered by cameraA, then I want it to render a particular way (ex red). When it is rendered by another cameraB, I want it to render a different ...
1
vote
2answers
76 views

Game Engine architecture clarification

I want to write my own (simple) game engine with OpenGL. I use GLEW and GLFW and so far linked it successfully. My question is: Should the engine or the respective game (which depends on the engine) ...
3
votes
1answer
118 views

OpenGL App not setting cursor position appropriately

I have written a small application using OpenGL, and have implemented some rudimentary camera controls. Unfortunately, I cannot get the application to set my cursor position correctly. The cursor is ...
7
votes
2answers
462 views

OpenGL Fast-Object Instancing Error

I have some code that loops through a set of objects and renders instances of those objects. The list of objects that needs to be rendered is stored as a std::map>, where an object of class ...
2
votes
1answer
65 views

OpenGL GLSL using projection,view and transformation

I have been trying to get a simple triangle to render on the screen but an unable to using the Projection, View and Transformation Matrix's but an unable to get anything to the screen. Main loop ... ...
2
votes
1answer
51 views

Terrain Collision problem

I'm trying to implement terrain collision for my height map terrain, and I'm following this. The tutorial is for java but I'm using C++, though the principles are the same so it shouldn't be a problem....
3
votes
1answer
35 views

Having trouble combining color attachments to implement bloom

I'm trying to implement bloom in the same manner as this tutorial http://www.learnopengl.com/#!Advanced-Lighting/Bloom but I am having difficulties. I have the 'pingponging' working IE the blur ...
0
votes
1answer
59 views

create opengl rendering engine [on hold]

I love Graphics, so i decided to start learn OpenGL. i have some basic information about it. the aim of learning OpenGL this time is to create rendering engine for 3d games that have advanced features ...
1
vote
1answer
161 views

Jittery Rotational Movement with Arcball implementation

I have an assignment where I need to implement arcball using Opengl (~2.0). I have it more or less implemented but I have a some problems/issues/bugs and I'm not sure whats either causing them or how ...
0
votes
1answer
115 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 ...
3
votes
1answer
148 views

OpenGL contexts

I have several questions related to OpenGL rendering and the issues I encountered while making 3D enigne. Some of them were asked before, but the answers are old and possibly outdated or ambiguous. 1)...
2
votes
1answer
95 views

Translation Matrix not working properly

Hello, I get this result when i try to scale and then translate a vec4 in my shader. I created a mat4x4 class on my own and some functions wich return some matrices for me, everything works, but not ...
1
vote
1answer
151 views

OpenGL: How to map point inside frustrum to normal device coordinates (NDC)?

I read this article http://www.songho.ca/opengl/gl_projectionmatrix.html. It's explain how calculate projection matrix coefficients. But I completely can't understand how author perform mapping from ...
5
votes
1answer
53 views

Best way to initialize values on 32-bit FP framebuffer in OpenGL

I have a framebuffer bound to 32-bit FP texture: glGenTextures(1, &texColor); glBindTexture(GL_TEXTURE_2D, texColor); glTexImage2D(GL_TEXTURE_2D, 0, GL_R32F, w, h, 0, GL_RGBA, GL_FLOAT, (GLvoid*)...
1
vote
2answers
48 views

OpenGL: Properly attach Texture

Problem: Been trying for hours to set a simple png of a cross hair as a texture (so I could later stick in the middle of the view like a normal cross hair), without luck. I'm coding in Java with ...
0
votes
1answer
73 views

Is 3d game development advantageous/possible in SDL2? [duplicate]

I think this is not appropriate, but as the given video in the link, the youtuber name Bisqwit creates his own 3d engine from scratch in C and SDL2. How much is this advantageous is real 3d game ...
3
votes
3answers
156 views

How to hide a post-processed mesh outline when/where the mesh is hidden

I'm working on setting up an active outline in my 3d engine, a highlight effect for selected 3d characters or scenery in the screen. After working with the stencil buffer and getting some ...
5
votes
3answers
145 views

Random black pixels GLSL shader bug

I've recently been following a tutorial for writing a game engine in Java using LWJGL 2. I followed the tutorial for writing a fragment shader that utilizes spotlights in GLSL. The example game ...
4
votes
0answers
135 views

How to correctly implement 'layered lighting' with Box2D-Lights

How does one only allow Box2D-Lights to affect one and only one OrthographicCamera. After researching, I found the following answer. This answer goes into detail about how to prevent one camera from ...
2
votes
3answers
74 views

Protecting game assets through archiving

I'm writing a game in C++ (with OpenGL) and am getting quite far into development. Currently I'm loading the data directly from different directories. (E.G. I load textures from a /Data/Textures/......
0
votes
1answer
77 views

Loading non-skeletal animation to opengl via assimp

I'm a newbie in assimp and openGL. I'm trying to import .fbx or .dae formatted file to openGL via assimp. Importing skeletal animation was kind of easy. Lots of introductions and sample projects ...
3
votes
1answer
2k views

Opengl-es picking object

I saw a lot of picking code opengl-es, but nothing worked. Can someone give me what am I missing? My code is (from tutorials/forums) Vec3 far = Camera.getPosition(); Vec3 near = Shared.opengl()....
3
votes
1answer
35 views

Is this process for generating an OpenGL perspective projection correct?

I have been programming OpenGL for a while now and I have successfully created a perspective camera, however, I can't help but shake the feeling that I am doing it wrong. The code I am using is below, ...
4
votes
1answer
53 views

What are the alternatives to OpenGL arrays for deferred rendering?

I'm trying to build a deferred rendering technique in an OpenGL engine, but I can't figure how I could get more than the limit of 32 lights. I use an array in my shader, feed light properties in this ...
4
votes
1answer
44 views

OpenGL ES Frame Skipping causing visible artifacts

I'm using OpenGL ES 3.0 on Android 5.1, and am noticing the following issues. I tried to implement the game loop which does exactly 60 updates and do as many frames as it can. Everything is smooth, ...
1
vote
1answer
55 views

OpenGL fix objects to camera

I'm developing some game in order to learn OpenGL. I can make an object follow me around when I move forward, backward, left, right, up or down, by setting it's position right infront of the camera. ...
3
votes
1answer
99 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
37 views

Optimizing black and white matrix block drawing

Disclaimer: I am uncertain if this is the best place to post this question, so please advise me of how I can best find the answer if I am doing something wrong. I am asking this question because I am ...
1
vote
1answer
23 views

Texture Wrapping isn't getting applied to my object

I have a Drawable Class, a Cube Class, and a Texture class. I feel like the texture wrapping isn't being applied due to some values being passed by reference, or just being discarded. My cube just ...
1
vote
1answer
28 views

How to map control key to a specific angle or orientation?

At the moment, I basically have built out a large hash table of various angles and what direction they map to, if the user would press right, up, down, left. This is needed, in my case, as I have a ...
2
votes
1answer
3k views

Create a fly camera with lookAt

I want to create a free cam with the lookAt matrix in OpenGL. I just made the control with W, A, S and D so you can move around. But now I nee to look around. I thought doing that with sine and cosine ...
3
votes
1answer
36 views

Tiled deferred shading without compute shader

I'm building a deferred renderer and since I want to support a large amount of lights in the scene I've had a look at tiled deferred shading. The problem is that I have to target OpenGL 3.3 hardware ...
2
votes
1answer
100 views

C++ SDL OpenGL minimise / restore window issue

I'm partway through developing a 2D game in C++ using SDL and OpenGL; my IDE of choice is CodeBlocks. I've hit an issue that I can't seem to get around. Basically, if I minimise and then restore the ...
0
votes
1answer
63 views

drawing of heightmap gives weird single pixels

I'm working on a game where I want to generate a heightmap, however it draws a bunch of random white dots in a mostly black background, the function I have looks as following: void heightmap::layer1(...
-1
votes
1answer
66 views

The best way to handle the actual render loop

I've been diving into OpenGL. So far, so good, and quite a few features implemented and objects look good. Now I want to move on to more complicated scene with many objects. First off I am NOT asking ...
0
votes
1answer
35 views

How to keep text on top of openGL in a perspective projection

I have a game that has a score, I found out how to render text in a ortho projection but I can find a way to mix the two, or have text stay in the same position on the screen at the same time as ...
3
votes
1answer
19 views

Why I get inconsistent occlusion query results?

My system: Catalyst 15.12, mesa 11.2.1, Archlinux, kernel 4.5.1 Depending on camera position I get inconsistent occlusion query results. Following scene contains wall, objects behind wall and ...
1
vote
1answer
26 views

LWJGL version problems

Is it possible to create VAO's while my computer doesn't support openGL 3.0 or higher? I managed to create a vertex buffer object and draw a rectangle. But then I changed my lwjgl libraries to the ...
3
votes
1answer
106 views

Is it sensible to make all physics on GPU using transform feedback?

I'm learning OpenGL and today I read something new to me. It's called transform feedback, and if I understand right, it can help to get information about vertex shader variables. And I read an example ...
2
votes
1answer
55 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
19 views

LibGDX: Shader files in assets - Access is Denied

I stored the glsl files in android -> assets -> shaders directory, but when I run the app, an error is displayed: Error:Gradle: Execution failed for task ':android:mergeDebugAssets'. Error: ...
1
vote
1answer
425 views

SDL2, OpenGL, Nvidia laptop screen tearing

EDIT 2016-03-06. Note 1: Apparently this is a known issue with Nvidia. If you've found here due to same problem, please stoke the collective "please fix it" by filing a "question" at https://nvidia....
1
vote
0answers
29 views

Limit/Clamp camera movement using quaternions

I'm making a camera object for rendering with OpenGL. However, instead of using the typical "LookAt" method I'm trying to use just a Quaternion for orientation and a Vector3 for position. Instead of ...
1
vote
1answer
77 views

Sprite Sheet Texture not being rendered

I'm making space invaders (in OpenGL/SDL) and I've run into a problem when trying to draw the sprite for the spaceship from the spritesheet. In my entity class, I have a pointer for the sprite that ...
4
votes
1answer
311 views

deferred tiled lighting

EDIT I have discovered that it does not seem to be the lighting calculation but the culling code because when i draw the lights without the culling it works perfectly. I have been attempting to ...
0
votes
0answers
50 views

A few questions about Order Independent Transparency

I've been looking through several different Order Independent Transparency algorithms. But very few of them seem to answer a few things. I understand that the idea of OIT is to not worry so much ...
7
votes
1answer
233 views

Depth Peeling implementation problem: How to render the next layer? (OpenGL)

I try to implement order-independet transparency sticking to the pseudo code in the linked paper (page 4). I can't figure out how they are able to do this in OpenGL. I am rendering the scene two ...
1
vote
1answer
65 views

glViewport and single-pass cubemap rendering

This question is related to another question of mine on StackOverflow. The problem I'm facing is that while I'm rendering to a cubemap in a single pass using a geometry shader (like I show in my ...
0
votes
0answers
25 views

OpenGL Uniforms Crash When Run - Why?

Why does it not render the input vertex when I make UF variable? The program works totally fine if I don't update the uniform and keep it as a constant. #version 330 layout (location = 0) in vec3 ...
0
votes
2answers
780 views

translate-scroll repeated 2d texture using opengl shader

I managed to implement an infinite 2d texture scrolling using the following shader. btw I'm using cocos2d-x 2.2.1. The vertex shader: attribute vec4 a_position; attribute vec2 a_texCoord; #ifdef ...