Questions tagged [opengl]

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 applications like CAD software and computer games. It is also cross-platform. The OpenGL standard is controlled by the Khronos group, which also controls OpenGL ES.

Filter by
Sorted by
Tagged with
1
vote
2answers
1k views

What is the difference between OpenGL, SDL, DirectX, GLFW, GLUE?

I have not work with graphics yet but I'd like to know its concepts at some high level overview. I was told that OpenGL and DirectX are somehow programmed into my graphics card, and I can use GLFW, ...
-1
votes
1answer
24 views

How can I add one OPENGL page to another when ENTER key is pressed?

I created one GLUT project which has my project's introduction page. When I pressed ENTER key, it should redirect to my front page of project which I created as another project.
4
votes
2answers
1k views

OpenGL GLSL using projection,view and transformation

I have been trying to get a simple triangle to render on the screen. I am using Projection, View and Transformation matrices but am unable to get anything to the screen. Main loop ...
0
votes
1answer
448 views

Synchronizing with monitor refreshes without vsync

What is the preferred way of synchronizing with monitor refreshes, when vsync is not an option? We enable vsync, however, some users disable it in driver settings, and those override app preferences. ...
0
votes
1answer
182 views

Replacement for glDrawElementsBaseVertex in OpenGL ES?

I am porting my game engine(c++) to Emscripten, which unfortunately only supports OpenGL ES 3.(Not 3.2) Therefore I don't have access to glDrawElementsBaseVertex, which is needed by my renderer(...
1
vote
1answer
188 views

OpenGL texture2d/image sampling issue. Strange artifacts in texture

I have an issue when using textures in OpenGL, strange artifacts occur where geometry overlaps, but not always. Video Reference. I am using a GL_TEXTURE_2D with <...
0
votes
2answers
50 views

How to process events as well as do OpenGL rendering using multithreading?

I am working on a very complicated graphics rendering, using OpenGL, and it is very time consuming, in the sense that it creates a delay in the event handling, of my application to an extend that, the ...
0
votes
1answer
176 views

opengl bump mapping (normal mapping) problem with VBO and GLSL

