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

How to deal with VBO and obj files for physics simulation?

I'm having a hard time struggling with obj files and clothing simulations. I first made the obj file processor class that deals with the typical obj file problem: having multiple indices for vertex ...
0
votes
0answers
51 views

Changing OpenGL Window Icon with JOGL

I am currently trying to change the window icon for my JOGL application. I have built my window off of the GLWindow framework and I have read that I need to link in with a framework like AWT, but I am ...
0
votes
1answer
30 views

glOrthof not being applied

I have had a problem with OpenGL where glOrthof is not being applied, leading to my frame having the default 1:1:1 ratio. Here is the code initializing it: ...
0
votes
1answer
67 views

Variable number of light sources

I'm going to be writing a very simple renderer, mainly for learning purposes (using OpengGL). I've been wondering about how to implement support for dynamic number of light sources. Two solutions that ...
0
votes
0answers
65 views

Quad tree Tesselation issue at edges

I am rendering an FFT ocean using a quadTree. The T-junction problems seem to be eliminated but i am getting some weird pattern beween the edges of tiles of the same size as per the attached image. ...
0
votes
0answers
64 views

GLFW Handling best practice

I'm currrently working on a small Game Engine using OpenGl. For Window and Context managing I'm using the common glfw library. At the Moment my glfw calls and callback functions sit kind of loseley ...
0
votes
1answer
88 views

Getting solid black color when texture is added to GLSL

I'm trying to apply the default badlogic.jpg image to a .obj I have. I'm currently loading the texture from AssetManager and creating a material with a texture ...
1
vote
0answers
45 views

Matrix for transforming a square to a quadrilateral

I have a square of points {<0, 0, 0>, <6, 0, 0>, <6,0, 6>, <0,0,6>} (The square is placed at the origin in the xz plane in opengl). Want to apply a transformation/s on the square and make ...
0
votes
0answers
98 views

OpenGL underwater masking using stencils

My goal is rendering some underwater effects (for example depth base fog) when the camera is underwater. The above water and below water are separated by the water plane which is based on the FFT ...
1
vote
1answer
89 views

JOGL KeyListener not functioning properly

I have been having a problem with the JOGL KeyListener where if I hold down a key, it would register the key as pressed for around 1 second, then it would start quickly switching back and forth ...
0
votes
1answer
34 views

How to calculate/structure/define rotation vector for OpenGL / WebGL

I am trying to define the buffer data for WebGL and want to have in there something that encodes the fact that an object might be rotating. So it makes me think of angular momentum. So if you have ...
1
vote
0answers
42 views

The gist of tweening with WebGL / OpenGL

I am trying to wrap my head around how to take advantage of shaders for things like tweening. For example, there are these simple easing equations, which we can use like this: ...
0
votes
1answer
158 views

OpenGL frustum extraction

I'm trying to extract frustum planes from the camera. The algorithm is simple: create clip to world space matrix (inversed projection * inversed view) multiply clip point by clip to world matrix ...
0
votes
1answer
201 views

How to use 2D textures in OpenGL / WebGL for physics [closed]

Following along the answer here, it was mentioned about textures: They can also store things like velocities. For example, you can use a texture as a "flow field" for animating particles or other ...
0
votes
1answer
36 views

Comparing the scale and rotation of (otherwise) identical meshes from vertex data

I am designing a tool that can read an obj file with duplicate meshes in, and export the transformation, scaling and rotation of each duplicate relative to the original model. I can establish the ...
1
vote
1answer
41 views

Comparing meshes and reducing duplication of data

I'm writing a class that reads an obj file, indexes each mesh and creates a VAO and GameObject of the appropriate type. I've stumbled on a design issue. Objects of the same name (Tree_A001, Tree_A002) ...
0
votes
1answer
56 views

How to use textures in 2D games in WebGL

I have been trying to figure out how to structure the VBOs in WebGL, and think that keeping them all together in one if at all possible sounds like the best approach. Right now I'm thinking of having ...
-1
votes
1answer
55 views

The types of buffers typically used in robust WebGL/OpenGL apps

