People who code: we want your input. Take the 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
1
vote
0answers
10 views

How to fix shadow not casted to terrain when rendering using default and terrain shader (depth shader included)?

Given that I have the TerrainShader class and DefaultShader class. Also a FBO (Frame Buffer Object) shadow map The ...
0
votes
1answer
11 views

OpenGL translation based on “scaled” pixels? (Not physical pixels)

My (2D!) game runs in a “scaling mode” so to speak, and I’ve yet to find anyone asking this question anywhere. Basically, I want to achieve a sort of “scaling algorithm” whether graphics are ...
1
vote
0answers
34 views

How to move the shadow map with the camera?

I implemented a directional light and a shadow map for that light based on learnopengl.com tutorials. And it is working great, but I would like to move the shadow map with camera/player, so I have ...
0
votes
0answers
21 views

What is a correct approach to gamma correction in OpenGL?

I'm currently reading about the topic of gamma correction and am a bit confused about what should I, as a game developer, do about it. There seem to be a few options here: Don't do anything at all ...
1
vote
0answers
15 views

OpenGL Per-Object Outlining issues

I'm trying to draw onlines around the objects, the outlines for any object should be see though very other object, I've successfully been able to draw the outline but the pixels get discarded in the ...
0
votes
0answers
53 views

Reading Minecraft-like binary files in Java and LWJGL 2 [closed]

I decompiled the first Minecraft version (rd-132211) using jd-gui and recompiled it. After recompiling, running Minecraft had no problem except screen size problem ...
1
vote
0answers
29 views

How to move player camera with mouse in LWJGL 2?

I making a 3D game like Minecraft in LWJGL 2 and now, I want to move player camera with mouse like Minecraft. Here are the codes I have: com/kg/kgcraft/KGCraft.java: ...
0
votes
1answer
51 views

Shaders overriding other shaders

Recently, I've been making a 3D game and I have been having trouble with making multiple shaders. I've researched this for a bit, and told that I had to use ...
0
votes
1answer
34 views

glm::perspective() with wide field of view

I'm still pretty new to this GL stuff, but I've managed to put together some C and C++ code that allows me to construct simple 3D objects consisting of line segments and display them on my laptop ...
0
votes
0answers
22 views

Python Opengl Procedural Terrain Rendering

I am rendering procedural terrain in Python using OpenGL. Once generated, data for each terrain tile is stored in lists. However currently I am only getting around 25fps despite rendering only around ...
0
votes
0answers
16 views

Slick-Utils texture not loading after binding to FBO

Recently, I am making a 3D game using LWJGL, and finally got framebuffer textures to work! The problem is, though, is that I think the default shader that is used for the cube doesn't work or the ...
0
votes
0answers
19 views

How many texture units are available per shader stage when compared to the total number available on hardware?

The answer to the question How many textures can usually I bind at once?, given here, explains that: OpenGL 3.x defines the minimum number for the per-stage limit to be 16... and that there can be a ...
0
votes
0answers
16 views

Issues with percentage closer filtering

I'm trying to code a simple game via OpenGL C++. I've implemented a point light, parallax effect with textures, objects from blender etc. but I seem to have an issue with my percentage closer ...
0
votes
0answers
15 views

FBO not rendering or changing anything

Recently, I am making a 3D game. I want to do special post processing effects, like pixelization. I used this to load do everything with FBOS, but it's kindof weird... In some code for the ...
1
vote
1answer
35 views

Post Processing without using FBOs?

Recently, I've been making a 3D game (hint hint my questions), and I recently have modified a pixelization shader from a unity shader graph tutorial. The thing is, I want to render the shader on the ...
-2
votes
0answers
35 views

How to color individual faces without arrays

Recently, I've been making a 3D game in LWJGL. I want to use shaders to control the "brightness" of each face, but in order to do that, I want to test to color each individual face first, ...
2
votes
1answer
70 views

OpenGL height map accuracy for planetary rendering

I am trying to implement planetary rendering and I am trying to use OpenGL tessellation to model the terrain. Here is an overview picture using cube faces projected onto a sphere: If I use the ...
1
vote
1answer
25 views

Find out triangles that are not occluded from a camera view?

For a project i need to find out triangles that are directly seen by the camera / user. Triangles that are occluded by other triangles should be ignored. There may be 200 thousand triangles in a model,...
0
votes
0answers
16 views

OpenGL never reverts to default FrameBuffer

So I'm trying to change the texture using FBOs, When I run it, The whole game gets drawn in the new FBO that I created then deleted, Here's the function ...
0
votes
0answers
16 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
35 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
38 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 ...
3
votes
1answer
113 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
49 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
21 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
19 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
33 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
48 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
37 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
15 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
23 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
34 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
47 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
69 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
35 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
24 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
26 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
81 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
49 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
50 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
85 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
66 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
60 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
25 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
58 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 (...

1
2 3 4 5
83