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

How to set camera coordinates without making a Camera class?

Recently, I have been making a 3D game (and asking alot of questions about it), and yet again, I've run into another problem. I'm trying to rotate a cube across the "camera" origin, which is ...
1
vote
0answers
26 views

How to properly delete unwanted models

I am implementing bullets into my game, and each bullet has a lifetime. Whenever the bullet has existed for a set amount of time or collides with an object, the bullet should be deleted. I implemented ...
0
votes
0answers
35 views

Help needed to render textures using fragment shader (or procedural textures)

Recently, I have been making a 3D game. I was messing with my shader files, when I ran into a problem. The "texture" I made for the fragment shader just renders on top of the object, and ...
2
votes
1answer
72 views

What is GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS?

I am a beginner in OpenGL. I am learning about textures in OpenGL. What I don't understand is how to determine how many texture units are in the GPU. I heard someone said that you can see how many ...
0
votes
1answer
39 views

Need help getting an objects orientation / all my OpenGL rotations are reversed

I'm using OpenGL on Ubuntu Linux with the Eclipse IDE and the GCC compiler. I am bringing blender models into a homemade renderer/game engine. I parse a text file containing object descriptions to ...
0
votes
0answers
20 views

How to a select a single 3D object out of multiple objects using mouse click and move it using mouse drag in OpenGL

I am rendering multiple 3d objects on the screen but i want to select one particular object by clicking on it and then move it using mouse drag but i cant figure it how to do it because on clicking ...
0
votes
0answers
21 views

Not clearing FBO's Texture error in battery economy mode

When rendering inside a FBO's texture, I'm not using glClear() but overwriting each fragment, GL_BLEND is set to true. This works just fine, but I just realised when my laptop switch to economy mode, ...
0
votes
0answers
18 views

Screen space reflections shown at incorrect position

I have been trying to add a SSR post-processing effect into my engine for a while now, but it always seems to fail on the same thing: Reflections are not properly positioned below the object instead ...
0
votes
1answer
32 views

Lag Spike When Creating Model

I am creating a game using OpenGl in c++. Whenever I create a new model while the game is running, such as fire a bullet, there is a huge lag spike. The function that creates the model is below. ...
0
votes
0answers
45 views

How can I optimize this blur shader?

I'm trying to do a bit of shader development. I found this optimized version of gaussian blur (shadertoy demo), rewrote it in ShaderLab:: ...
0
votes
0answers
25 views

openGL - Updating instanced model transform in vbo every frame

I am using OpenGL to render a large number of models by instanced rendering (using LWJGL wrapper). As far as I can tell I have implemented the instancing correctly, although, after profiling, I've ...
0
votes
0answers
14 views

Skinning on simple model doesn't work as expected

I have created a simple application to make skinning work with OpenGL. so I want to share with my vertex shader: ...
0
votes
0answers
20 views

OpenGLHow to fit a texture to a curved plane with GL_CLAMP

I'm trying to fit a texture on a curved plane made from some triangles with GL_CLAMP, because GL_CLAMP_TO_EDGE is not available ...
0
votes
0answers
34 views

What does glBlendFunc(GL_DST_COLOR, GL_ZERO); mean?

I need to write a description about a filter method I made but I don't know what glBlendFunc(GL_DST_COLOR, GL_ZERO); means.
0
votes
0answers
34 views

Single Array Texture, multiple wrap modes

I have a array texture of which I would like some of its sub-images have wrap modes of GL_REPEAT and others to be ...
1
vote
2answers
22 views

unsmooth blending with deferred shading and light volumes

So I implemented deferred Shading with a single full screen light pass (picture 2) (by passing the light-data as an array to the shader) and deferred shading with point light volumes (picture 1) (by ...
0
votes
1answer
29 views

convert world to screen coordinates with camera position and camera angle

Heyho :) I'm trying to convert world coordinates to screen coordinates. I have available: fov, screen width, screen height, camera position, camera angle and obviously the position of the object in ...
0
votes
1answer
45 views