I am trying to get a feel for how to structure WebGL/OpenGL apps and have been looking through sources for the types of buffers they use. I've found these: uvs occlusion noise bitangents tangents ...
1
vote
0answers
44 views

glBindVertexArray very occasionally causes crash

I'm writing a game in an engine of my own design. Very occasionally, and without much cause, when I come to render the post processing result to a quad, the glBindVertexArrays crashes. It actually ...
0
votes
0answers
43 views

How could the DOS Quake 1's pixelated look be achived with openGL, for example: Limiting the Colors to 256? [duplicate]

I want to achive the DOS Quake 1's pixelated look and limit the displayed colors to 256 in my engine, but I don't know how to do that. And also, I'm using java. Here is the code of my Fragment shader:...
2
votes
1answer
92 views

Mixing between two colours in fragment shader causes normal mapping to be ignored

I'm making a game in which the world is black and white except from the immediate area around the player. It all works, except the normal mapping breaks when I turn it on. If I set the output at just ...
2
votes
1answer
132 views

How can I create a pixellated, limited-palette appearance in modern OpenGL?

I wanna get some old art style (256 color, dithering, etc) in modern OpenGL in an effective way. Maybe using a low resolution (320x240) rendered at a bigger space so that the pixels looks "bigger?" I'...
1
vote
1answer
132 views

How do I make a gun alignment to camera matrix in OpenGL GLSL?

I am trying to program a FPS game with OpenGL. I am using 3D eight the OpenGL 3.3 programmable pipeline. I have a gun and a camera that I loaded. When I load all of the assets for the game, I put ...
0
votes
1answer
101 views

Should I make a FPS game on Fixed Function Pipeline or Programmable Pipeline OpenGL?

I have a “FPS” game I have programmed in Fixed Function Pipleline and one made in Programmable pipeline OpenGL. While the programmable pipeline has lots of weird things that you can edit, it does not ...
1
vote
0answers
66 views

Draw coloured transparent polygons on top of texture in modern opengl

I am trying to render an image in the viewPort using symmetry_create = 1 and binding texture to it. ...
0
votes
2answers
202 views

How can I benefit when I don't use gpu?

I am trying to make a 3D game with C++, SDL, and OpenGL. My program roughly looks like this: control function has only CPU operations. draw function has CPU and OpenGL functions operations. I just ...
0
votes
1answer
417 views

Camera view matrix from position/yaw/pitch/worldUp

I'm trying to make a basic FPS camera view matrix, using position, pitch/yaw, and worldUp. Currently, my camera's view matrix is just a plain rotation matrix (made with yaw/pitch/roll) and the result ...
0
votes
0answers
275 views

Having a hard time trying to render an OpenGL scene to ImGui window with deferred rendering

Here's the imgui window that i want my scene to render to. ...
0
votes
0answers
54 views

Calculating UV Coordinates in domain shader

Dears, I was trying to implement the terrain tutorial in Introduction to game programming by frank luna. I succeeded to implement it using the effect file. When I try to separate the Vertex, hull, ...
0
votes
1answer
104 views

OpenTK OpenGL wierd camera look

I am trying to implement a simple camera mouse look. ...
0
votes
0answers
139 views

Making a weapon stay with a first person camera

I was looking all over the internet for any information on how to get a gun to stay with a camera as done in FPS games. I am using OpenGL and GLSL to carry this out. I knew a way of how to do this ...
1
vote
1answer
163 views

How to render animated models via instanced rendering?

I have an animated model with a maximum of 60 bones. That means i have an array of 60 matrices when i want to render the model. Previously i would just create a uniform with the fixed size (mat4[60]), ...
0
votes
1answer
62 views

OpenGL Texture Zig-Zag Artifacts Over Time

I'm working on a deferred shading renderer in OpenGL, where I write all geometry output to Colour, Normal and Depth textures and then apply lighting effects later. Everything seems fine except once ...
0
votes
0answers
182 views

Flickering / tearing with glfwSwapBuffers

