Skip to main content

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
0 votes
1 answer
70 views

Normal map lighting is just slightly off

I've been trying to implement normal mapping into my custom OpenGL shader. The result I'm getting is almost there, but it looks like the Point Light is not ...
Tom Tsagkatos's user avatar
0 votes
1 answer
91 views

What is this jitter caused by moving at high speed?

I used jumping real high as an example to show the jitter. what is causing the jitter issue? I can provide code for various parts of my engine if requested.
ZeunO8's user avatar
  • 699
0 votes
0 answers
44 views

Moving a texture with a vert shader

I'm working on a mod for a game and trying to add my own shader. I know practically nothing about shaders, but another similar shader exists and with their modding teams permission im using it as a ...
JoshB's user avatar
  • 1
0 votes
1 answer
775 views

Int vs Float, which one is faster for gpu?

My game need to loop through massive amount of data, and the amount of data can increase by a lot depending on world settings set by player. The data is too big for CPU so i need to use GPU for it ...
aaa's user avatar
  • 117
0 votes
0 answers
29 views

LibGDX Table rendering order draw calls

I'm using LibGDX Table for drawing some simple structure but I am having problem with draw calls and texture binding handling. For clarification, I have a ...
glz's user avatar
  • 31
0 votes
0 answers
43 views

Some faces of mesh are showing much darker than they should be

Hello, My traffic light model has some dark faces and I can't seem to understand why? I am using OpenGL. This is my fragment shader: ...
DragonYT's user avatar
1 vote
1 answer
286 views

Is OpenGL 2.0 possible in unity?

I want to develop a game in unity, just a small scale simple game without heavy computation nor complicated feature, and does not use a lot of ram either (2-3 GB). I want player with "outdated ...
aaa's user avatar
  • 117
1 vote
1 answer
163 views

GLSL 9-Slice (or 9-Patch) working with single texture, but not with atlas texture

I've been able to implement 9Slice for textures when the texture is just itself, that means, it does not contain any subtexture except itself. This is the code I'm using: ...
borja vazquez's user avatar
0 votes
0 answers
43 views

Manual calc of perspective projection and getting point on the screen

I'm need to draw the red rect on the first vertex of gray platform. To begin with, I draw a gray platform with a perspective projection and set it using gluPerspective: ...
ladno's user avatar
  • 1
1 vote
0 answers
63 views

LWJGL3. A strange graphic artifact of OpenGL 3.x

I work in java with lwjgl3. I came across a strange artifact, the source of which I have not been able to determine for a very long time. I'm drawing a large surface. When I approach this surface and ...
alfabouh's user avatar
0 votes
0 answers
52 views

Clarification on scene graph implementation. Adding object/node to a root node or container?

I learned about scene graphs from this chapter on learnopengl and using this I'm trying to make a simple imgui window that can display the scene graph, but one thing that wasn't made clear/I'm having ...
Konjointed's user avatar
0 votes
1 answer
84 views

Skybox not texturing

I have looked for a solution for a little while now however I'm not sure if other people have encountered my same problem. I am trying to draw a skybox in a blank opengl window, I have camera controls ...
Ben Duguid's user avatar
21 votes
2 answers
7k views

What is a "normal" in game development

I'm new in Game development and probably this is a silly question. I had a look online but haven't found a clear answer, I did it bit quick but enough to evaluate that this is a confusing topic ...
Federico Baù's user avatar
1 vote
0 answers
121 views

Is there a reason that we have to use homogeneous coordinates in rasterization?

Looking at the pipeline of games, I am confused about the necessity of homogeneous coordinates. For gameplay logic, a 4x3 matrix is enough to handle translation, rotation, and scale. I can't think of ...
lotsof one's user avatar
0 votes
1 answer
447 views

How can vertex position can be converted to fragment position?

