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
0answers
29 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
24 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....
2
votes
1answer
37 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
8 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 ...
-1
votes
1answer
24 views

How to render more than one object in OpenGL or DirectX 11/12

https://www.youtube.com/watch?v=1ogg4ZfdBqU I am new to OpenGL, but I have similar objective as you can see in the video. Can we have one shader for all objects? Is there any sample in OpenGL? Any ...
0
votes
2answers
32 views

Irrlicht engine game wont compile on linux. Undefined refrences(opengl and xfree)

I'm trying to port over my game I'm developing to Linux. But when i compile i get a lot of undefined references to mostly functions that look like they belong to OpenGL. Most are titled gl... But one ...
5
votes
0answers
38 views

Would it be possible for non-Apple OpenGL macOS drivers to exist? [migrated]

I see many opinions about Apple's support (lack) of OpenGL. The current supported version under OSX 10.11 being at OpenGL 4.1, released 5-6 years ago. Why are there no third-party drivers for OpenGL ...
0
votes
0answers
67 views

What is the most efficient way to render in OpenGL [closed]

Currently, I have just started making a 3D game engine in OpenGL. before I start doing anything else, I want to have a powerful renderer. Currently i have: ~ A VAO/VBO/IBO System ~ Vertex and ...
2
votes
1answer
79 views

When should a VBO be unbind or not?

Searching about VAOs and VBOs I read here and here that I can optionally unbind them to avoid accidental modification so I gave it a try. The problem is that unbinding the VBO causes an access ...
2
votes
0answers
104 views

How to “hot-reload” a glsl shader

I am wondering if its possible to dynamically change shaders while the code is running. In my game, I want to have a development mode in which users can change the shader source and dynamically see ...
2
votes
0answers
22 views

OpenGL cubemap binding

I'm experimenting a strange behaviour of textures inside my shaders. Basically I need and bind two cubemap textures inside my shader but only one gets actually bound. I've tried swapping the two ...
3
votes
1answer
145 views

Trying to implement forward rendering in OpenGL

I'm working on implementing forward rendering in my 2D engine, as far as I'm aware everything should be set up correctly, I've ran into some issues earlier but I'm sure I've fixed those at this point. ...
3
votes
1answer
49 views

OpenGL cube map is always black

When creating and rendering a skybox with a cube map texture, the skybox is black. Here is how I create the cube map texture: GLuint loadCubemap(std::vector<std::string> faces) { GLuint ...
1
vote
1answer
76 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
0answers
56 views

Implement gpu based dynamic geometry lod with openGL

I'm currently working on my own game and for that I wanted to implement LOD, to boost the performance. I found a very nice tutorial on the internet: http://rastergrid.com/blog/2010/10/gpu-based-...
6
votes
1answer
122 views

How to find out at runtime if Vulkan and/or OpenGL support is available?

I'm building an engine, which has Vulkan for its primary rendering engine. But to have at least some backwards compatibility with devices that don't get drivers for (Mainly mobile) it I want to ...
3
votes
1answer
61 views

OpenglGL Render two scenes with one draw call

I need to draw a normal-vector scene and default scene. I could achieve this my having two programs with different fragment shader to produce the following images. It will require me to draw ...
1
vote
1answer
38 views

How to “port” Java2D code to LWJGL

I've been following some game tutorials on youtube and developed a custom engine using Java (Graphics2D, BufferStrategy and such). I have a class "Surface", which represents any 2D object (image, ...
1
vote
1answer
51 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
83 views

OpenGL 2D instancing: glDrawArraysInstanced with a divisor renders nothing

I've been learning OpenGL for the past week, following tutorials here and there. I was looking to create a SpriteBatch-type of solution for 2D rendering, and for it I thought of utilizing instanced ...
2
votes
0answers
47 views

What happens to Buffer data that isn't used?

I have a vertex struct that has 5 glm::vec3 but some of my objects only use 2 or 3 of those members. So I have two questions : 1.) What happens to the large buffer I create, even though I don't use ...
0
votes
0answers
19 views

2D Camera in LWJGL 3

I am trying to implement a simple 2D camera in LWJGL3. The camera has an orthographic projection and can move in 2D space. This is run once at game start-up: GL11.glMatrixMode(GL11.GL_PROJECTION)...
1
vote
0answers
18 views

Specular Light not working (Phong Lighting)

There seems to be a problem with my current Phong Shading implementation. I have been using the per fragment approach. The specular highlight aspect of the technique is not rendering as it should, as ...
-1
votes
2answers
105 views

What is the most efficient way to render water?

