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
1answer
41 views

OpenGL: What to do after running glBufferData?

I am interested in understanding a bit more behind how OpenGL does its memory management and what are some good practices before I start heavily coding and back myself into a corner. The real question ...
0
votes
1answer
37 views

Why does reading my depth texture in GLSL return less than one?

I've created a depth texture in OpenGL (using C#) as follows: ...
0
votes
1answer
43 views

Shader Flickering Normal Map Lighting

I am encountering an issue when using a normal map with directional and/or point lighting. Without using the lighting, I am able to render the object fine. When any amount of lighting is applied, it ...
0
votes
0answers
10 views

How to test a Unity game with different graphics APIs?

If I don't have a device with Metal, is there a way to test the application with it anyway? And if my device supports both DirectX and OpenGL, how can I tell the application, for example on Windows, ...
2
votes
1answer
99 views

Is linear filtering possible on depth textures in OpenGL?

I'm working on shadow maps in OpenGL (using C#). First, I've created a framebuffer and attached a depth texture as follows: ...
0
votes
1answer
50 views

What is the best way to approach a multi pass rendering system?

I am trying to code a new feature in my engine but I can't find a way to implement my idea, which is the next one. I am trying to get multi pass rendering with more than two passes. I know how to do a ...
0
votes
0answers
48 views

Using quaternions to rotate an object

I started to learn quaternions and got very weak idea of how they work. So I blindly followed some tutorials on you tube on how to rotate object with glm. I had problem with weird rotations when I ...
0
votes
1answer
51 views

OpenGL/C++ Rotate relative to shooting gun

I'm trying to make a 2D game where I have a gun that i use to shot things in the direction of the mouse resulting in an angle that I can get. I have some problems with the trajectory of the bullet ...
1
vote
0answers
38 views

GLSL link fails with C9999 (too many buffer declarations?)

I'm receiving a C9999 (*** exception during compilation ***) linker error for an OpenGl 4.6 compute shader. It seems to be related to the number of SSBOs I have declared (14 separate declarations), ...
1
vote
0answers
57 views

OpenGL model not rendering properly

I have been playing with OpenGL for a while and I came into the wall that I don't know how to pass. I am trying to render a model of an object based on a .obj file. In that file I have position ...
0
votes
0answers
37 views

Attempt to fix sprite sheet pixel bleeding in OpenGL 2D causing sprite distortion

While working on a project, I encountered the common problem of pixel bleeding when trying to draw subregions of my sprite sheet. This caused sort of "seams" to appear at the edges of my ...
0
votes
1answer
21 views

Corrupt Save File Problem Csharp Opentk

I am trying to save player's objects but my loaded result is corrupt and placed in weird shapes like 3D arrows. Weirdly enough when terrain is saved, the terrain is fine but objects added later cause ...
1
vote
0answers
53 views

Basic 2D Lighting Optimization Issue in Fragment Shader with OpenGL (GLSL)

I'm using a fragment shader to implement 2D lighting (code further below). Even though I am satisfied with the visuals of the light i noticed that it has a quite big GPU usage, and when trying to add ...
0
votes
0answers
45 views

How to convert OpenGL 2.0 code to OpenGL-ES 2.0?

I have a 3D game library that uses OpenGL 2.0 for PC and I need to convert it to OpenGL-ES 2.0 to compile it for Android. Because the library is huge, I'd like to avoid converting it line-by-line by ...
0
votes
0answers
37 views

Z-Buffer Problem

I was working on my engine and while implementing post processing a very weird bug appeared. It seems to come from the Z-Test but I can't firgure out what exactly it is hapening First of all here's ...
0
votes
0answers
29 views

Knowing the size of a framebuffer when rendering transformed meshes to a texture

I have a couple of 2D meshes that make a hierarchical animated model. I want to do some post-processing on it, so I decided to render this model to a texture, so that I could do the post-processing ...
0
votes
2answers
109 views

Does SDL2 completely encapsulates Direct3D and OpenGL?

