Stack Exchange Network

Stack Exchange network consists of 174 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.

1
vote
1answer
64 views

GLSL shader time uniform freezed?

I have a simple fragment shader to simulate "falling water". I'm using Ogre3D and opengles2, this is my code: ...
2
votes
2answers
154 views

Sobel Edge Detection on Depth Texture

I'm currently trying to implement contour shading via edge detection on a depth texture. I'm rendering the color and depth information onto two textures. In my post processing shader I do the ...
1
vote
0answers
31 views

2D pixels change size when scrolling [duplicate]

I'm working on a 2D side-scroller, OpenGL, pixel art. And I'm having trouble getting the pixels to remain square when scrolling the camera. By that I mean, when scrolling the camera at low speed when ...
3
votes
1answer
87 views

Do I have to take aspect ratio into account, when computing a direction in View Space?

I read an article about implementing a Single-Pass Volume Renderer. After thinking about it, I have a question, which concerns the provided GLSL code snippet of the Fragment Shader. To calculate the ...
1
vote
1answer
39 views

UnrealEngine4 “backwards compatilibility”: Can I view a site that uses Unreal Engine4 on a very old laptop and still see in high definition?

Backwards compatible? The project: I want to render a high definition model on my personal website such that it'll be rendered in the highest definition possible on any device, from a 20-year-old ...
1
vote
1answer
58 views

Sorting sprites based on Z index

I am working on a 2D game engine in C# using OpenGL. I am trying to find a collection to satisfy my needs for sprite ordering, and I can't seem to find the combination of performance and functionality....
0
votes
2answers
56 views

Camera scrolling hiccups

I'm working on a 2D side-scroller, and I've got the technical aspects working. OpenGL renderer, camera movement using acceleration. However, while scrolling I'm constantly seeing tiny random hiccups. ...
2
votes
1answer
56 views

Texture being rendered to main frame buffer?

I'm using Ogre 1.10.12 (openglES2 as render system) to create a manual texture like this: ...
1
vote
1answer
117 views

Unexpected lighting on cube

I am following a tutorial for 3D game development in Java, using LWJGL. I have completed all chapters up to chapter 14 - Terrain, inclusive. The tutorial is in Java, but I'm using Scala. My full code ...
1
vote
1answer
120 views

Difference and interaction between Viewport and Camera

I'm very very confused about some very basic concepts in game/grafical developing. The interaction between the individual components (camera, viewport, window-sizes, gameworld-sizes, ...) when ...
0
votes
1answer
85 views

OpenGL is not drawing model with more than one material

I have model created in Blender that have 3 UV Maps, 3 materials and each material has texture. Below you can see it. Also I have OpenGL application that draw this model. Application is working ...
1
vote
1answer
81 views

Game not responding on different computer with Intel graphics

I have a game that uses SDL2 and OpenGL 3.3 with Visual Studio. It runs fine on the computer that built it, but it did not work on other Windows computers. Initially, it would complain about missing ...
1
vote
1answer
64 views

Nvidia High Performance Processor Setting leads to graphical bug (Seizure Warning) with current lighting system, drawing completely in the shader code

I followed the Lighting tutorial on learnopenGL, modifying some of the code to work in a 2D game engine. Everything was looking great and my team got our game done and the lights were quite simple for ...
0
votes
1answer
188 views

Rendering multiple objects in OpenGL

I am using advanced OpenDL methods (VBO, VBA, ...) to render over screen. Currently I abstracted vbo, vba, index buffer, texture, and shader to a class called 'Object2D'. I tried to render two ...
0
votes
0answers
157 views

Drawing 2D text over 3D scene OpenGL3.3

