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
0answers
12 views

OpenGL - Lag while moving on a heightmap generated terrain (not smooth)

Hello everyone I'm developing a OpenGL game using c++ and GLFW + GLEW libraries. I've generated a terrain from a Heightmap and now I'm trying to move on it calculating the height of the camera (y ...
0
votes
0answers
24 views

How do I implement a LWJGL orthogonal matrix?

As seen on the official LWJGL page, I tried. But failed. All the things I've found on SO and other sites didn't answer anything that had to do with this specifically. I've been on this for weeks. It's ...
0
votes
1answer
34 views

OpenGL GLSL vector of sampler2D

If im trying to create an obj. file loader in c++ and draw it with opengl i need to use multiple textures in the fragment shader.I know i can just use: `uniform sampler2D Texture1` `uniform ...
0
votes
0answers
7 views

How to copy texture of type GL_TEXTURE_EXTERNAL_OES to a texture of type GL_TEXTURE_2D

How to copy texture of type GL_TEXTURE_EXTERNAL_OES to a texture of type GL_TEXTURE_2D ? How to find the internal format of texture ?
1
vote
0answers
22 views

Best way to find line segment intersection

I am working with an OpenGL ES 2.0 shader and need to find the point of intersection between two line segments in 2D space. I receive them in terms of both coordinates of both lines. Because they are ...
0
votes
1answer
42 views

How do I calculate a vertex's position on the CPU?

I'm creating light processor and I need light position and vertex position after translating, rotating and scaling (to calculate distance between them to check if light is affecting my vertex ...
0
votes
1answer
52 views

C++ & OpenGL - Bad orthographic projection matrix?

So I'm trying to render 2D text in my Game Engine using programmable pipeline. Normally I'm using perspective projection matrix but for UI elements I'm trying to create orthographic projection matrix ...
0
votes
1answer
25 views

libGDX ShapeRender flicker when translated

I have recently started working with libGDX and have encountered a strange bug. When shapes rendered by a ShapeRenderer they appear to flicker/strobe while being translated. My code looks something ...
1
vote
1answer
19 views

Should I add error handling to SDL_GL_SetAttribute?

As the title says, I wonder if I should handle errors for : SDL_GL_SetAttribute Can it actually fail to set? And if it can, what could be a reason for it to fail?
0
votes
0answers
21 views

OpenGL Arc-Ball Camera Yaw Pitch GLM::Rotate

I'm currently working on a small Voxel-Editor Project. In the editor, I plan on using an Arc-Ball camera which rotate around the model. My camera is currently working but in an odd way. I can't seem ...
0
votes
3answers
77 views

OpenGL Colour Issues

I am using a single VBO to store vertices in the follow format: v1X, v1Y, v1Z, v1R, v1G, v1B, v2A, v2X, ... Vertex positioning is fine, shapes show up where expected, however instead of using the ...
0
votes
1answer
74 views

Modern OpenGL c++ obj loader

So i made a obj loader in c++.I used blender to export my files. I tried to draw 2 squares(one perpendicular to the other) and when im looking at them from above some weird black triangles apear, ...
-1
votes
2answers
27 views

Using VBO in Opengl. powered with c# TAOFramwork

I'm doing a 3D display for a big object. I've managed to display it with opengl primitives, so it's (very) slow Now i want to use the VBO optimization. But when i lost the focus on the opengl window ...
0
votes
1answer
61 views

Obj file loader in c++ from blender [on hold]

So i want to export files from blender which have: triangles,normals,texcoords and materials.and use modern opengl and c++ to create a obj file loader.I also use sfml. I have a shader loader class ...
4
votes
0answers
49 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 ...
0
votes
1answer
47 views

C++ OpenGL More textured objects equals less FPS

So I'm creating a game engine with many features, last time I focused on textures. When I finished implementing some new code (Made by myself) I created new Entity with texture, and it was working ...
0
votes
0answers
67 views

Modern OpenGL and SpriteBatching

I tried to find tutorials regarding SpriteBatch done in Modern OpenGL 3.0+, but failed to find any good resources so far. So can anybody please provide me a good resource/tutorial to achieve ...
-3
votes
2answers
133 views

How do you define and draw rectangles in OpenGL?

I am very new to OpenGL and I am not sure one the basis of how to create and draw objects. So how would I draw simple rectangles in a window using OpenGL? My understanding is that I need to define an ...
0
votes
0answers
22 views

Disable OpenGL NVidia Driver Optimization During Development

I've noticed while looking at gDebugger that sometimes what I dispatch as draw calls never actually show up in the logger. I assume that there is some driver level optimization going on here; so is ...
0
votes
0answers
30 views

Assimp setup in C++ CodeBlocks MingW compilator g++ [closed]

Im trying to learn game development.In the past i used old c++,opengl,and blender to create an obj file loader for my projects.Now i saw that this library Assimp is much better.But i have no idea how ...
0
votes
1answer
81 views

Modern OpenGL project in c++ .obj loader

I want to create a class in c++ that loads a model with the obj format.The model gets generated from Blender(3D modeling program).When i try do draw something on the screen without the class(all the ...
-1
votes
0answers
48 views

Modern OpenGL class in c++ for loading model [duplicate]

I want to create a class in c++ that loads a model with the obj format.The model gets generated from Blender(3D modeling program).When i try do draw something on the screen without the class(all the ...
0
votes
0answers
38 views

A 2D card game using OpenGL

I am creating a 2d card game. I have written the low-level functions, game logic, game algorithms in C++. I now have to create a graphics layer that the player can interact with. This just has to be ...
-1
votes
0answers
22 views

How to rotate Vector3 in OpenTK?

I'm completely new in OpenGL and OpenTK world so I want to ask the noob question. I'm working on a 3D application in visual basic and I want to rotate the camera around the "0,0,0" position without ...
0
votes
0answers
29 views

Issue with Use SSBO OpenGL

Students that use OpenGL. Do not speak English well. So please understand. There is currently a problem C++ Code Setup() : glGenBuffers(1, &ssboHandle); GLuint ssbo_binding_point_index = 0; ...
5
votes
2answers
225 views

How to render water reflections on multiple heights

I'm making a voxel game on OpenGL, and are trying to find a way to render semi-realistic water (At least partially good looking, it doesn't need to be strictly scientific accurate). All sources ...
1
vote
0answers
37 views

Cell height with heightmap for collision detection

Hello everyone I'm programming a game with c++ and openGL. My world is generated from a heightmap (100x100 matrix with values 0-255) and now I need a function that returns the actual height based on ...
0
votes
0answers
47 views

Wrong Normal When Models is Close to Each Other

I have a problem regarding my Normal FrameBuffer that creates gaps between models. The image below contains 10x2x10 block (Minecraft style) and one character. The image is outputed through: ...
1
vote
1answer
70 views

How to combine depth and stencil tests?

I have a continuous height-mapped mesh to represent landscape. I use the stencil test to create holes in the mesh. I draw holes to the stencil buffer and then use it to discard mesh fragments. ...
4
votes
1answer
87 views

SSAO issue - surfaces darken based on camera angle

I have a strange issue in my engine where my SSAO effect will extremely darken or lighten based on my camera angle: In that example, I'm just outputting the ssao texture to the screen. The texture ...
0
votes
1answer
79 views

How could we use trigonometry for moving around a 3D World?

Well I have a question about geometry and 3-Dimensional player movement in general. I'm using Java, OpenGL and LWJGL. This is basically what I got: currentFrontSpeed: Is a float that contains the ...
1
vote
1answer
102 views

Implementing Shadow Mapping in Python and OpenGL 2.1

I am trying to create a little shadow mapping demo. My code is currently divided into three rendering passes: Pass 1 - Create the depth texture that will be used for shadow mapping on an offscreen ...
3
votes
0answers
59 views

How do I align the cube in which shadows are computed with the view frustrum? (“View Space aligned frustum”)

Short and concise: Given 8 world space positions that form a cube of arbitrary size, position and orientation and given an arbitrary light direction. How do I compute the View and Projection matrix ...
0
votes
0answers
19 views

Failed to understand how to use glm::unProject (OpenGL 4.3)

Situation: I use OpenGL 4.3, FreeGLUT 3.0, and GLM library. Let say i have a simple 2D object (a ball) and it moves accordingly to the simple equations: x = x_0 + v_0 * t * cosf(alpha); y = y_0 + ...
0
votes
1answer
64 views

Image rendering with additional space around it

When I try to display an image that is 400 pixels wide and 800 pixels high, it is not displayed this way. Instead it is diplayed like this: Instead it is displayed like this You can see at the bottom ...
0
votes
0answers
37 views

How to dynamically draw a filled polygon with a given array of vertices?

Say I have a simple array of vertices (or floats with every odd index being the X of a vertex and every even being the Y), how could I paint all the area between the vertices? As in, I have maybe ...
1
vote
1answer
40 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 ...
0
votes
1answer
43 views

Fragment shader, tint color problem

I am new to shaders, and I am trying to tint a texture to mark status of a enemy. I am implementing shaders on OpenGL ES 2.0 (Mobile) The problem is that with this shaders, I see the enemy without ...
0
votes
1answer
61 views

Aspect ratio of drawn quad messed up after rotating

When I draw a quad that is rotating the aspect ratio of the quad gets messed up and the size changes. Gif of what is happening I am confident it has something to do with the way I calculate the size ...
-1
votes
0answers
17 views

Rendering text using STL in LWJGL 3

I'm working on one project and I want to render text in the window. I'm using LWJGL 3 and I found that rendering text should be done using bindings to STL. However I found these examples: ...
-1
votes
1answer
24 views

OpenGL/GLSL matrix in uniform block confusion

I'm a bit confused about the proper way to send a matrix from my code (C++) into a GLSL shader. My matrix object is stored in row major format in memory. If I use the following shader code it works ...
0
votes
0answers
25 views

Drawing Ray from ray picking is not working correctly

I have been implementing ray picking to select squares in my opengl program. I tried to follow this post I found http://gamedev.stackexchange.com/questions/109579/algorithm-for-triangle-picking after ...
-2
votes
2answers
109 views

C++ Multi-Platform (Windows, Linux, Android) OpenGL(ES) Solutions or Tutorials? [closed]

I'm sorry if this has been asked recently and I'm not Googling it right, but I've been digging all week for something. I've got a game prototype I made in Unity, and I have some decent experience ...
4
votes
1answer
76 views

Should texture regions sizes be power of two?

Is it advisable for my individual texture regions inside this texture to be power of two, or that won't make any difference? I've read on several places that it's recommended to use power of two ...
1
vote
1answer
48 views

How can I fade in 3D foliage smoothly?

Take a look at this picture: This is a picture of me diving down from a high height. As you can see, the world is a simple world with grass, snow, trees, etc. The problem here is the 3D foliage. If ...
1
vote
1answer
54 views

Heightmap terrain picking

I've implemented an OpenGL based terrain unsing a tesselation-shader for dividing each 'terrain-cell' into the desired tiles. The heightmap is uploaded to the GPU and applied on the shader. When it ...
1
vote
1answer
41 views

C++ Opengl transforming a glm::vec4 with a glm::mat4

Its easy enough doing it on the gpu via GLSL, but how would I do this in c++? When I try it gives me an error telling me I cant cast a glm::mat4 to float, Which makes sense, but how should I do it? ...
0
votes
0answers
42 views

What is the best way to group lots of squares into one VBO?

I'm making my first game in OpenGL, using procedural generation, and it is a similar concept to Terraria. At the moment, I have one, very small VBO for a square ('block') and an EBO for its vertices. ...
-1
votes
1answer
119 views

Will Vulkan Kill the use of GLSL? [closed]

After reading this link I am still unclear as to the shading language support in Vulkan. Is GLSL being phased out? If someone were just starting and wanting to master shading languages and computer ...
0
votes
1answer
21 views

OpenGL color overlay

I want to create a pause menu where everything in the background gets darker. I've looked up a bunch of possible solutions (even the second page on google) but it doesn't seem to work. I do already ...