I'm starting to study game development but the concepts of how the SDL2 lib works are still a bit blurry to me. I get that both Direct3D and OpenGL are two sides of the same coin. They both are used ...
0
votes
1answer
45 views

Why should every light source have its own ambient light?

I'm currently learning how to use OpenGl, and I'm following a tutorial on learnOpenGL. I'm at the lightning chapter, and it has introduced basic lightning, ambient and diffuse with specular highlight. ...
1
vote
0answers
43 views

glReadPixels performance not improving with PBO

I'm currently using glReadPixels to read from the depth buffer to calculate where on the map the player is pointing, for the purpose of placing objects on the ground. I do this after rendering the ...
1
vote
1answer
78 views

Unable to create Shader Object for Geometry Shader (GL_GEOMETRY_SHADER)

I am just starting with OpenGL using c++ on Ubuntu 18.04. The problem I have is that when I try to link Geometry Shader in my main program, the following function call is unable to create an object (...
0
votes
1answer
38 views

For deferred rendering and SSAO, what coordinate system are the normals actually in?

So, I'm following the very helpful LearnOpenGL online tutorials, and I'm working on implementing SSAO. I don't have a deferred rendering pipeline, but I need to collect normals during my depth pass so ...
0
votes
1answer
135 views

Half of my tris are textured in streaks and blurs

I have written code to import meshes from OBJs and textures from BMPs. My texture coordinates seem to be getting messed up somehow, or some other issue is occuring, because I am getting these effects ...
0
votes
0answers
17 views

Send Geometry Data to Multiple Shaders

So I am implementing a deferred rending model for my engine, and I want to be able to send all scene geometry into a single shader to calculate ambient, diffuse, normal, ect thats not the question. ...
0
votes
0answers
23 views

How to draw a screen space decal along a desired projection direction and control which surfaces it affects?

I am currently programming a complex 2D lighting system which calculates lighting in 3D space. Something like what I want to achieve (Source @pixpilgames from Twitter): I recently learned how to ...
0
votes
1answer
72 views

OpenGL convert mouse position to world coordinates without gluUnproject in Python?

EDIT: I changed the bottom left to -1,-1 and the top right to 1,1, and while I can draw objects within this range, I cannot map the mouse x,y to the world space. I have been trying to learn OpenGL and ...
1
vote
2answers
173 views

OpenGL only rendering 4 tris of cube?

I'm on Win10, OpenGL 4.5 I wrote some code that takes mesh data from an OBJ file and puts it into a vertex buffer. I used this code to import a cube OBJ and render it in OpenGL. For some reason, ...
0
votes
0answers
30 views

Ray Tracing in One Weekend, how to add depth of field to view matrix?

I'm working through the infamous Ray Tracing in One Weekend book as I implement it on a OpenGL compute shader, the only thing I have left to do is add depth of field. I have this function that ...
0
votes
0answers
14 views

Constant size geometries for glDrawArraysInstanced calls

In my application I can keep the objects constant sized ...
1
vote
1answer
20 views

Bind render result to texture id

I want to save the result screen of the rendering and then apply another shader on that result, the typical way is to read the screen using glReadPixels and then buffer that image to gpu and then ...
0
votes
0answers
43 views

GLFW Problem “The driver does not appear to support OpenGL”

I am trying to learn OpenGL & GLFW , when I run this simple project I get error ID : "65542" with the message "The driver does not appear to support OpenGL". My graphics card ...
0
votes
1answer
30 views

Does swap buffer with vsynch guarantee synchronization?

I was wondering if I could assume that all buffer related GPU operations such as: glDrawElements glBufferData glSubBufferData glUnmapBuffer are guaranteed to be completed after swap buffer is ...
0
votes
0answers
24 views

Is it appropriate approach to simulate shadowing via occlusion culling of lights?

I have own deferred renderer and a scene with both closed and open spaces. I want to prevent light passing though solid objects. For example, there can be a house with a lot of point lights inside. I ...
0
votes
0answers
23 views

Why does this order of Quaternion multiplication not introduce roll into my fps-style character controller?

I'm working on an OpenGL based project (in C#), employing Quaternions to rotate my camera I first tried to: ...
0
votes
0answers
24 views

OpenGL obj loader fails to work

...
0
votes
0answers
30 views

OpenGL Drawing triangles at given world coordinates in modern opengl

It's my first time I am asking a question here so I apologize in advance for any mistake. In the past two days, I decided to work on a 2D lighting system for my game and I came across a youtube ...
0
votes
0answers
41 views

C++ Help with Separating Axis Theorem

I am trying to detect collision between two triangles using Separating Axis Theorem however I am unaware what is wrong with my code. The CollisionHelper::isTriangleIntersectingTriangle is called every ...
0
votes
1answer
27 views

glfw resizing causing image scaling

I have a quad rendered that extends from the top left of the window to with width of the window that is also 64 pixels high. When I resize the window, from its initial size, the quad and text scales ...
0
votes
0answers
28 views

coloured 3d models rendering issue while running on android

I am using Godot 3.2.2 stable (GLES2) along with kenney 3d nature asset pack (glb) for prototyping a 3d game. Everything works just fine on my desktop computer, but when I deploy the game to my ...
0
votes
0answers
65 views

LibGDX 2D Silhouette

recently I decided to implement in my game the drawing of a silhouette of the player when he is behind objects (the top layer of the map). Found a similar question here, but it doesn't matter to me to ...
0
votes
2answers
52 views

How to make player seem bigger / world smaller, without changing world coordinates

I am making a voxel game with OpenGl, I've got the major parts working, except the camera seems small compared to the the blocks. How do I make the camera bigger? Do I do a scaling on the model ...
0
votes
0answers
76 views

How to load a PNG in pure C

PNG loading: I've been creating a game engine for almost a year, and since the start of the development, I have been using stb_image for loading images. It ...
0
votes
0answers
27 views

Repeat/Scroll texture on CubeMap

I need a method to scroll an image across all sides of a cube map in a way similar to scrolling a UV texture across a water's texture to give the appearance of movement by shifting the normals. I want ...
0
votes
1answer
26 views

Texture flipping behaviour

I was having this problem with OpenGL where I'd have all my textures being rendered upside down. I did the most logical thing I could think of and tried reversing the order of the mapping and that ...
0
votes
0answers
65 views

How real time volumetric light beam effect could be achieved in opengl?

Here is 1.5 mins long video to give you an example of what I meant. From research that I did , regarding lighting effect, usually it is done offline (post-processing) using algorithms like "god ...
2
votes
1answer
21 views

How does re-glBufferData()'ing interact with glVertexAttribPointer?

I understand the basic sequence: glGenBuffers() creates a "buffer object name," glBindBuffer() creates the actual buffer object (as well as binding the name), glBufferData() "creates ...
1
vote
0answers
31 views

Shadowmapping with multiple light sources

I am using shadow-mapping to add shadows to my world. Currently, I use one lightsource, which means I have to draw my world twice: once in the lightview, once in the camera view. I want to add more ...
0
votes
1answer
30 views

Efficiently color a procedural mesh?

I'm creating a procedural world with LWJGL and GLSL. I want to better visualize the biome map being produced and the height map it creates, but my attempts so far have been very inefficient. My first ...
4
votes
1answer
44 views

Issue with specular light at highly oblique angles with Blinn-Phong

I'm having an issue with my basic Blinn-Phong renderer, when looking at objects at very oblique angles: I don't think this is an issue with my code, although I'll post my fragment's GLSL below. ...
0
votes
1answer
112 views

How can I render a font in C with OpenGL?

What I tried: I was testing some things in order to render text with stb_truetype.h and OpenGL in C. I took as a reference the example that appears here. Basically, this example, loads a .ttf file and ...
0
votes
1answer
23 views

Cannot Draw a triangle without VAO on MacOS

So I was watching Cherno's Video on Vertex attributes and he was successful in drawing a triangle without a VAO, but in tutorials from learnopengl.com they specifically say they we need a VAO to draw ...

1
2 3 4 5
82