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
0answers
47 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
35 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
0answers
70 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 ...
0
votes
1answer
28 views

Which to chose for 2D application QT vs OpenGL [on hold]

I need to develop a C++ 2D application with the following important points: It has a menu system. It needs to calculate statistics and display them as diagrams. It has 2D graphics elements such as ...
-1
votes
1answer
50 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 ...
0
votes
1answer
29 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
38 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 ...
1
vote
1answer
684 views

Depth texture white in shader

I am trying to implement shadow mapping into my project and am stuck at this problem: If I'm reading the shadow map values with glReadPixels and linearize those ...
0
votes
1answer
39 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
316 views

Why are some of my normals facing away from the camera?

I'm trying to use WebGL to render some simple models, and I'm running into issues where pixels near the edge of my model are passing normals to my fragment shader that point away from the camera. This ...
4
votes
1answer
1k views

Blank texture in Frame Buffer Object in Deferred Rendering

I'm running the tutorial 35 from olgdev.atspace.co.uk, and it's so strange that the result is a blank screen. This tutorial is performing the first step of Deferred Shading, which means decoupling of ...
16
votes
1answer
17k views

OpenGL: Resizing Display and glOrtho/glViewport

I have researched this question from several sources and have yet to find a firm answer saying that "yes that is correct thinking" or "no, here is how it's done." I am trying to ensure resolution ...
0
votes
1answer
27 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 ...
0
votes
1answer
39 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 ...
1
vote
0answers
31 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
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 ...
0
votes
1answer
29 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
34 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
vote
1answer
31 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) ...
2
votes
1answer
69 views

How can I make a transparent hole with shaperenderer using stencil masking in libgdx?

I'm making a 2d game, where I need a resizeable, moveable rectangle outline. I'm trying to use stencil masking to do it by cutting a hole in a solid rectangle, and I thought this would help: How can ...
1
vote
0answers
18 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
25 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
44 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 ...
5
votes
2answers
6k views

What does the identity matrix really do?

I understand that multiplying by the identity matrix is like multiplying by 1. Why would you multiply a matrix that will only contain the same result? Also, I'm experimenting with some OpenGL code ...
0
votes
0answers
36 views

How can I put the physical equations to make the hair movement realistic in OpenGL?

I'm new to computer graphics and OpenGL in general. I have to work on a project which simulates the movement of hair according to the physical circumstances like gravity, wind etc. But I don't have ...
5
votes
1answer
3k views

Render in a imGui Window

How do i render my game scene into an imgui window? I want to get from this: to this :
0
votes
1answer
26 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
0answers
65 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
88 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
48 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 ...
2
votes
1answer
49 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
2answers
161 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 ...
1
vote
0answers
36 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. ...
1
vote
4answers
993 views

Combine flat and smooth shading with a single model geometry

I need to be able to switch between smooth and flat shading interactively. Is there a way to do this efficiently with a single geometry? For example, smooth shading does not require duplicate ...
9
votes
1answer
3k views

What are screen space derivatives and when would I use them?

I see the ddx and ddy glsl functions and the hlsl equivalents come up in shader code every now and then. I'm currently using ...
0
votes
1answer
45 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
50 views
0
votes
0answers
16 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
39 views

OpenGL orthographic projection rendering quarter of screen

I'm trying to set up an orthographic projection so I can draw a rectangle using screen coordinates, but even if I draw a rectangle using the width/height of the window, it only fills a quarter of the ...
0
votes
1answer
38 views

OpenTK OpenGL wierd camera look

I am trying to implement a simple camera mouse look. ...
0
votes
1answer
34 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
3answers
328 views

Project rendering onto a polygon in the scene

I have a function that renders a simple OpenGL scene. I want to display this scene on a polygon within another scene, without the function having to know about it. For example, to display the scene on ...
1
vote
0answers
32 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 ...
2
votes
2answers
2k views

Calculating vertex normals in OpenGL C++

Does anyone knows a simple solution for calculating vertex normals? I've been looking for this on the internet but i cant find a simple solution, for example, if I have some vertices like this: ...
20
votes
7answers
8k views

Modern Shader Book? [closed]

I'm interested in learning about Shaders: What are they, when/for what would I use them, and how to use them. (Specifically I'm interested in Water and Bloom effects, but I know close to 0 about ...
0
votes
1answer
62 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
0answers
33 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
41 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
70 views

Running OpenGL app on Windows XP x86 produces incorrect texture colors

I'm working with the Cen64 emulator and I compiled from source a x86 version that operates fine on Windows 10 x64. As soon as I run it on a Windows XP x86 machine the colors are then all incorrect. ...
0
votes
1answer
31 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 ...