I got a question regarding rendering a 2D text over the 3D scene in OpenGL 3.3. I followed this tutorial about how to render text in OpenGL. Although the tutorial is for C++ i ported it to Java (...
2
votes
1answer
82 views

OpenGL Outlining Cubes in a Greedy Meshed Mesh

So I've managed to get myself a greedy meshing algorithm implemented for a little voxel game I'm developing to teach myself LWJGL/OpenGL, and it's going great. The thing is, I don't plan on using ...
0
votes
1answer
186 views

Using multiple shaders in OpenGL3.3

guys, I got a question on how to use multiple shaders in my app. The app is simple: I have a 3D scene, say, simple game and I want to show some 2D GUI in the scene. I was following this tutorial on ...
0
votes
1answer
80 views

How to scale-to-fit OGL viewport to GLFW window?

Say my window is 1280x720. I want to render my stuff to lower resolution and then stretch it to window. I've tried this: glViewport(0, 0, 1280 / 2, 720 / 2); ...
3
votes
1answer
293 views

Overcoming fill rate and generation bottlenecks in voxel engine

I decided to make a voxel engine using octrees. I am instancing entire cubes and sending the sizes and positions to the vertex shader. I currently have 2 major problems: Problem 1 - Because the ...
0
votes
1answer
41 views
0
votes
1answer
52 views

Opengl Postprocessing draws only white

I'm currently trying to implement post processing into my project. First I configure my framebuffer: ...
0
votes
1answer
72 views

textelFetch returns black value with sampler2D when level is greater than 0

I am trying to write a code for rendering a object with material properties (diffuse and specular). I am trying to use textures to pass float data to the vertex shader (I am accessing the textures in ...
0
votes
0answers
29 views

Artificial, deliberate, per-object aliasing

I'm making a 3D game with a retro feel1 and would like to shade a single object in such a way that the edges and colours look aliased: that is to say, it should look like the spatial sample rate of ...
0
votes
1answer
38 views

What are valid ranges of space dimensions used in OpenGL?

I want to know what the valid ranges of all the spaces in OpenGL are. Specifically: Maximum and Minimum Clip space X, Y, and Z (gl_Position) Maximum and Minimum <...
0
votes
0answers
32 views

Texture filter and atlas image distortion problem

I have a question about premultiplied alpha images, texture atlas and texture filter (minification with bilinear filter). (I use correct blending function for PMA and all my images are in ...
0
votes
1answer
98 views

How to rotate a sprite in 2D with LWJGL3 and GLSL

I have all the basic rendering already set up, with translation, scaling etc. What matrix(s) and/or vector(s) do I need to multiply/add with my existing code to rotate an object. Preferably around a ...
0
votes
1answer
42 views

Calculating the shadow cast by triangle onto the YZ plane

So, one of the exercises for my computer graphics class is as follows: Calculate the shadow cast by triangle T onto the YZ plane P. given: Triangle T coordinates: A=(30,10,16) B=(32,11,18) C=(31,...
0
votes
0answers
222 views

Why is Assimp mOffsetMatrix different from inverse bind pose

I am doing skeletal animation and my model gets distorted. I suspect it was because of the inverse bind pose, which I calculate by concatenating all the mTransformation starting from scene->rootNode ...
2
votes
2answers
127 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 ...
3
votes
0answers
64 views

How to implement a pannini projection in opengl?

I have read about the pannini projection, which involves (I think) projecting a scene onto a cyclinder instead of a rectangle. How can I implement this projection in a vertex shader? Blinky is using ...
0
votes
1answer
291 views

How to pass vector<struct> to GLSL shader?

I am using core OpenGL to draw fonts. This works when I do just one font set at a time. Now I am trying to use three different sets in an array. I have this structure: ...
0
votes
0answers
41 views

How can I stop texture from becoming blurry when looking at it from an angle? [duplicate]

currently I am working on a simple opengl renderer in c++ and have have a basic scene with textures. The problem is the textures become blurry when looking at them from an angle but look completely ...
1
vote
1answer
221 views

Cross-platform GLFW build with CMake

I know this is probably a popular question and can be very vague, so I'm going to be as specific as possible. I don't really know how to even form this question to be able to search Google, so I came ...
0
votes
0answers
25 views

Element Buffer Object size for shared VAO

I want to store my indexed geometry in a shared vao. If the current vao is full, I create another vao together with the buffers for the layouts (Pos, Normals, Uvs, etc..). I create them with a ...
0
votes
1answer
32 views

Custom Model Format & Loading

I've been working on a small engine for educational purposes. I understand that going production with "raw" model files like .obj is wrong mostly because of parsing and loading time. Thus, I want to ...
0
votes
0answers
48 views

SuperBible Skybox

I'm reading the SuperBible book which describe and interesting way of rendering a skybox. The Idea is to render only a plane, instead of a cube, and only change the texture coordinates depending on ...
-2
votes
1answer
70 views

How to convert Clip-space gl_Position to something you can write to a color buffer (0-1)

"How do I convert clip-space gl_Position to a valid depth?" I have a vertex shader that calculates a vertex position //Do stuff gl_Position = stuff; then in my ...
0
votes
0answers
56 views

OpenGL Cubemaps appear black

I've tested the files i'm loading, and they work as normal textures. However when I load them as sides of the cubemap, they fail The function that loads: ...
0
votes
1answer
15 views

JME3 Fragment/Shader not compiling

Here is the fragment shader code (MyShaders/Shader1.frag): void main(){ gl_FragColor = vec4(1.0,1.0,1.0,1.0); } And the vertex shader code (MyShaders/Shader1....
0
votes
1answer
23 views

OpenGL Bind all objects at once or single objects at a time

So if I have a bunch of objects, I do: glBegin(); renderThing1(); glEnd(); glBegin(); renderThing2(); glEnd(); glBegin(); renderThing3(); glEnd(); Is this more ...
0
votes
1answer
45 views

OpenGL: How to render a “shadow” for an object that's behind another?

First off, an image from Fez that depicts the effect I'm after: I'm trying to achieve a similar effect in my project. I'm quite certain this is done with a stencil buffer, but the resources on such ...
0
votes
0answers
72 views

GLFW shift key not behvaing like other keys

I am using GLFW 3.2.1 Currently I am implementing a camera. For the vertical controls I am using space to go up and shift to go down. For all other keys, pressing the key results in the section of ...
0
votes
0answers
28 views

Possible to draw instances using only part of the instance array?

In one of my classes for a WIP danmaku engine, I have a list of bullets grouped by blend mode. Right now, I'm storing each group sequentially in a single instance array and storing the index where ...
1
vote
1answer
83 views

Unintended stuttering when moving camera

I am using opengl and GLFW to make a rendering engine. Things work per se, but there is some weird flickering happening when I move the camera. Due the nature of the problem I need to link a ...
1
vote
1answer
82 views

LWJGL 2 GUI/Text

I'm currently developing a 3D plane simulator for my bachelor thesis. We've written the engine in LWJGL. We have to provide a GUI, to display some info about the plane that is flying. Like speed, ...
0
votes
2answers
108 views

Graphics API abstraction architecture

I'm developing a 3D game engine in C# and I was just wondering what are the different ways I can approach designing a graphics API abstraction. My original design was going to be something like this: ...
0
votes
1answer
64 views

OpenGL glVertexAttribFormat vs glVertexAttribPointer

I am attempting to change my code from using glVertexAttribPointer to glVertexAttribFormat as I have heard it;s more efficiend ...
1
vote
0answers
142 views

Uniform arrays do not work on every GPU

I am trying to implement instanced rendering for objects that repeat, so I came up with idea I could simply group objects that loaded same model files, create array with their Model matrices and so on,...
0
votes
2answers
218 views

Using std::threads to optimize drawing

I'm currently developing a 3D game with its own engine. I have some performance issues in the function that orders all the draw events and sends them to the GPU. I've heard about threads, and I ...
1
vote
1answer
153 views

Simple mouseray picking in openGL

Ive been looking at tutorials and trying to figure out how to do basic ray-picking. But I'm stuck at figuring out what space to do the distance calculations in. What space does ...