Distance between moving, rotated rectangles in snake game

I am trying to implement basic Snake game with movement based on timestep. For now I've got something along those lines: Update function: ...
0
votes
2answers
68 views

Vertexes passed to OpenGL becoming zero

I've got two methods of test code. The first uses a single VBO with the vertices and texture coordinates interwoven to draw a square to the window. The second uses an array of three VBOs to define the ...
2
votes
0answers
33 views

OpenGL : Blending & feedback effect

I'm struggling on a simple project, as an example/sandbox, I'm rendering a small oscillating rectangle on my output. I'm not using glclearcolor() but instead, on ...
0
votes
1answer
20 views

Depth to World Space Position problem

I am having a problem with turning depth to world space position. I am using GLSL. What could go wrong? Here is the code: ...
-1
votes
1answer
24 views

How can I add one OPENGL page to another when ENTER key is pressed?

I created one GLUT project which has my project's introduction page. When I pressed ENTER key, it should redirect to my front page of project which I created as another project.
4
votes
0answers
76 views

Why use sprite tile maps on the GPU in WebGL?

I'm trying to figure out the best way of rendering my layered tiled maps with WebGL, and have come across this tutorial several times: https://blog.tojicode.com/2012/07/sprite-tile-maps-on-gpu.html ...
1
vote
1answer
48 views

Seam on UV Sphere

I created a uv sphere model in Blender, and I'm loading it as an obj into my OpenGL game. I'm attempting to model a 2d image as a texture for this sphere to make the moon, but I've run into this issue....
0
votes
0answers
49 views

OpenGL fixed function - WASD 2D movement

I need to make a simple object (like a turtle) move on a 2D scene. The keys w, s, a and <...
1
vote
1answer
76 views

Why does my stencil buffer allow pixels through?

I'm rendering a scene using OpenGL. The scene consists of a grassy environment and a small lake (visible as two surfaces). To achieve water surface transparency, I'm using a stencil buffer to render ...
0
votes
2answers
49 views

How to process events as well as do OpenGL rendering using multithreading?

I am working on a very complicated graphics rendering, using OpenGL, and it is very time consuming, in the sense that it creates a delay in the event handling, of my application to an extend that, the ...
0
votes
1answer
51 views

What is the proper way to create a camera matrix?

I am having issues when trying to create a camera transform. It seems to have odd distortions and it does not seem to rotate properly, though it will translate alright. While I have seen issues like ...
1
vote
0answers
35 views

How can I reduce a frustum to the subset that passes through a portal AABB?

I'm trying to implement portal based occlusion culling: There are sectors and portals. When a portal is visible, the sector it is connected to is rendered. The sector is made of polygons and ...
0
votes
0answers
22 views

WebGL transparent gradient mask at edge

