2022 Developer Survey is open! Take survey.

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
0 answers
28 views

Develop a program that 3D Models houses [closed]

Basically my program will consist of: Uploading/downloading a file of said 3D house that the user created within my program A coordinate system where said houses will be built with a camera that ...
0 votes
1 answer
387 views

when to unbind vao in drawing loops

I am very new to open gl and am struggling to understand relation between vaos vbos and ibos like how is currently bound vao related to currently bound ibo? now i am trying to render 4 triangles with ...
0 votes
1 answer
30 views

Correct camera transformation for first person camera

I am making a camera in openGl and I am having troubles with first person camera. So I had a few versions of camera transformation and all of them had their own problems. So at first, I was doing ...
1 vote
1 answer
691 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
0 answers
18 views

How to load an FBX animation file in ASSIMP?

I have an example from a LearnOpenGL tutorial which loads the animations. Now, I want to use that to render FBX animation, but the result is totally wrong. What I want is simply to load an FBX ...
2 votes
1 answer
80 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 ...
0 votes
1 answer
70 views

What's the difference between Unity3D rendering pipeline and OpenGL rendering pipeline?

I wanted to write small software renderer that will follow almost the same flow as OpenGL does, but got stuck with understanding of the rendering pipeline. After reading tons of info across the ...
0 votes
1 answer
337 views

text rendering artifact when rendering in 3D opengl GLfW

Main.cpp ...
0 votes
1 answer
31 views

glDrawArrays draws nothing in C. Trying to draw point in openGL(in C), no error but draws nothing

...
0 votes
0 answers
32 views

Function glBindBuffer access violation while executing

So I have a problem, I am calling some opengl frame buffer functions in my code but for some reason I get the error from the title. I am also calling many other opengl functions without any problems ...
0 votes
1 answer
299 views

TBN matrix for normal and parallax mapping

I'd like to refer to this question because I didn't completely answer to my problem. I've implemented normal and parallax mapping but because of some assumptions I have to use two different TBN ...
0 votes
1 answer
37 views

Why would some assets require a transposed TBN matrix?

I'm writing an OpenGL/DX11 Windows/Linux "engine" and I've encountered a confusing behavior in DX, specifically. For math, I'm using GLM, which means all of my HLSL ...
4 votes
1 answer
2k views

Why is my model rotating opposite direction around the Y axis?

I have a simple scenario. I have a simple scene, and in it I'm drawing a grid and a model, with some axis for orientation. I noticed when I rotate the model about it's local Y axis, if I rotate the ...
0 votes
1 answer
118 views

Tangent Space Light Direction Incorrect?

I have normal mapping with a directional light in place. I noticed the lighting looks off but am unsure why it is happening. I believe it is related to the TBN matrix and possibly the handedness fix ...
0 votes
1 answer
73 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: ...
1 vote
0 answers
58 views

Screen space reflections bug

I try to implement screen space reflections in my graphics engine using ray marching algorithm. After a lot of trying I got this result: https://youtu.be/yzkgpcliBVQ As you can see, the reflections ...
0 votes
1 answer
75 views

If I want to use textures and colors, how do I put them into my fragment shader?

I have many mesh objects in my scene and I have applied an image texture to some objects but I want to set different colors for the other objects. How do I do that? This is my fragment shader ...
0 votes
1 answer
92 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 ...
0 votes
0 answers
34 views

Having GUI on side rather than on game screen

How would I make it so that rather on the game screen the GUI is on the side of the screen and puts the game screen in its own little area so that its not covering part of the screen because right now ...
0 votes
1 answer
115 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 ...
0 votes
1 answer
193 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
1 answer
62 views

Simulating sprite shadows for a 2D top-down game