I started learning open gl and graphics programming for a while (im using open tk as im working on c#) so i finally came across lighting where you make the ambient diffusion. Im pretty sure that you ...
Alex Mathew's user avatar
0 votes
1 answer
145 views

Increased CPU usage when rendering sprites

I'm creating a game in modern OpenGL, C++ but I'm having problems with optimization. Whenever I render the sprites the CPU usage starts to increase. Code: ...
FandoraStudio's user avatar
0 votes
0 answers
316 views

PyOpenGL "Attempt to retrieve context when no valid context" - seems to be Linux specific?

I've been trying to learn PyOpenGL, so I'm still pretty clueless about what's going on. I've been following a video series. I couldn't get it to stop throwing "Attempt to retrieve context when no ...
brododragon's user avatar
0 votes
1 answer
326 views

Fade edges of 2D spline-mesh

I'm re-writing my Unity game in Raylib and are trying to recreate a path/road-shader I made with Shader Graph. The first picture is how it looks in Unity, with faded/blurred edges. The path is a 2D ...
Johan Tovesson's user avatar
0 votes
0 answers
104 views

Set depth value in fragment shader

I'm making a simple 2D renderer and I want to avoid redrawing as much as possible. My Vertex layout has the 2d position and a float depth value. I want to assign a depth value to each of them after ...
FrameBuffer's user avatar
0 votes
0 answers
75 views

Get coordinates of clicked point on screen in model space

There is a 2D object located in the coordinate range -1 to 1. In world space, it is also located in these coordinates, but with a shift along the z axis. The actual initialization of the model, view ...
Ar4's user avatar
  • 1
0 votes
0 answers
207 views

Fast Fourier Transform for Water surface simulation

I want to implement water in my game and have already done it using the Gerstner equation, but the result is not too impressive, then searching the Internet I found an article about how someone made ...
Proger's user avatar
  • 1
0 votes
1 answer
84 views

Is vertex coordinate limited to -1 to +1f range

I thought that everything outside of [-1.0f, +1.0f] should not be renderable in Open GL. However, this code renders just fine with Silk.NET. I draw 3 axes and one ...
Anonymous's user avatar
  • 111
0 votes
0 answers
131 views

Do texture arrays bring performance gains

I have a terrain mesh in unity that uses a four-layer texture blend, at first I used a single texture (diffuse and normal), then I converted it to two texture arrays storing diffuse and normal ...
BoomBac's user avatar
3 votes
1 answer
144 views

Character overlaps with static objects

I am creating a simple OpenGL C++ game. I have a main character (green box) and some static objects (red boxes) positioned as stairs. The problem is as green box is descending down the stairs, it ...
Axel's user avatar
  • 33
0 votes
0 answers
53 views

C++ OpenGL texture coords VBO indexes changes between models

I just load 3 models using assimp into my Engine and have some problems with textures. Through some research, I realized that texture coordinates VBOs indexes changes between models, according to this ...
Proger's user avatar
  • 1
0 votes
1 answer
303 views

Is instanced rendering any different from indexing seperate buffers using div and mod in the shader?

As far as I can tell instanced rendering is simply a way to separate a single vertex buffer into a buffer for vertex-specific data and instance-specific data. This could be useful for rendering ...
CPlus's user avatar
  • 143
0 votes
0 answers
52 views

Change colors after drawing lines in Pangolin using OpenGL

I am drawing a bunch of lines using pangolin library. Each line has 4 vertex pairs. My goal is to give each line a different colour. Here is the code snippet I am using. In each render loop I do the ...
Nitron_707's user avatar
0 votes
0 answers
132 views

Separating Game code and Engine code

I've decided to take on a challenge of making 16 c++ games based on this challenge from FamTrinli, I'm using SDL + OpenGL. I've created a simple 2D game in the past, but I didn't like the code ...
koogel's user avatar
  • 79
0 votes
1 answer
156 views

2D Batching and correct draw order

I'm encountering a design challenge while developing my 2D C++ OpenGL engine. I'm using a batching technique for rendering my drawable objects, and I want to ensure they are drawn in the same order ...
DDD's user avatar
  • 11
0 votes
0 answers
39 views

Different texture generation methods with opengl

I'm experimenting with texture generation so I can begin to implement height map generation/terrain generation. Right now I'm just experimenting with different generating functions. Right now I'm just ...
YamMan's user avatar
  • 49
0 votes
0 answers
46 views

LWJGL Shader not displaying anything to the screen

My basic shader program isn't displaying anything to the screen. Please Help! Here's my code: ...
pcarroll17's user avatar
0 votes
1 answer
57 views

Front faces are transparent after setting glEnable(GL_DEPTH_FUNC) and glDepthTest(GL_LEQUAL)

I've been learning OpenGL over the past year or so, and I've never face this issue before, I've been refactoring the old version of my renderer to make it cleaner now that I'm more confident with ...
YamMan's user avatar
  • 49
0 votes
0 answers
100 views

How is it possible that double buffering is enabled yet the back buffer doesn't exist?

I am working on an existing OpenGL application and am currently trying to figure out why I am getting a black screen. So I am wondering how its possible that double buffering is enabled and the back ...
Doug Ray's user avatar
  • 143
0 votes
0 answers
59 views

Sequencing interaction between rendering/animation and game logic in Poker game

I am building a two-player(CPU-User) Poker application with C++ and OpenGL. Currently the application just renders the graphics, keeps track of which button is pressed, value entered in textbox ...
Incompleteness's user avatar
0 votes
1 answer
32 views

Why isn't my framebuffer getting updated?

...
Cedric Martens's user avatar
0 votes
2 answers
212 views

OpenGL texture not displaying despite setting uniform int

As you can see in the linked image, despite assigning a texture unit, there is no texture being drawn on the screen. In the main loop, I am receiving error 1282, and there are no further errors ...
Henry Fielding's user avatar
0 votes
1 answer
259 views

How to apply sampler2Darray textures to different locations of a single mesh?

In openGL, I have a 3D terrain composed of a grid of 255x255 vertices. The vertex of the lower left corner is at coordinates (-127;-127) and the one of the upper right corner is at coordinates (127;...
Greelings's user avatar
  • 103
1 vote
0 answers
63 views

Why opengl code in a lib doesn't renderer?

I am experimenting with opengl using c99 on windows and vs 2022 i tried to create an window using glfw in one project and put a function that supposed to generate a texture in another project that is ...
Abn Alsrag's user avatar
0 votes
0 answers
65 views

Using Render Doc with Maya

I am creating a plug-in that utilizes OpenGL to render to a seperate device however the plugin is only showing a black screen I suspect due to an OpenGL error. However, when I try and attach Render ...
Doug Ray's user avatar
  • 143
2 votes
2 answers
814 views

How to make a sky with gradient color in OpenGL?

I'm making a game with OpenGL and would like to add dynamic sky colors with gradients. However, I don't know how to achieve this. Here's an example (in Minecraft) of what I would like to have: In ...
Vincent's user avatar
  • 73
0 votes
0 answers
101 views

How do I move a camera around a tiledmap in Libgdx?

I have the following code for rendering a TiledMap and moving around a Texture representing the player on top of it and the camera is setup to follow the texture around. However, when I try to move ...
Sagnik Dutta's user avatar
0 votes
0 answers
251 views

Drawing triangles like it is 1980 but with OpenGL

How can I draw a triangle with modern OpenGL, that clearly shows pixels (filled rectangles) on diagonal lines? What I have done so far: Setup OpenGL (with GLEW) window in 320 x 200 Define vertices ...
Edgar Alloro's user avatar
0 votes
1 answer
38 views

Most but not all quads appear corrupted when passing matrix and colour using VBO for instanced rendering

I was trying to batch quads with the same texture and blend mode into the single draw call using glDrawElementsInstanced. As long as I use just a position, texture ...
Anton Grant's user avatar
0 votes
0 answers
52 views

PyOpenGL-Demo sample code -- exiting app doesn't work

I am using the cube.py sample from PyOpenGL-Demo, and there is this snippet there to handle the app exit when user presses the Esc key: ...
PaulM's user avatar
  • 101
0 votes
0 answers
79 views

Creating a flattened (panorama?) 2D view of a cubemap

I am trying to generate a 360 degree view of a scene by sampling a depth cubemap using spherical coordinates. x and y represent the horizontal, or azimuth, and elevation angles respectively and the ...
marcos's user avatar
  • 1
0 votes
0 answers
120 views

How to extend a VBO in OpenGL and keep its data?

I'm making a game with infinite, blocky procedurally generated worlds in python, with PyOpenGL. I figured out that allocating all the VBO space at once causes a lot of lag. To fix this, I am ...
N3RDIUM's user avatar
  • 53
0 votes
2 answers
121 views

Hybrid perspective / orthographic projection

I'm trying to figure out how to setup camera projections such that they fulfill following requirements: main scene is rendered with perspective projection camera / viewport controls allow only zoom (...
skrat's user avatar
  • 173
0 votes
1 answer
175 views

How to achieve Quake moving lava effect using OpenGL under v2.0?

On the first boss fight level you could notice how lava moves what is not a surprise for a software renderer. But according to the Quake fandom, GLQuake was released in 1997, hence OpenGL had no ...
MaximMogulev's user avatar
0 votes
1 answer
155 views

How to draw selected instances with gl_InstanceID and glDrawElements...?

I want to draw a selected number of instances using glDrawElements... but I don't know which function to use and how to set the parameters. I set the ...
KennyTan's user avatar
0 votes
1 answer
233 views

Recommended approach to image rendering on quads for OpenGL-backed canvas

I am working on a vector graphics rendering library for OpenGL in Rust. Currently, the library's API is as follows: ...
JS4137's user avatar
  • 107

1
2
3 4 5
87