hi i am beginner i am trying to implement bump mapping with vbo and glsl. My question is: did i make bump mapping ? if i did why these edges didnt disappear ? high and low meshes (i used low meshes ...
0
votes
1answer
113 views

Can we flip znear and zfar so that positive z values increase away from the viewer?

I am confused about the projection matrix in OpenGL. i have a habit of writing the code as follows. ...
6
votes
3answers
7k views

What is the best and simplest way to get input text from user in an OpenGL app?

I have an OpenGL game and and I want to implement a simple way for the user to enter data/text in an input box. What is the easiest method to do this?
0
votes
0answers
34 views

What does glBlendFunc(GL_DST_COLOR, GL_ZERO); mean?

I need to write a description about a filter method I made but I don't know what glBlendFunc(GL_DST_COLOR, GL_ZERO); means.
1
vote
1answer
1k views

Depth texture white in shader

I am trying to implement shadow mapping into my project and am stuck at this problem: If I'm reading the shadow map values with glReadPixels and linearize those ...
4
votes
1answer
2k views

SDL2, OpenGL, Nvidia laptop screen tearing

EDIT 2017-05-14 dvb. Issue still active to this very day, see geforce forum link in main question. Note 3: "Stoltverd" has posted a "fix guide" on geforce forum. It has workarounds for non-OpenGL ...
2
votes
1answer
1k views

Converting Euler rotation angles from Z up to Y up (Max to OpenGL)

I'm working on pulling geometry and it's transformation from a 3DS Max exported FBX (Z-up) to an OpenGL model format (Y-up). The main problem is I intend to keep the transformations as Translation and ...
1
vote
2answers
22 views

unsmooth blending with deferred shading and light volumes

So I implemented deferred Shading with a single full screen light pass (picture 2) (by passing the light-data as an array to the shader) and deferred shading with point light volumes (picture 1) (by ...
4
votes
2answers
251 views

Fine tuning light shader mechanics

I'm currently trying to implement the lighting technique described in this article. I've done pretty much exactly what is done in the article. My technique is the same, and my shader is the same. ...
1
vote
1answer
820 views

Difference and interaction between Viewport and Camera

I'm very very confused about some very basic concepts in game/grafical developing. The interaction between the individual components (camera, viewport, window-sizes, gameworld-sizes, ...) when ...
0
votes
2answers
68 views

Vertexes passed to OpenGL becoming zero

I've got two methods of test code. The first uses a single VBO with the vertices and texture coordinates interwoven to draw a square to the window. The second uses an array of three VBOs to define the ...
1
vote
2answers
84 views

Parts of 3D model disappear during animation

I'm trying to properly play an animation done in Blender 2.8 inside my OpenGL application. When the animation is running, it happens that at some particular frames, some parts of the 3D model "...
1
vote
1answer
977 views

Rotate camera around its center in 2D

I'm currently trying to develop my own little game engine (trying to understand maths in games). I have implemented 4x4 matrices and 2d vectors (I don't need 3d since I'm aiming at orthographic ...
0
votes
1answer
502 views

Rendering to framebuffer / multiple rendering in a frame makes geometry black

I'm trying to adapt the shadow-mapping process given on this microbasic guide into my game, it's made with LibGDX. I've run into a blocking point with the creation of the shadow buffer via rendering ...
6
votes
2answers
331 views

How to generate a multiplier map for radiosity

I am following this tutorial: here I am at the part where you are creating a hemicube. I have got the code to render the scene into a texture and therfore an array. Now how can I generate a so-called ...
4
votes
3answers
9k views

How do I render .dae models?

I'm building a game for iOS. I'm quite new to OpenGL but what I want is to take a 3D model I have made in Google SketchUp and use it in my 3d game. The problem is I don't know how to proceed. I have ...
2
votes
0answers
33 views

OpenGL : Blending & feedback effect

I'm struggling on a simple project, as an example/sandbox, I'm rendering a small oscillating rectangle on my output. I'm not using glclearcolor() but instead, on ...
0
votes
1answer
20 views

Depth to World Space Position problem

I am having a problem with turning depth to world space position. I am using GLSL. What could go wrong? Here is the code: ...
1
vote
2answers
722 views

Proper way to update pixel array data

For a game that updates a board every frame I am calculating the next arrangement of board, updating pixel array data and render board as 2D texture to quad the size of the screen using OpenGL. I use:...
0
votes
0answers
50 views

OpenGL fixed function - WASD 2D movement

I need to make a simple object (like a turtle) move on a 2D scene. The keys w, s, a and <...
1
vote
1answer
89 views

OpenGL - Debug version runs faster than Release version

My Visual Studio 2019, 64-bit version of Tetris using OpenGL runs significantly faster, 3X, in Debug mode than in Release mode. The image above shows the board. Each cycle of the rendering or game ...
4
votes
0answers
79 views

Why use sprite tile maps on the GPU in WebGL?

I'm trying to figure out the best way of rendering my layered tiled maps with WebGL, and have come across this tutorial several times: https://blog.tojicode.com/2012/07/sprite-tile-maps-on-gpu.html ...
1
vote
1answer
77 views

Why does my stencil buffer allow pixels through?

I'm rendering a scene using OpenGL. The scene consists of a grassy environment and a small lake (visible as two surfaces). To achieve water surface transparency, I'm using a stencil buffer to render ...
1
vote
1answer
56 views

Problems with porting LWJGL code to C++ (glDrawElements call returns error 1281/GL_INVALID_VALUE)

So, as the title might suggets, I'm currently trying to port a gui stack for my game engine from LWJGL(Java) to C++.I originally had this following code in java: ...
0
votes
1answer
398 views

NiftyGUI - Text isn't rendering

I am trying to create a gui with nifty on top of lwjgl. I've already had some problems during the Nifty setup, however now Nifty is set up and running correctly but for text rendering. Here is my xml ...
8
votes
2answers
4k views

For Vertex Buffer Steaming, Multiple glBufferSubData VS Orphaning?

I was learning OpenGL recently. In games, we need to update the position of game objects frequently, and they will come in & out of screen constantly. So it means in rendering we need to update ...
16
votes
3answers
20k views

When to use a vertex array and when to use a VBO?

I'm trying to learn about vertex arrays and vertex buffer objects, but I don't understand the differences in terms of: case-of-use (static geometry like terrains, geometry that changes every frame ...
1
vote
0answers
35 views

How can I reduce a frustum to the subset that passes through a portal AABB?

I'm trying to implement portal based occlusion culling: There are sectors and portals. When a portal is visible, the sector it is connected to is rendered. The sector is made of polygons and ...
0
votes
2answers
68 views

Generate vertices of a sphere by using spherical coordinates

I'm trying to generate points for a sphere by subdividing the space of spherical coordinate in res sector and res slices. At first I did my own implementation, but it wasn't working. After a while I ...
0
votes
0answers
22 views

WebGL transparent gradient mask at edge

I need to make a feature in WebGL, where I have horizontal list of meshes (example 20) and I want to show only 3 and 2 at edge are fade in/fade out. And it slowly animates from one side no another (...
1
vote
1answer
54 views

Why is my tessellation output failing to reach my geometry shader?

I'm attempting to render grass using GLSL tessellation and geometry shaders. For vertex input, I'm using position and normal. For reference, here's an image of the grassy field without tessellation (...
1
vote
1answer
151 views

OpenGL Shadowmaps Limit

I would like to render an OpenGL scene with an arbitrary number of point lights (at least 1024) with shadows enabled. My current method of rendering shadowmaps, however, cannot do this. Let me ...
0
votes
2answers
49 views

Rotating an object to face the same direction as another object

Feel like I should know this, maybe I'm just over thinking it. What I'm attempting to do is create a bullet hole plane/texture object on top of an existing mesh when a ray cast returns a hit point. I ...
23
votes
1answer
4k views

Optimization of rendering of cube world

I have a world made of many cubes (like in Minecraft), they have only color (not texture). I am rendering them using OpenGL 3.3 core profile (GLFW3, GLAD, GLM). I am already have done some ...
4
votes
2answers
5k views

OpenGL VBOs are slower than glDrawArrays

So, this seems odd to me. I upload a large buffer of vertices, then every frame I call glBindbuffer and then the appropriate gl*Pointer functions with offsets into the buffer, then I use glDrawArrays ...
1
vote
2answers
395 views

Can I create custom framebuffer and render to it in cocos2dx?

I want to do post processing effects so I was thinking If I could just make custom framebuffer in cocos2dx like OpenGL and render the ALL SCENES objects in it. I want a single frame buffer for all ...
20
votes
1answer
15k views

What is the benefit of triple buffering?

I read everything written in a previous question. From what I understand in double buffering the program must wait until the finished drawing is copied or swapped before starting the next drawing. In ...
0
votes
3answers
166 views

OpenGL Rendering Pipeline

I've been learning OpenGL graphics programming and I've decided I'd quite like to make a simple game using OpenGL. Drawing something in OpenGL, needless to say, is quite the endeavour. However it ...
0
votes
0answers
51 views

For drawing many layered 2D tiles, should one use the painter's algorithm, or Z-buffering?

Sorry if this question doesn't make sense, I'm still very new to WebGL / OpenGL. Basically, I'm trying to draw a tilemap similar to the one in Stardew Valley. Here's a screenshot from that game: https:...
1
vote
2answers
395 views

Frame Buffer Object (FBO) is not working. What is the right way to use?

I am trying to use FBO but i am living some problems. I will show you my steps but first i will show my running screen ,so we can compare them. Like before fbo after fbo. My running screen and Draw() ...
2
votes
1answer
126 views

Time to render each frame is proportional to the amount of models in the scene

This question is deliberately written in a "High-Level" manor to avoid screeds and screeds of code snippets, hopefully I can get my point across, I am using C++ and OpenGL. I have a game engine, and ...
0
votes
1answer
53 views

Flat shaded triangles using the ModelBuilder?

I decided to give the ModelBuilder a try but I cannot get rid of the smoothing of my terrain. So what I tried: Create each triangle individually with there own ...
6
votes
1answer
686 views

Draw Edges in OpenGL

I use blender game engine and blender uses OpenGL for graphics. How can I draw lines around all 3D objects? Would this be a job for a filter? Mainly, I want my end result to look drawn. I found this: <...

1
2
3 4 5
82