I have read some other posts with almost identical titles on here, but they are not exactly what I am looking for. (What I have seen come up a lot in 2D shadows is some sort of "ray-cast effect&...
1 vote
1 answer
98 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
1 answer
948 views

LibGDX - Draw multiple textures with different positions with one shader?

currently I'm optimizing my render calls by drawing multiple textures with one shader. The background textures who all share the same position are no problem. But now I want to draw some Textures with ...
1 vote
1 answer
196 views

Seam on UV Sphere [duplicate]

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....
1 vote
2 answers
262 views

How to keep same aspect ratio in different devices with cocos2dx?

I have been making a board game and I am using cocos2dx. There are two scenes for now, One is main menu and the other is gameplay scene. When I run the apk on tablet with EXACT_FIT resolution policy ...
1 vote
3 answers
354 views

Where did I lose vertex binding?

I make OpenGL render framework for my bachelor graduate work. I created simple Model and Shader classes. But when I tried to render some vertices, they do not render. I saw with an OpenGL profiler, ...
0 votes
1 answer
233 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
1 answer
176 views

Improve cube rendering performance in lwjgl

I've been coding a minecraft-like game in lwjgl using cubes. I've reached a point where I can render 6 chunks of blocks before it starts lagging. I've searched online for optimizations and one of the ...
0 votes
1 answer
87 views

Help finding coordinate for left of screen in this frustum

I have a frustum with l=-2, r=2, n=0.5, f=10, ...
0 votes
1 answer
303 views

Building an LWJGL jar file - java.lang.NoClassDefFoundError

EDIT: Recently got it working by making a batch file that does this: set /p CP=<cp.txt java -cp %CP%;testing.jar me.pale.main.Main and cp.txt is this ...
11 votes
3 answers
1k views

How to hide a post-processed mesh outline when/where the mesh is hidden

I'm working on setting up an active outline in my 3d engine, a highlight effect for selected 3d characters or scenery in the screen. After working with the stencil buffer and getting some ...
6 votes
1 answer
3k views

Drawing fonts with LWJGL3 with OpenGL

I'm very sorry if this question has already been answered, but since I've been struggling with this for many days I thought I'd give it a shot here. My goal is to somehow render some text on the ...
1 vote
1 answer
143 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: ...
0 votes
1 answer
109 views

VAO not showing

My VAO is simply not showing up and i'm not sure if my matrices are wrong or if the shader is wrong… Please have a look a see what is wrong… My code is big so i'll post the essential. ...
5 votes
1 answer
955 views

How to make Volume Heat Distortion effect in OpenGL?

I'm working on adding volume effects to an existent, open-source game engine. At the moment, the engine only supports two dimensional "thruster" bitmaps with a planar heat distortion drawn over the ...
0 votes
1 answer
243 views

OpenGL Parallax Displacement Mapping Not Working

I am attempting to implement parallax displacement mapping into my OpenGL code but it is not working as it should. https://imgur.com/a/9yIQL As I move around, double-lines moves around and if I am ...
0 votes
0 answers
27 views

How can I get look_at matrix from view_matrix?

I'm trying to set a look_at with the input of a view matrix, is there a way to do it? Because I know you can do the opposite (I think) where you set a look at and ...
0 votes
1 answer
35 views

LWJGL2 Camera Movement Stutter

I'm having quite some trouble with camera stutter in my LWJGL2 game. The stutter only occurs when moving the camera. When it stands still, the scene is rendered smoothly. I could verify that by ...
3 votes
1 answer
961 views

Specular Light not working (Phong Lighting)

There seems to be a problem with my current Phong Shading implementation. I have been using the per fragment approach. The specular highlight aspect of the technique is not rendering as it should, as ...
3 votes
2 answers
1k views

Pyglet: text.Label().draw to FBO?

I just started OpenGL (PyopenGl) & Pyglet 3 weeks ago, and decided to read the Red Book. So sorry if my question shows my lack of comprehension... My question is: Is it possible to display/write ...
2 votes
3 answers
1k views

What are "free vertex indices" in WebGL 2 and how do they relate to geometry shaders?

In January Notch tweeted about WebGL 2: WebGL 2 is happening. Bye, compatibility! Hello, 3d textures and pixel buffers! oh god it's got free vertex indices in the shader. That is basically a geometry ...
3 votes
1 answer
3k views

Rendering text with SDL2 and OpenGL

I've been trying to have text rendering in my OpenGL scene using SDL2. The tutorial I came across is this one Rendering text I followed the same code, and I get text rendering fine. However the issue ...
0 votes
1 answer
242 views

Offset on camera following object that accelerates

I have camera a that is actively following an object (a plane) from behind. This object can accelerate or decelerate. I would like to have a camera offset when I move the plane, so it doesn't look so ...
0 votes
0 answers
25 views

Per pixel shadows with depth / displacement map

I am looking to draw 2D sprites that cast artificial 3D shadows onto a flat terrain using an additional depth-texture when rendering the sprites. A black/white depth texture is used to add a height-...
4 votes
3 answers
1k views

How do I pick tiles from an isometric map with slopes?

I'm looking for a way to convert mouse/screen coordinates to isometric map coordinates, with the addition that the world has slopes and cliffs, and I have to be able to tell which quadrant of the tile ...
1 vote
1 answer
299 views

Sprite framework binding multiple textures

In an attempt to batch render as many quads (sprites) as possible, I'm instance rendering a single unit-sized quad and passing in a buffer of per-instance data that includes width/height, texture ...
4 votes
1 answer
4k views

FAST position reconstruction from depth

I'm struggling a lot with reconstructing the world space position (or alternatively the view space position) from depth (by reading the depth buffer) in a performant way (in a full-screen post-process)...
6 votes
2 answers
1k views

Atmospheric Scattering

I want to add some nice atmospheric scattering to my 3D game engine but I am very concerned with conserving resources. I am not very familiar with how its done but can someone please give me some ...
0 votes
0 answers
63 views

Implementing material (mtl) files into objects (obj) in LWJGL/OpenGL

I have an object loader that takes in textures, but when I try making some textures, they never turn out exactly how I want. I found out that a lot of them take a colour I want in one place and put it ...

1
2 3 4 5
84