I need to make a feature in WebGL, where I have horizontal list of meshes (example 20) and I want to show only 3 and 2 at edge are fade in/fade out. And it slowly animates from one side no another (...
1
vote
1answer
53 views

Why is my tessellation output failing to reach my geometry shader?

I'm attempting to render grass using GLSL tessellation and geometry shaders. For vertex input, I'm using position and normal. For reference, here's an image of the grassy field without tessellation (...
0
votes
0answers
51 views

For drawing many layered 2D tiles, should one use the painter's algorithm, or Z-buffering?

Sorry if this question doesn't make sense, I'm still very new to WebGL / OpenGL. Basically, I'm trying to draw a tilemap similar to the one in Stardew Valley. Here's a screenshot from that game: https:...
0
votes
2answers
68 views

Generate vertices of a sphere by using spherical coordinates

I'm trying to generate points for a sphere by subdividing the space of spherical coordinate in res sector and res slices. At first I did my own implementation, but it wasn't working. After a while I ...
1
vote
0answers
38 views

What is the best way to bake my own environment maps?

My engine has support for IBL by using pre-obtained HDRIs. It looks fine, but... I want the environment map to match the scene that is currently being rendered I want the environment map to take the ...
0
votes
0answers
94 views

How to update vertices and indices in OpenGL

I want to change and update the vertices and indices of the 3D object. I am new to openGL and I do not know if this the right place to ask this question. I searched and read about that, and I found ...
0
votes
0answers
78 views

How to draw a rectangle at x,y where x & y are in pixel?

Here is my code : ...
0
votes
1answer
32 views

OpenGL GLSL ES 3.10 - Referencing a uniform variable, causes the vertex shader to not draw anything

I have this project, that has a default shader, that just draws models and textures. Recently I decided to add a second shader that does a fancy effect, and is used only on some of the objects drawn. ...
1
vote
1answer
56 views

Problems with porting LWJGL code to C++ (glDrawElements call returns error 1281/GL_INVALID_VALUE)

So, as the title might suggets, I'm currently trying to port a gui stack for my game engine from LWJGL(Java) to C++.I originally had this following code in java: ...
1
vote
2answers
97 views

Why would I want to set a minimal OpenGL version before creating the context?

Typical GLFW applications have these lines after glfwInit(): ...
1
vote
1answer
89 views

OpenGL - Debug version runs faster than Release version

My Visual Studio 2019, 64-bit version of Tetris using OpenGL runs significantly faster, 3X, in Debug mode than in Release mode. The image above shows the board. Each cycle of the rendering or game ...
0
votes
0answers
74 views

How to implement PCSS properly?

I'm trying to implement PCSS in OpenGL/GLSL, but I have problems understanding the details especially the conversions between the coordinate spaces. The existing implementations are so different from ...
1
vote
1answer
89 views

How does glm::lookAt produce a View Matrix?

Say we do this: glm::mat4 View = glm::lookAt(glm::vec3(4,3,-3), glm::vec3(0,0,0),glm::vec3(0,1,0)); And after printing to the console with glm tostring (column ...
0
votes
2answers
48 views

Rotating an object to face the same direction as another object

Feel like I should know this, maybe I'm just over thinking it. What I'm attempting to do is create a bullet hole plane/texture object on top of an existing mesh when a ray cast returns a hit point. I ...
2
votes
1answer
58 views

2D shadow from polar coordinates has hard cut-off at a certain radius

I'm trying to cast shadows from a 1D texture that goes from white to back according to the distance given by an occlusion map. That part I think I got it right. The problem lies on the algorithm to ...
0
votes
1answer
171 views

Understanding how to use Quaternion to rotate object

I m having hard time to understand Quaternions and to use them in my engine for rotating object. I m looking for step by step explanation, actually a correction of my view of Quaternions. Here is how ...
0
votes
0answers
26 views

Rendering overlapping normal map textures to a 2d scene efficiently

I am using modern OpenGL to render a 2D non grid/tiled world map. I've generated some simple normal map textures to render over the base world map to provide terrain elevation/detail shading. ...
0
votes
0answers
10 views

using glew glviewport cannot get the correct proportion of a window

the generated window resolution is (1334, 750) when i call glViewport(0, 0, 1334, 750); the whole window is filled, but when i ...
0
votes
1answer
35 views

set model to transparent where texture is transparent

I finally got around to applying textures to my game, and I noticed that the areas that are transparent on the .png of the texture are not transparent on the actual model.It is illustrated in the ...
0
votes
0answers
58 views

Speeding up map rendering

My map loading and rendering process is slow when using very large maps, so I'm looking for ways to make it more efficient. My current solution works like this: My map loader uses for loops for ...
0
votes
0answers
45 views

How do I make the 3rd person camera follow the space ship in my Space Shooter game?

https://youtu.be/13HgaeZWlIA I am making a 3D space shooter game using OpenGL and Bullet Physics. I am having a hard time with the 3rd person Camera though. If you take a look at the video above you ...

1
2 3 4 5
82