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
35 views

OpenGL only utilizing the last initialized sprite's positional data

I'm currently creating a 2d fighting game utilizing OpenGL and I have run into a problem where OpenGL is only drawing at my last initialized sprite position, regardless of how many sprites I ...
Jason's user avatar
  • 413
1 vote
1 answer
384 views

OpenGL render shapes without texture file

I currently have beginner knowledge of OpenGL and something doesn't go into my head! How do I create shapes like eg. a triangle with rounded borders. Or a quad with rounded borders. Or some random ...
Kiryu144's user avatar
  • 137
2 votes
1 answer
534 views

Could executing OpenGL shaders sent from a server be dangerous?

I just came to the realization that since uncompiled shaders are just text, they can easily be sent over a network from a server and then compiled at runtime and executed on clients. I'm not actually ...
PandaConda's user avatar
2 votes
2 answers
469 views

3D Thrust velocity

How do I create 3D velocity with a 3D angle and 1D thrust like the 2D algorithm below? ...
Jon White's user avatar
4 votes
1 answer
5k views

Why is the size of glm's vec3 struct 12 bytes?

When trying to determine the size of glm::vec3 (from GLM math library) by using the size of operator like so: sizeof(glm::vec3) I get 12 returned. When I look at ...
Jason's user avatar
  • 413
0 votes
1 answer
3k views

Shadow casting in 2D OpenGL

I´ve read several articles, tutorials about shadow casting and I think that I understand the way how it works. However I miss some of the steps. Here is included my order list: Fill framebuffer with ...
Pins's user avatar
  • 559
1 vote
0 answers
398 views

render trajectory of particle in forcefield using GLSL shader

