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

Why does my framebuffer not work when rendering to texture?

I am having trouble rendering to a texture and then mapping that texture to a quad. I am using OpenGL 2.0. I am using code from the wiki. The class scene_t has a texture called _out_tex, which is the ...
0
votes
0answers
41 views

I create a 3D character in Blender and animated it. How do I use it in Java LWJGL?

I have a character and he is animated with the Skeleton or Bone Structure but I don't know how to animate him in my game by scratch. I am using Java because it's what I learned at school and I am ...
0
votes
0answers
27 views

Linear color workflow with render to texture - Banding in alpha channel?

In OpenGL, I am using GL_SRGB8_ALPHA8 for the internal texture format for my render targets. This eliminated some banding I was seeing in dark opaque areas. However, in the following screenshot, you ...
1
vote
2answers
93 views

Why is there no glClear() and glClearColor() method in GL30?

In the GL30 interface, both the methods glClear() and glClearColor() are absent. I tried to call the method Gdx.gl30.glClear(GL30.GL_COLOR_BUFFER_BIT) inside render() but it threw me a null pointer ...
2
votes
1answer
54 views

Elements of uniform array are always zero?

I'm building a shader program to render a simple bitmap font in GLSL. My programming environment is C# so I'm using OpenTK to encapsulate OpenGL 4.0, but the syntax is very similar to any examples in ...
3
votes
1answer
45 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
153 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) ...
2
votes
1answer
59 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
38 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
63 views

create opengl rendering engine [closed]

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
2answers
51 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
80 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 ...
5
votes
1answer
56 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*)...
2
votes
3answers
94 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/......
3
votes
1answer
38 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
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
56 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
38 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 ...
3
votes
1answer
156 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)...
5
votes
3answers
154 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 ...
-1
votes
1answer
69 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
39 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
20 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 ...
3
votes
1answer
108 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 ...
1
vote
1answer
29 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 ...
3
votes
0answers
23 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
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 ...
4
votes
1answer
55 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 ...
0
votes
0answers
51 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 ...
0
votes
0answers
26 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 ...
2
votes
1answer
102 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
48 views

OpenGL vbo black screen

I am using sfml with opengl and using glew Here is my code: // MainWindow.cpp // window is declared outside in the class it is a sf::Window #include "MainWindow.h" #include <iostream> //#...
0
votes
1answer
48 views

Can I set the origin of the texture to its center in OpenGL?

I want "texture2D(texture, vec2(0,0))" to fetch the pixel at the center of the texture and "texture2D(texture, vec2(-1,-1))" to fetch a pixel from the corner of the texture. I don't want to calculate ...
0
votes
1answer
26 views

Possible to detect handedness of normal maps in shader?

I've implemented normal maps into my game renderer using the formulas by Christian Schuler. It works OK with most normal maps but some not so much since in some the Y component (green) is reversed. ...
1
vote
1answer
62 views

manipulating camera with mouse

I am writing a OpenGL game engine and also an editor for the engine. In my editor, i can import 3d models from fbx/collada as a scenegraph. Now i want to implement the option for the user to rotate ...
1
vote
0answers
89 views

How can I build a C++11 vertex attribute class?

How would you build a flexible and efficient vertex attribute class in C++11? What I have: Vertex attribute roles for using them in shaders: enum AttributeRole { VERTEX0, TEXCOORD0, ... ...
6
votes
1answer
91 views

OpenGL 3.3 Core Compatibility with OpenGL 4.x

Are all OpenGL calls in 3.3 Core and GLSL 330 core shaders valid and functionally equivalent in OpenGL 4.0 through 4.5 core? I can't seem to find a clear and definitive answer; both in specification ...
3
votes
0answers
69 views

Geometry Shader crashing

I keep getting some strange errors in my Geometry shader and when I search for the cause of the errors, it returns nothing substantial. Here is the code. Shader #version 450 core layout(triangles) ...
0
votes
0answers
25 views

Opengl setup and work with geometry shaders

I'm trying to implement instance culling using geometry-shaders () but I don't know, how I use them. I only used fragments and vertex-shades before.. Can someone say me, how I set them up, how I work ...
0
votes
1answer
29 views

How to draw Alpha Masked fragments' depth to depth buffer?

I feel like an absolute idiot for asking this. But how exactly do safely draw the depth of a fragment featuring a Masked ( Alpha 1) texture on it's surface? So far I've literally been doing a depth ...
0
votes
1answer
34 views

UE4 - openGL context

Is there a way to get an openGL context to do my drawings in UE4? I'd like to use some shaders before the loading of a scene (kind of an intro thingy), but I couldn't find anything related to get an ...
0
votes
0answers
17 views

OpenGL: Does it make sense to use an Index Buffer With GL_TRIANGLE_FAN?

When trying to draw circles in webGl (You can answer the question even in openGl terms, I'll understand both), I came across the TRIANGLE_FAN flag when calling either glDrawArrays (with only a vertex ...
1
vote
1answer
58 views

OpenGL nothing being drawn to screen

I am following the book 'OpenGL SuperBible' and am trying to run one of the first examples of drawing a point to the screen, bit instead of using there lib, im using GLFW. I'm not sure where I am ...
0
votes
0answers
35 views

How to create a rectangular grid of triangles in openGL

I'm using OpenGL, GLFW and GLEW to create a simulation of water waves for a school project. I'm using a textured grid and will manipulate said grid in the vertex shader. I tried to create the grid by ...
10
votes
1answer
183 views

Draw the middle half of a sphere programmatically

I'm trying to create the middle half of a sphere. Basically to create a sphere, stack numbers and slice numbers are given, and there are two variables phi (for slices) and theta (for stacks) ...
1
vote
0answers
34 views

How to Handle Game Textures [closed]

For my game I have decided to create my own hand-painted/stylized textures, and was curious about how my game would theoretically perform later down the road. Essentially, my game world is comprised ...
3
votes
0answers
46 views

Rotation of a ball moving on a surface

I have a ball that moves along a platform. The ball is characterized as a sphere that has a radius and a position. The platform basically is a rectangle consisting of two vertex triangles. Its class ...
2
votes
1answer
28 views

glUniformMatrix4fv OpenTK equivalent

Very simple and quick question which surprisingly I couldn't find an answer to over the internet: what is the equivalent of glUniformMatrixfv for opentk? I've browsed all the 7 overloads of GL....
5
votes
1answer
66 views

Check if thread has OpenGL context

I'm looking for a way to check if a thread accessing a namespace function has a OpenGL context attached to it. I have looked around and all I can find is, GLFWwindow* glfwGetCurrentContext(); Which ...
1
vote
0answers
31 views

IBL probe BRDF pre-integration artifacts

I'm following 'Moving Frostbite to PBR course notes' to implement IBL in my rendering engine in OpenGL but I'm having some trouble pre-integrating the specular component of the equation. As you'll ...