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
1answer
548 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 ...
0
votes
1answer
25 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 ...
0
votes
0answers
60 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
45 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 ...
50
votes
1answer
44k views

in/out keywords in GLSL

I don't really understand how to use the in / out keywords in GLSL, and google is being uncharacteristically unhelpful. What ...
0
votes
0answers
30 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
394 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
0answers
85 views

something very strange in one of the collisions with OpenGL 3.3

I'm developing a game engine in C, and I came across a problem that left me kind of lost. When I was developing my collision system, I saw something very strange in one of the collisions. During the ...
1
vote
1answer
78 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
77 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
150 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 (...
6
votes
1answer
4k views

Render object with different shader depending on the camera

I have an object with a custom shader. When it is being rendered by cameraA, then I want it to render a particular way (ex red). When it is rendered by another cameraB, I want it to render a different ...
0
votes
1answer
72 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 ...
8
votes
3answers
9k views

Which consoles may I target with OpenGL? [closed]

I'm thinking on technical design for a game/game engine using OpenGL, and I wonder if there is any recent consoles (Xbox360, PS3, Wii U, Xbox one and PS4) that I could work with if I do so. I found ...
0
votes
1answer
146 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
1answer
121 views

OpenGL color attachments don't work

Trying to implement GBuffer. Only gAlbedoSpec color attachment (GL_COLOR_ATTACHMENT2) works properly. When i try to use another texture (gPosition or gNormal) in ...
1
vote
2answers
185 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
19 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
49 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
0answers
45 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
0answers
39 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 ...
1
vote
1answer
684 views

Rotating a circle on its axis

I have a circular shape object, which I want to rotate like a fan along it's own axis. I can change the rotation in any direction i.e. dx, ...
0
votes
1answer
181 views

How do I calculate the bounding box for an ortho matrix for Cascaded shadow mapping?

I've been trying to get a cascaded shadow mapping system implemented on my engine, though it appears to be that the bounding boxes for the cascades aren't correct. The part I'm interested in can be ...
1
vote
1answer
155 views

Model gets distorted when rotating the camera

I'm currently developing my own 3d graphics engine and I'm having a hard time figuring out why my 3D models gets distorted when rotating the camera around. This is my projection matrix. I'm following ...
0
votes
0answers
16 views

Constant size geometries for glDrawArraysInstanced calls

In my application I can keep the objects constant sized ...
1
vote
1answer
22 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
73 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
1answer
34 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
29 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
28 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
31 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
80 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
0answers
36 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 ...
2
votes
2answers
1k views

C++ Mouse picking for ray to plane intersection

I'm making a C++/OpenGL application (decidedly without GLM), and I'd like to understand how to create a ray from the camera eye to the mouse pointer, as well as detect an intersection point from the ...
1
vote
0answers
40 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
3k views

GluUnproject works, but only when the camera is not rotated

I am working on a very basic 3D program, my first one using OpenGL. What I am trying to do is trace a ray from the mouse's location on click which works, but only when the camera is not rotated. When ...
0
votes
0answers
96 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 ...
13
votes
4answers
9k views

Why does clip space in OpenGL have 4 dimensions?

I will use this as a generic reference, but the more i browser online docs and books, the less i understand about this. ...
0
votes
0answers
45 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
27 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 ...
4
votes
1answer
867 views

Render Stutter - OpenGL or loop timing?

For some time now i have no been able to pinpoint the nature of the rendering stutter shown above(by not clearing the screen, not using SwapBuffers and drawing only to the front buffer). See the big ...
3
votes
2answers
1k views

Why is enabling GL_FRAMEBUFFER_SRGB making the colours brighter?

My understanding of gamma correction is as follows: We want to do colour math in linear space so we can lerp etc. between colour values and get the results we expect. But human eyes don't have a ...
10
votes
2answers
16k views

Taking advantage of multithreading between game loop and openGL

Talking in context of a game based on openGL renderer : Let's assume there are two threads : Updates the game logic and physics etc. for the in game objects Makes openGL draw calls for each game ...
0
votes
2answers
246 views

How can I represent a 2d UI?

So, I wanted to start building a desktop application, which is of course with an interface, and I thought that OpenGL would be best. The problem is, once I started following TheChernoProject's ...
0
votes
0answers
285 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
51 views

No local transform with skinned mesh with assimp?

I'm trying to add skeletal animation to my engine and I'm importing meshes with assimp, but I think I misunderstood the skinned mesh concepts (or don't understand assimp). When I import a model, ...
4
votes
1answer
76 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
44 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 ...
0
votes
1answer
110 views

How can I create multi objects in modern OpenGL?

I am trying to do make a 3D game in modern OpenGL where the player throws a ball and when it hits a cube, the score will be increased by one. I created a 3D object and camera. Right now I'm stuck ...

1 2 3
4
5
82