I want to visualize flow of particles in some forcefield e.g. electromagetic, gravitional or potential flow in fluid (streamlines); I was thinking to use Geometry Shader which would look like this (...
Prokop Hapala's user avatar
2 votes
2 answers
169 views

Easy way to edit vertex attributes

I'm trying to edit large amounts of vertex attributes in my models for my game. The main attributes I really care about are strength (so wind can interact with them) and a couple of other things so ...
J4S's user avatar
  • 153
5 votes
1 answer
5k views

How can I draw 500 million triangles with OpenGL?

I am a beginner. I have a problem with my frame rate. I am trying to see my GPUs maximum performance with using VBO. I saw that everybody says a GPU can draw 1 billion triangles (so 3 billion vertices)...
Emre Kaya's user avatar
  • 535
1 vote
2 answers
523 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 ...
videogamechef's user avatar
1 vote
0 answers
241 views

VBO on old GPU (GL 3.0 & 4.1) not supported?

I have an application displaying some 3D rendering. I encounter some graphical problems with VBO, when integrating my application on different user's laptops. Vertex Buffer Object work perfectly fine ...
Quentin Tealrod's user avatar
1 vote
0 answers
101 views

Strange cubemap shadow behavior

I am trying to create omnidirectional shadow mapping with a cube map and a simple scene. But I am getting very strange behavior with my shadows. Watch the GIF i created, the small ball moving across ...
Alex's user avatar
  • 155
1 vote
2 answers
381 views

Vertex attributes with strides between them vs blocks of data

Using opengl, does it make a difference if I upload plain vertex attribute structs, and then define the strides between them using glVertexAttribPointer, or if I do ...
McLovin's user avatar
  • 451
1 vote
0 answers
80 views

Trying to render a geometry with OpenGL, but can't seem to

I have a Renderer component which can render a Scene. Assume the scene is just a container for ...
Daniel Ribeiro's user avatar
1 vote
0 answers
250 views

OpenGL terrain rendering

I have written my own 3D engine and want to improve some of my render systems. Right now I've got a terrain system including the shaders). I can add 4 different textures which can be blended at any ...
Luecx's user avatar
  • 11
1 vote
2 answers
385 views

Why is my light not working as expected in OpenGL 2.0 using GLSL?

First off, this is a Uni assignment, but the lecturer is stumped too. The light (attached to the mouse) only works when inside of the object (a sphere in this case). I've tried multiplying the ...
Lupus590's user avatar
3 votes
2 answers
2k views

How can I get data from the previous frame in OpenGL 2.0 with GLSL?

First off, this is a Uni assignment, but the lecturer is stumped too. I am trying to imitate a heat lamp. The goal is to mimic what a thermal camera might see while looking at the sphere which is ...
Lupus590's user avatar
1 vote
1 answer
2k views

Why is my texture not applied correctly in OpenGL 2.0 with GLSL?

First off, this is a Uni assignment, but the lecturer is stumped too. With the shader active, I get nothing, just black. With the shader disabled (fixed function pipeline) I get a rainbow pattern ...
Lupus590's user avatar
1 vote
2 answers
56 views

OpenGL specification error?

Follow up for my previous question, whose answer lead to another question: As the OpenGL specification documentation states, in ...
curious student's user avatar
1 vote
1 answer
285 views

C++ - Assimp - OpenGL vertex data feed problem

I'm getting a very weird problem where OpenGL doesn't use the hardware to render anything, so I get just a cleared blank screen. Here's some code: ...
curious student's user avatar
1 vote
0 answers
88 views

Possible to test a game on multiple machines without owning multiple machines?

I'm working on a small PC game (Uses custom engine written in C++) that I would like to test. Not as much the gameplay but the engine itself. See if there are any crashes, errors, glitches or missing ...
AdyAdy's user avatar
  • 133
1 vote
1 answer
3k views

LWJGL 3 how to convert screen coordinate to world coordinate?

I'm trying to convert screen coordinate to world coordinate on mouse click event. For LWJGL 3 there's not GLU utility class is available whereas LWJGL 2 has. I'm using JOML math classes and wrote ...
digz6666's user avatar
  • 125
0 votes
1 answer
135 views

Float array not connecting with OpenGL Shader

I first tried using a float[][] to get the height of a particular area but OpenGL didn't want to and it was much simpler to just use a flat multi-dimensional array instead. However, that array is not ...
TheGamerPlayz's user avatar
-1 votes
1 answer
2k views

OpenGL 2D orthographic projection problem [closed]

I'm trying to use an orthographic projection to allow me to specify the dimensions and position of rendered objects using exact pixel coordinates (like in this tutorial: https://learnopengl.com/#!In-...
Terran's user avatar
  • 3
2 votes
0 answers
750 views

OpenGL using quaternion to rotate camera to avoid gimbal lock [duplicate]

I read in many sources about using quaternion to avoid gimbal lock but I can't apply this practically in my code, so I have a camera class I want to rotate it with mouse so I have Euler angles Pitch ...
Mohamed's user avatar
  • 141
1 vote
1 answer
103 views

Rotation ascending into infinity?

I'm creating a rotation for my sun to move, however it quickly extends to Infinity before going into NaN. I thought that taking advantage of the Matrix4f would make this much easier but it does as ...
TheGamerPlayz's user avatar
3 votes
1 answer
275 views

Learning OpenGL 3.3 on OpenGL 2.1 machine?

I am going to learn OpenGL 3.3 instead of OpenGL 2.1 because many model of OpenGL 2.1 is deprecated (base on this information). It's pity that my "old friend" only support OpenGL 2.1. Base on this ...
Duy Vu's user avatar
  • 33
1 vote
1 answer
248 views

OpenGL float[][] not working?

I have a float[][] array in my terrainFragmentShader to load render the biomes, however the code simply does not work. No errors are being cast and when I remove the code ...
TheGamerPlayz's user avatar
1 vote
1 answer
416 views

How to adapt a webgl shader using mouse position to have symmetrical behaviour

I'm trying to create a particular kind of effect for the background of my SpriteKit game, and I've found some shaders on shadertoy that are close to what I want, but I'm struggling to adapt them to do ...
Sam Woolf's user avatar
0 votes
1 answer
1k views

OpenTK Terrain - Triangle strip issue

I'm currently trying to render terrain in an OpenGL application I'm making (using OpenTK in C#). Something really odd is happening and I'm not sure why. Here is the code I use to load my terrain from ...
user avatar
1 vote
2 answers
921 views

How to render multiple triangles using single VBO in OpenGL (LWJGL)?

I'm new to OpenGL and trying to render multiple triangles using single VBO in using LWJGL3. I've followed demos and read some books and wrote following code, but its not drawing my shape. I use vertex ...
digz6666's user avatar
  • 125
3 votes
1 answer
816 views

In OpenGL, what does it mean to make a context current?

I have a few questions : 1 - What does it mean to make a context current? Does it mean that all subsequent OpenGL calls will apply to that context/window? 2 - With GLFW3, how to use multiple windows ...
EnhancedElegance's user avatar
0 votes
1 answer
232 views

Sorting a vector using array version of quick sort

I'm coding a simple rendering engine using OpengGL and I wrote a class that manages a particle system. The class creates the particles and pushes them into a vector to be used by a renderer to draw ...
Luca's user avatar
  • 143
1 vote
0 answers
173 views

Acceptable memory size consumed by mobile game in 2017? [closed]

How do you think, what is the acceptable memory size consumed by mobile game in 2017, taking into account current state of mobile devices hardware performance? I've made a pack of optimizations using ...
heximal's user avatar
  • 111
1 vote
2 answers
374 views

How to keep same aspect ratio in different devices with cocos2dx?

I have been making a board game and I am using cocos2dx. There are two scenes for now, One is main menu and the other is gameplay scene. When I run the apk on tablet with EXACT_FIT resolution policy ...
videogamechef's user avatar
0 votes
1 answer
439 views

Efficient Dynamic Memory Management

My world is procedurally generated. As the player moves, chunks behind them are unloaded and chunks in front of them are loaded. Each chunk has a mesh of triangles. At the moment, I create two VBOs ...
Lucien's user avatar
  • 1,176
0 votes
1 answer
599 views

glUniformMatrix4dv with a unidimensional array

I am trying to convert this C++ gml code to C and am getting the same array but I cannot see anything on the screen, is there something I am doing wrong maybe on the shader? GML code in C++: ...
shuji's user avatar
  • 113
0 votes
2 answers
2k views

OpenGL - Changing blending modes using sprite batching

I'm working on a game which uses sprite batching to render sprites efficiently where each sprite gets batched with its VBO data into a VAO every frame (containing vertex coordinates, texture data and ...
Jeremiah Cummings's user avatar
-1 votes
1 answer
1k views

Implementing an open world environment

Lets say my engine supports a "Model" with a position in the world, hitbox and the data to paint in the render method. Should an open world map be a "Model"? How do I render only part of it in order ...
Gee's user avatar
  • 99
3 votes
0 answers
217 views

Voxel Game - Lag when camera is inside of the terrain

I am making a voxel game in OpenGL and I currently render 8 x 8 chunks to the screen. The first thing I do is generate the map using Simplex Noise and this is done once when the chunk is created. I ...
AtomProgrammer's user avatar
0 votes
1 answer
565 views

How many shaders for my 2D game?

My 2D OpenGL game is going to have 5 different types of objects I want to render. -Text -unTextured AABBs -unTextured Polys -Textured AABBs -Textured Polys Text will have its own shader and ...
Curtis Sherwood's user avatar
2 votes
2 answers
227 views

Iterating in "box" formation

I'm writing a minecraft clone in C++ and need some assisting with the chunk generation. Because I only want to load chunks that are near the player, I have to load and unload chunks based on the ...
Kiryu144's user avatar
  • 137
1 vote
1 answer
3k views

What is the benefit of a sparse bindless texture array over just bindless textures?

I've seen the talks on AZDO, and they tend to suggest moving towards an architecture where you have one texture array per texture "shape". This is sparse, so you allocate loads of layers for potential ...
ocharles's user avatar
  • 135
0 votes
1 answer
967 views

Getting crash on glDrawElements

Here is the code where I initialize the VAO, vertex attributes(also the main VBO) and EBO(im using my own wrapper class for these "databuffers" to hide some of the API features and make life easier so ...
Pins's user avatar
  • 559
2 votes
1 answer
155 views

How to know if these profiler values are good or bad?

I'm making a 2D game for Android Mobile using LibGDX and Java in Android Studio. My game mostly runs alright with 60FPS, but for some time to time it lowers to 50FPS. I'm trying to find out what ...
Gad Wissberg's user avatar
1 vote
1 answer
815 views

How to properly setup unit testing for my c++ game project? [closed]

I'm currently creating a 2d game in C++ using visual studio and utilizing gtest/gmock for my testing framework. The problem I'm having is I'm not sure what my best option is for testing. I'm using SDL ...
Jason's user avatar
  • 413
0 votes
1 answer
525 views

C++ glGenBuffers does not return proper VBOID when called in thread [closed]

I'm currently learning to properly use multithreading in C++ in combination with OpenGL and GLFW, and I encounter a strange bug in my application. I'm generating a procedurally generated terrain in a ...
Kiryu144's user avatar
  • 137
0 votes
1 answer
2k views

Read from OpenGL texture to Bitmap in C#

I want to read a texture pixels from texture id (associated with some FBO) to bitmap object in opengl (opentk) in c# But it throws an exception says: ...
O-BL's user avatar
  • 103
-1 votes
1 answer
3k views

Rotate Earth around sun, and moon around earth

SOLVED: I'm trying to rotate the moon around the earth. Which this part of the code only the earth is rotated around the sun, how can I make the axis to be center of earth's object? I thought about ...
Ilan Aizelman WS's user avatar
4 votes
0 answers
1k views

How and when to split draw calls in OpenGL and OpenGL ES

My application (with a modernish OpenGL >= 3.0 and an OpenGL ES 2.0 backend) renders more or less streaming data with up to millions of vertices with different vertex layouts and sizes (some simple, ...
Bim's user avatar
  • 181

1
18 19
20
21 22
87