Would I create the water surface mesh in C++, and control the movement/animation in the CPU, and afterward apply any shaders (reflect/refraction/caustics/etc..). Or should I only create the mesh in C++...
0
votes
1answer
17 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 ...
0
votes
1answer
43 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(...
0
votes
1answer
31 views

Texture Wrapping isn't being applied properly

I've debugged my application with codeXL and can verify that my texture is getting these attributes applied: GL_TEXTURE_MIN_FILTER: GL_LINEAR GL_TEXTURE_MAG_FILTER: GL_LINEAR GL_TEXTURE_WRAP_S: ...
1
vote
2answers
57 views

Why is my depth buffer texture so bright?

https://www.youtube.com/watch?v=QuvAEqgHrMY&feature=youtu.be https://www.youtube.com/watch?v=5ob1JsPIGAs&feature=youtu.be gluPerspective(60, (float)CONTEXT_WIDTH / CONTEXT_HEIGHT, 0.1f, 1.f);...
1
vote
1answer
18 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
60 views

Full Engine or Not: C++ Programmer Trying to get into Game Development [closed]

I'm a fairly experienced programmer, and I want to try out doing some game development. However, I am unsure of whether or not to use a full engine like Unity or just start with something like OpenGL. ...
1
vote
1answer
23 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 ...
0
votes
1answer
71 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 ...
1
vote
0answers
107 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
0answers
98 views

Texture Mapping to procedurally generated geometry

How can I calculate texture coordinates of such geometry? The angle shown in the image (89.90 degree) may vary, therefore the geometry figure is changing and is not always such uniform.(maybe like ...
1
vote
1answer
51 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 ...
1
vote
3answers
84 views

Process of writing to the depth texture

In openGL, let's say I output one single point from the vertex shader with this value gl_Position = vec4(2.0,3.0,5.0,7.0); what exact math operations happen to "z" after leaving the vertex shader? ...
3
votes
0answers
54 views

I get weird perspective using GLM where the depth is flipped. Please help

The depth is rendered wrong and I can't figure out why. using namespace std; using namespace glm; int width = 640; int height = 480; float aspect = (float)width/height; int fps = 60; void start(){ ...
0
votes
0answers
29 views

Position camera in opengl

I have a camera with a 3D vector that represent the position and a quaternion that represent the camera orientation. I'm trying to rotate and orientate the camera correctly, but I can't. I know that ...
6
votes
1answer
176 views

OpenGL flat shading of non-planar polygons using TBOs

I'm trying to implement flat shading for non-planar polygons (using a single normal vector per polygon) based on buffer textures, but I can't seem to figure out how to set up things correctly. The ...
0
votes
1answer
41 views

Making a button that spawn objects in the world? [closed]

I want to make a button that can spawn an object that I've already created. Though I have no clue how to actually do this / where to start. Has anyone ever done something similar?
0
votes
1answer
43 views

Some OpenGL code not working, but some is

I'm just starting out using GLEW and GLFW in a C++ project for my rendering code, but I'm having trouble actually getting anything to render. I know OpenGL is working in some capacity, because I am ...
1
vote
0answers
44 views

How to create a second Window in OpenGL/GLFW

I would like to have 2 windows. 1 for display purposes and one for settings / buttons (for example to change the color of the background in my main display). How would I go about having a second ...
0
votes
3answers
73 views

I have my mouse coords converted to world coords. Now how do I detect objects with it? (C++, OpenGL, FreeGlut)

I found a way to convert my mouse coordinates to world coordinates that I can easily understand but now I need to know how to use it to check if the mouse is currently over any of my rendered objects. ...
0
votes
0answers
22 views

OpenGL ES vertex/fragment shaders - Blinn phong

I'm developing a simple educational project to study OpenGL ES. I'm try to render some simple OBJ models using Blinn-Phong. The first version of the of my implementation calculate all the lighting ...
1
vote
2answers
40 views

glViewport offset and ortho projection

In all tutorials I found about creating projection matrix based on viewport size all of them assumed that left bottom coordinates of viewport will be (0,0). Now I want to draw to the different parts ...
1
vote
0answers
77 views

Rendering thousands of circles in pyopengl

I am interested in rendering animated 2D vector graphics in python using PyOpenGL. As an initial test, I am trying to render thousands of pixel-perfect circles drawn using shaders. Here is the current ...
0
votes
1answer
58 views

Lighting in Minecraft/Block-esque worlds [duplicate]

Chaps, I'm sure we all know at a high level how Minecraft's lighting engine works. Light sources flood surrounding blocks with light, which themselves flood their neighbors and so forth. However, I ...
4
votes
1answer
99 views

Creating a custom mouse cursor with LWJGL2 in Java

I have been trying to create a custom mouse cursor in my LWJGL2 application running under Linux and I am almost there. I have implemented the following method that I call right after creating the game ...
1
vote
1answer
35 views

Handling light bounding volume

So, i managed to do deferred shading like yesterday or 2 days ago. I got pretty big impact which causes my fps to drop from 1000fps to around 300~fps for 25 lights (after some optimization, i don't ...
1
vote
1answer
43 views

How to enable depth test with QOpenGLWidget? It renders black screen

Currently I am writing a small application with Qt and OpenGl and I choosed QOpenGLWidget for rendering graphics. That's how I declared my widget: class GLWidget : public QOpenGLWidget, protected ...