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

2
votes
1answer
68 views

Cannot connecting texture to heightmap using mapped uniform location

In my shader program, I have my attributes and uniforms added to a map for each. What I have displayed is a heightmap, but cant seem to connect the graphic texture to display. mUniformList (std::...
2
votes
1answer
601 views

OpenGL Tessellation makes point

A little problem with my tessellation shader. I try to implement a simple tessellation shader but it only makes points. Here's my vertex shader : out vec4 ecPosition; out vec3 ecNormal; void ...
2
votes
1answer
323 views

Trying to implement Camera

I'm trying to implement a Camera class in order to walk and look on the world as follow: #ifndef _CAMERA_H_ #define _CAMERA_H_ #include <glm\glm.hpp> class Camera { public: Camera(); ~...
1
vote
2answers
241 views

Fragment shader compiling in webGL but not in OpenGL

I am programming in Haxe (language compiling to multiple platforms) and I have written some shaders. My fragment shader runs fine in html5, but when I try to compile for native (OS X and/or Neko, a ...
4
votes
1answer
97 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 ...
0
votes
1answer
49 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 ... ...
1
vote
1answer
37 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
0answers
91 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 ...
5
votes
1answer
440 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
105 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 ...
2
votes
1answer
79 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 ...
0
votes
0answers
58 views

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

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 ...
1
vote
1answer
66 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 ...
3
votes
1answer
128 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. ...
2
votes
1answer
76 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 ...
0
votes
1answer
150 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 ...
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
2answers
137 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 ...
3
votes
1answer
48 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 ...
2
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()....
5
votes
1answer
116 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 ...
0
votes
1answer
132 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 ...
1
vote
0answers
52 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-...
3
votes
1answer
58 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
2answers
29 views

Should I use one GLSurfaceView.Renderer for each part of my game?

I am creating a small platformer-like game for Android using OpenGL. The game has 3 main screens/states: Main menu screen Level selection screen The game screen Currently I use a GLSurfaceView....
2
votes
0answers
46 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
17 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 ...
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
votes
2answers
98 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++...
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 ...
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(...
1
vote
1answer
77 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 ...
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 ...
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
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: ...
0
votes
1answer
69 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 ...
0
votes
2answers
56 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
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 ...
1
vote
1answer
58 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. ...
4
votes
1answer
276 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 ...
-1
votes
1answer
183 views

Java - LWJGL OBJ Loader with Materials not rendering

So I successfully loading my obj file but I obviously want to get materials on it. I added the vt(texture) to the OBJLoader and the Model.render but still rendering textureless. I have exported the ...
0
votes
1answer
47 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 ...
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 ...
0
votes
1answer
65 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 ...
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? ...