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
0answers
18 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
18 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
17 views

OpenGL obj loader fails to work

...
0
votes
0answers
26 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
32 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
16 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
25 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
52 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
44 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
51 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
22 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
38 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
26 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
27 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
41 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
88 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
20 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 ...
0
votes
0answers
20 views

Rendering a quad using VAOs and VBOs in LWJGL 3 doesn't work

So, I just started learning LWJGL 3 and I used a mixture of a couple of tutorials and example code to make something that should render a rectangle to a magenta screen using VAOs and VBOs. There are ...
0
votes
1answer
96 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 ...
0
votes
0answers
14 views

Stencil not working processing

With jogamp I can create the following stencil: ...
1
vote
1answer
42 views

PyBullet & OpenGL - Rotations are reversed in OpenGL [closed]

Project description: I am writing a basic game engine to help with my PhD topic on multi-agent learning. I am using PyBullet as the backend physics engine and OpenGL for visual display. I have OpenGL ...
2
votes
1answer
33 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
2answers
149 views

GLSL: How can I optimize this lighting (fragment) shader? Basic 2D game, 30+ light sources cause significant frame loss

I am using a fragment shader to create circular light sources in my 2D game. Full code at the bottom. Essentially, an array of light source objects (called Lights in the code) are passed into the ...
0
votes
1answer
48 views

Parts of OpenGL rendering area missing/transparent until resize

I am having a weird transparency issue when running my game in windowed mode. Parts of the window, left and top parts in normal window mode, right and bottom when in maximised window, become ...
1
vote
0answers
60 views

Wireframe shader sometimes won't render parts depending on camera rotation

I'm trying to make a stylized wireframe shader for a game using this method, but it seems to be conflicting with my character controller. Here's some images to better show what's going on: https://...
1
vote
0answers
35 views

Deforming a lip mesh to match face-tracking points

I'm creating a lipstick filter. I have a basic mesh for the lip shape ( 140 vertices ) which I am able to render on screen. I need the mesh since I have my own lighting system, and hence need the ...
1
vote
1answer
80 views

OpenGL texture2d/image sampling issue. Strange artifacts in texture

I have an issue when using textures in OpenGL, strange artifacts occur where geometry overlaps, but not always. Video Reference. I am using a GL_TEXTURE_2D with <...
1
vote
1answer
108 views

How front-to-back blending works?

I would like to implement dual depth peeling in my engine. I read the original paper and examined the corresponding source code. I understand the algorithm, except how the blending works, especially ...
1
vote
0answers
65 views

Transform the mouse coordinates to the GLSL plane

I am creating a 2D map editor in C ++ with GLFW. I want move and drag entities with the mouse, but I have a problem, the mouse coords are in the window size range (1200, 720) and the entity is in the ...
4
votes
1answer
91 views

Data structure for collecting entities for instanced rendering

My game, a citybuilder, has many simple entities that rendered via glDrawArraysInstanced. A large city has over 600,000 entities, but most of those entities are one of a few hundred meshes. Every ...
1
vote
0answers
30 views

C# OpenGL: How to translate a triangle

I am trying to translate/move a triangle 0.3 to the right. When I run the code below, it moves the triangle, but part of it is cut off, like it is in a set box (shown in images below). Code to move ...
1
vote
1answer
128 views

Why is my OpenGL triangle not drawing on the screen?

I am currently following this tutorial to create a simple game engine, but I am doing it using SDL and C++. I am stumped, however, because I can't get a triangle to draw on the screen, and I'm getting ...
0
votes
0answers
29 views

How to modify this old pre-3.0 OpenGL code to modern OpenGL?

I've done the getting started section on learnopengl website. However, that means I don't understand the old way of doing things, so I am struggling to understand some code I want to take a look at to ...
-1
votes
2answers
68 views

How to load 3D modells when they are necessary

I'm working on a 3D game engine, currently I load ALL of my 3D modells into the memory when my game starts, but obviusly there will be hundreds of 3D modells, so somehow I should unload them when they ...
1
vote
1answer
87 views

Trouble generating a depth map (black screen)

I am having trouble generating a depth map for my scene. I tried to figure out this issue a 2 weeks ago and got nowhere after days of trying to fix it, so I took a break and tried to tackle it again ...
1
vote
2answers
167 views

3D Camera Rotation (Unwanted Roll) - Space/Flight Cam

I am working on a camera class that will have full range of motion (pitch, yaw, and roll). When only altering pitch and yaw, I am getting a large amount of roll. I understand that the issue is ...
1
vote
0answers
58 views

How to use continious collision detection in a dynamic AABB tree

I am currently writing a game in c++ using openGL, and I am currently using a kinetic sweep and prune algorithm for the broad phase and then using GJK Raycast + GJK & EPA for the narrow phase. ...
0
votes
0answers
22 views

Can frame buffer objects in openGL ES have different kinds of attachments?

This question is with regards to the QT openGL app presented in this repository https://github.com/PRBonn/semantic_suma I am trying to run this application on NVIDIA AGX Xavier, however, I am getting ...
0
votes
0answers
28 views

How can I efficiently render a tile-based map with many Z-levels, where the levels act like hollowed out voxels?

My map setup is a little different to what you normally have with tilemaps. The map itself is a rectangular prism, with a width, height, and depth being variable. In my case, width is the x-axis ...
0
votes
1answer
61 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 ...
2
votes
1answer
105 views

Calculating Directional Shadow Map using Camera Frustum

I'm trying to calculate the 8 corners of the view frustum so that I can use them to calculate the ortho projection and view matrix needed to calculate shadows based on the camera's position. Currently,...
3
votes
0answers
47 views

Help in understanding atmospheric scattering shading

I have a made a planet and wanted to make an atmosphere around it. So I was referring to this site: Click to visit site I don't understand this: As with the lookup table proposed in Nishita et al. ...
0
votes
0answers
39 views

What's the difference between bloom and emission?

In my engine, I've implemented bloom but I also want to implement emission because some models that I have come with an emission map. It sounded to me like something adjacent to bloom but I guess it's ...
0
votes
1answer
65 views

2D Tile based game Texture Atlas combining

I am new to OpenGL and game dev, I have been to courses and trying to learing everything about this. My task is to implement a Texture Atlas in a 2D tile based game (very similar to Tibia) using ...
0
votes
0answers
81 views

Can I set the unity camera to have the same position in a real world?

I have a problem about setting the camera in the unity to have the same extrinsic parameters as my real world camera to the origin. So let's me describe my problem step by step. I have a camera in a ...
4
votes
1answer
4k views

How can I achieve simulated fluid surface deformation in a bottle?

I'd like to mimic this effect seen in Half Life: Alyx: I can't figure out what is going on here, people say "it is just a shader effect it isn't simulating anything", but I don't think that is true ...
0
votes
0answers
20 views

RayCasting implementation not working with camera rotations

I've followed several guides for a custom implementation of a raycasting algorithm for picking objects in my opengl application. This is my unproject function ...
0
votes
1answer
15 views

(While using a cube map) box-like textures appearing around my scene whenever I move the camera

I've been learning about cube map and I implemented one into my program. It seemed to work well until I started moving the camera around the scene and zooming out. As you can see in the attached gif, ...

1
2 3 4 5
81