I recently separated my logic and rendering threads to fix this problem: GLFW window freezes on title bar hold/drag This means the logic and rendering are no longer running in lock-step as they were ...
0
votes
1answer
278 views

opengl - flickering of fragments even with disabled depth test

I'm trying to render a quad with a coloured border. I'm using texture coordinates to detect whether the fragment should be considered part of border or not. If it is part of border, then render it ...
0
votes
1answer
80 views

One VAO takes more time than more than 40 put together despite being simpler

I was running visual studio's CPU profiling tool when I noticed that of my RenderScene call, my skybox was taking up 30% of the frame time. This is particularly weird, as as you can see the Object3D::...
0
votes
1answer
52 views

Memory dataflow for uniform variables?

When a texture (2D) is supplied to a shader as a 'uniform' input, it is first uploaded to OpenGL using glTexImage2D() and then using glUniform1i() it is associated to shader uniform. eg code : ...
0
votes
1answer
82 views

Can we flip znear and zfar so that positive z values increase away from the viewer?

I am confused about the projection matrix in OpenGL. i have a habit of writing the code as follows. ...
0
votes
1answer
94 views

Orbital rotation equation

I am developing a space sandbox (3D). Now I am working on an asteroid belt around a planet. I have an Asteroid class and an ...
0
votes
0answers
188 views

OpenGL seamless repeated texture has artifacts on edges

I'm currently trying to map a seamless texture onto a 3d wall object but when it comes to the edges of the texture there are visible artifacts. closeup: Here is the shader code i use for the texture ...
0
votes
1answer
137 views

Is GL_DEPTH_COMPONENT32 deprecated in OpenGL 4.5?

I'm in the process of migrating our object oriented OpenGL wrapper from 3.3 core to 4.5 core. Some OpenGL implementations are notoriously permissive on what inputs they'll accept which can make ...
0
votes
1answer
27 views

I add a straight big plane over terrain(3d). Vibrations are happening when i move camera

I have this problem in my OpenGL project but i will show you the same thing over blender3d with video. So I believe that I will better explain the problem. it is just 30 seconds. Take a look. Youtube ...
0
votes
0answers
333 views

Compiling a simple shader in PyOpenGL

I am starting with OpenGL and I am translating the code from learnopengl to python and for some reason I am not being able to compile the Vertex Shader. This is all that I have: ...
0
votes
1answer
233 views

Game Engine Renderer Architecture

I'm currently building a game engine renderer but I got stuck when I had to separate engine and client code. I had been following OpenGL tutorials to learn about buffer creation, etc so all my code ...
2
votes
1answer
171 views

Mesh rendering performance optimisation

I'm working on a libgdx implementation of mesh terrain and running into some performance issues. The terrain is represented by a number of mesh tiles, each mesh is made of vertices laid onto a 2D ...
0
votes
0answers
28 views

scale on z axis move

At the position z = 0 my box has size on one side 0.2. When, for example, I move it to z = 1.5, size of it scale up. I've trided to calculate it by using triangle formula z*tan(fov/2), but it does ...
0
votes
0answers
80 views

Render Pygame sprites with PyOpenGL

I am using Pygame for rendering my sprites, however that work is done on the CPU side. For performance reasons I would like to change to drawing those sprites using PyOpenGL. How can I take textures ...
0
votes
0answers
56 views

Perspective projection matrix with a non-orthogonal near plane

I'm trying to figure out a way to provide such a perspective projection matrix to a shader that the "near" plane wouldn't necessarily be orthogonal to the camera vector. More specifically, I'm ...
0
votes
0answers
61 views

Specular/Diffuse light on an icosahedron opengl

I'm having a problem with my model here. I draw an icosahedron using GLUT, and the edge length is set to 0.8. The info of the coordinates are listed below: (X and Z are calculated since our edge ...
0
votes
1answer
62 views

split/divide/extract/separate mesh indices&vertex in n

I'm totally lost. I'm trying to split/divide/extract/separate a mesh into sub-meshes via bbox test. But I just realized that I need to properly split indices and vertex and I have no idea how o.o... ...