Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
23 views

How to implement trail renderer like unity?

I wang to implement a trail renderer in my course about compute graphics using OpenGL. I google this question and search it in https://gamedev.stackexchange.com/ and find nothing except unity trail ...
0
votes
0answers
14 views

Cascaded shadow map proplems

I am implementing the cascaded shadow map technique with OpenGL and C++, I have some strange behaviors I think my issue with calculating the frustum orthographic matrices, corners and cascaded ends, I ...
0
votes
0answers
26 views

How can I get rid off the imprecision of the model matrix when I using WGS84 as the coordinate system to render the earth?

The global coordinate of WGS84 is too big, a float is not accurate enough. The only two ways I can come up with are using dmat replace for mat or transferring the modelview matrix rather than the ...
1
vote
0answers
22 views

MousePicking in LWJGL - How to do it?

I have been working on a mouse picker for a scene in 3d for a client, and been having issues implementing a proper mouse pick. His application does not use a camera, and I am trying to get the ray ...
0
votes
0answers
15 views

How to use opengl3.3 with CUDA using OpenGL Interoperability

I want to render a mesh whose vertices and surfaces are populated and constantly updated inside the GPU. For simple rendering using opengl3.3 alone, I have brought out the data from the GPU to CPU ...
0
votes
1answer
34 views

Texture Glitches When Drawn to Quad

Recently been trying to implement volumetric lighting. The alphaness texture comes out perfectly on Renderdoc, however a strange glitch occurs whenever I either try to directly render the texture ...
-1
votes
0answers
17 views

Question about shading and passing normals to shaders - beginner

hello i'm a beginner to OpenGL. I followed this site up to tutorial 6: http://www.opengl-tutorial.org/beginners-tutorials/tutorial-6-keyboard-and-mouse/ I am trying to turn it into a voxel engine, my ...
1
vote
0answers
35 views

OpenGL VAO buffer rebinding vs binding switching

I'm considering two different approaches to vertex buffer management in my OpenGL game engine. The first one seems to be pretty usual, but I haven't seen the second one being proposed or used anywhere....
1
vote
0answers
90 views

Modern OpenGL, 2D only, should I be using uniforms or VBOs for sprite transformation?

I'm new to OpenGL, I'm currently building a 2D game engine. Right now I'm only using one shader as I only draw textured quads (basically sprites). The thing is... I don't know if should I be using ...
0
votes
0answers
21 views

Alpha blending works when rendering to an FBO, but not when rendering to the screen buffer

My rendering pipeline goes something like this- Bind multisampled FBO Render GameObjects Render Transparent Objects Blit multisampled FBO to normal FBO perform any Post processing Render a quad ...
0
votes
1answer
41 views

OpenGL Fragment Shader simulate LCD slow response time

I have a very simple OpenGL view rendering 2 triangles with a single texture applied. The minimum setup for rendering a 2d game. What i do is redraw the texture for every frame and easily get 60fps. ...
0
votes
0answers
32 views

Particle system and 3D scene not getting rendered together

I have been following this lesson for implementing a particle system inside a 3D scene whose code is here in github. My entry point and initialization looks like : ...
0
votes
1answer
21 views

glReadPixels with GL_DEPTH_COMPONENT into PBO is slow

I need to read depth buffer back to cpu memory. It may be few frames old, so I use glReadPixels with a buffer bound to GL_PIXEL_PACK_BUFFER. I use several buffers and ping-pong them. Finally, I read ...
0
votes
0answers
28 views

How to reproduce examples from ShaderToy on my computer?

I am a beginner with computer graphics. I have some experience with drawing polygons, shaded surfaces, the use of geometry shaders, etc. I am trying to create a volumetric cloud/volume render shader ...
0
votes
0answers
26 views

how would I render particle system in a 3D scene in Opengl 3.3

I have a scene that imports .obj (Wavefront) files and I have written the shaders for rendering them in a scene with multiple light sources. Here are my Shaders: Vertex Shader: ...
0
votes
1answer
41 views

OpenGL 2D Game Render Help

I just recently started using C++ and OpenGL and I am running into an issue. I am not totally sure what I am doing so could you please tell me what I am doing wrong and what I could improve? Here is ...
1
vote
0answers
40 views

Random lines drawn on screen while all vertexes are correct

I'm writing a 2D program in which a monocycle follows a Catmull-Rom spline. My problem is when I write the circle, the drawing goes crazy. There is one line on the screenshot (which seems to be 3 when ...
0
votes
0answers
20 views

When trying to render a texture in opengl after including the stb_image.h file in the project i get a linker error

Initially i gave the path of the stb_image.h & stb_image.c file location C/C++ include directories as adding the header file directly to the project was not working.
0
votes
1answer
69 views

Bullet Physics Integration - direct movement of rigid bodies

I'm adding bullet physics to my engine. The physics simulation bits are all working nicely, but one bit I'm struggling with is being able to move objects using their co-ordinates, and then have them ...
1
vote
2answers
69 views

Wrong FPS calculations in GLFW game

In my game loop, ...
3
votes
1answer
57 views

Octahedral impostors, Octahedral mapping

I'm facing some issues understanding this article about octahedral impostors. More specifically I quite don't understand how one can map the hemi-octahedron (subdivided) vertices to texture ...
0
votes
0answers
18 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
24 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
28 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
50 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
61 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
44 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
38 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
41 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
72 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
41 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
29 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
36 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
31 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
49 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
34 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
33 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
36 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
53 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
22 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
26 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
52 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 ...
0
votes
1answer
28 views

Convey screenspace bounding box of rendering result

Imagine I render to an FBO some arbitrary geometry. Geometry can be rendered via single or multiple draw calls. For the sake of the question, assume I know nothing about geometry or transformation ...
2
votes
1answer
92 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
96 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
64 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
44 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
170 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
79 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
65 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. ...