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
17 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
  • 13
0 votes
0 answers
9 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
22 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
81 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
  • 13
0 votes
0 answers
15 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
34 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
46 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
29 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
66 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
73 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
74 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
115 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
79 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
142 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
46 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
55 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
96 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
57 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
48 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
141 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
48 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
118 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 ...
user16217248's user avatar
0 votes
0 answers
37 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
50 views

Batch rendering with more textures than texture slots

I'm trying to implement batch rendering for my 2d game engine, and I need to render more than 32 different textures every frame. The first thing that comes to my mind is to sort the vertices by ...
Faby's user avatar
  • 1
0 votes
0 answers
107 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
57 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
  • 1
0 votes
0 answers
33 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
41 views

How to smooth sprites drawn from an atlas (either with linear filtering or some post processing technique)?

I've been doing a 2D renderer for a Tibia clone and came up with a design where all textures are bundled into a texture atlas. The pixelated style isn't working well (textures are often shrinked or ...
fusion32's user avatar
0 votes
0 answers
37 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
40 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
56 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
51 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
27 views

Why isn't my framebuffer getting updated?

...
Cedric Martens's user avatar
0 votes
2 answers
94 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
107 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
57 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
36 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
364 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
  • 63
0 votes
0 answers
72 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
154 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
33 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
37 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
43 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
75 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
80 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
119 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
44 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
139 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
0 votes
0 answers
62 views

Strange shadow artifacts from lighting when importing blender model in opengl

I'm trying to add model loading to my opengl/sdl2 renderer and I'm successfully loading meshes using assimp after following the tutorial at learn opengl, however when I make my own simple models and ...
YamMan's user avatar
  • 49

1
2 3 4 5
86