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.

10
votes
0answers
287 views

Spherical Area Lights do not match reference

So I'm adding spherical area lights to my application, and comparing my results with mitsuba, I am getting some differences (left is my approach, right is mitsuba - a pathtraced reference): What I am ...
7
votes
0answers
289 views

Environment mapping without cubemap (need coordinates projection)

I'm working on a project with C++ and glsl (4.1). I have implemented a mirror object which is a plane at height 0 that works as follow: I render the scene with a MVP computed such that the camera ...
6
votes
0answers
489 views

Irradiance Map ( Irradiance environment map)?

As irradiance map is generated for every possible normal for all the texels in environment map (as every texel act as a light source) so that we can look up irradiance map, based on normal of fragment ...
6
votes
0answers
265 views

How to draw Shadow Volumes in one draw call?

I've got a simple app that draws 3D cubes using instance rendering and I'm implementing Shadow Volume. Each cube's vertex, uv, normal and index data are statically stored in 4 vertex array buffers. On ...
5
votes
0answers
434 views

How to correctly implement 'layered lighting' with Box2D-Lights

How does one only allow Box2D-Lights to affect one and only one OrthographicCamera. After researching, I found the following answer. This answer goes into detail ...
5
votes
0answers
93 views

How do I align the cube in which shadows are computed with the view frustrum? (“View Space aligned frustum”)

Short and concise: Given 8 world space positions that form a cube of arbitrary size, position and orientation and given an arbitrary light direction. How do I compute the View and Projection matrix ...
4
votes
0answers
125 views

Determine user mouse selection of 3D Object for multiple viewports

I am currently working on setting up some world objects for my level editor and am running into a bit of a snag. When I get the hit location from the mouse raycast, I would like to determine what part ...
4
votes
0answers
199 views

SSAO shader program produces no occlusion

I'm attempting to implement screen-space ambient occlusion by the method shown here. My SSAO shader program is the one part that isn't working. Here are the outputs of the initial rendering pass, ...
4
votes
0answers
267 views

Combine a light and water shader in libgdx glsl

I am trying to combine a light shader with a water shader in libgdx. Shader programming is not one of my strengths at all. This is the water effect rendering nicely: And when I have added the ...
4
votes
0answers
378 views

Draw Edges in OpenGL

I use blender game engine, and blender use openGL for graphics. How can I draw lines around all 3D objects? Would this be a job for a filter? Mainly, I want my end result to look drawn. I found this: ...
4
votes
0answers
780 views

OpenGL Depth Cubemap with Geometry Shader Not Rendering Correctly

I was having some trouble with cubemaps in OpenGL, and was hoping to get some help. I've been following a tutorial about point light shadow mapping using cubemaps, where a geometry shader is used to ...
4
votes
0answers
155 views

Why is my OpenGL enabled Java game not detected by Fraps?

Recently I found out that I could enable OpenGL hardware acceleration in my Java game with the line System.setProperty("sun.java2d.opengl", "True"); Initial ...
3
votes
0answers
69 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 ...
3
votes
0answers
79 views

Advanced copying between textures in OpenGL

I have many RGBA textures in my project. I often copy a part of one texture into another texture using copyTexSubImage2D . I am probably able to copy just a specific channel by setting mask (colorMask)...
3
votes
0answers
213 views

Geometry Shader crashing

I keep getting some strange errors in my Geometry shader and when I search for the cause of the errors, it returns nothing substantial. Here is the code. Shader ...
3
votes
0answers
233 views

Rotation of a ball moving on a surface

I have a ball that moves along a platform. The ball is characterized as a sphere that has a radius and a position. The platform basically is a rectangle consisting of two vertex triangles. Its class ...
3
votes
0answers
219 views

I get weird perspective using GLM where the depth is flipped. Please help

The depth is rendered wrong and I can't figure out why. ...
3
votes
0answers
588 views

Shadow mapping - Can't get the right texture coordinates

I'm trying to implement shadow maps for Spotlight's, but alas I can't get them to work. I have verified that my fragment shader is getting the shadow map texture. I can sample from it in the ...
3
votes
0answers
157 views

How do you fix wobbling shadow edges?

I've implemented an omni-directional shadow map and I've noticed a rather unwanted behaviour on the shadows. It seems like when the angle between the occluded points and the light source is really ...
3
votes
0answers
160 views

OpenGL Planet Generation - Simple Matrix Issue (Planet “Spins” With Mouse)

I originally asked this question on StackOverflow & was directed here by a commenter. Im currently working on a OpenGL planet rendering. I'm using the Tessellation pipeline. So far things are ...
3
votes
0answers
88 views

Tangents face the same direction on opposite sides of mesh

I have noticed that the tangent vectors that I am calculating are not always facing the correct direction. The tangents on the left and right of the mesh both face the same direction. Here is a ...
3
votes
0answers
608 views

Shadow map shimmering, indexing outside the shadow map

I have tried to reduce shadow shimmering/flickering using technique described here: http://msdn.microsoft.com/en-us/library/windows/desktop/ee416324%28v=vs.85%29.aspx I works as I want and shimmering ...
3
votes
0answers
264 views

Render on texture with alpha 0 for the background colour

Sorry if the question is stupid but I am very new to opengl. I render on a target a scene with a couple of object on a background that is nothing more than the clear colour (which is 0.0,0.0,0.0,0.0)...
3
votes
0answers
853 views

implementing shadows into my 2D GLSL-based lighting system

I'm writing a lighting system in OPENGL using GLSL shaders, and I'm pretty happy with the light casting I have so far, but I'm totally stuck on casting shadows. Everything I've found online on this ...
3
votes
0answers
548 views

Text alignment in OpenGL with FreeType2

I'm trying to implement font rendering and have got into some trouble with glyph metrics. Here's the code where I get the metrics: ...
3
votes
0answers
3k views

Arcball 3D camera

I have checked multiple threads before posting, but i havent been able to figure this one out. Ok so i have been following this tutorial, but im not using glm, ive been implementing everything up ...
3
votes
0answers
1k views

AlphaToCoverage + Alpha Blending = Artifacts

I'm experiencing a strange problem using OpenGL SampleAlphaToCoverage mode. There are rendering artifacts when using alpha-blending on pixels that have been rendered using alpha-to-coverage - and I ...
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'...
2
votes
0answers
171 views

Improve bloom quality

I'm trying to understang how can I improve bloom effect quality using all known to me optimizations. Currently I'm making it as follows: Create new texture using some threshold to extracts areas ...
2
votes
0answers
114 views

timing rendering to monitor screen update

I have an application with a very light rendering loop, taking a predictable and small time to execute. Right now, I have two solutions. The first solution uses Vsync: after a screen update, my ...
2
votes
0answers
97 views

Voxel Game - Lag when camera is inside of the terrain

I am making a voxel game in OpenGL and I currently render 8 x 8 chunks to the screen. The first thing I do is generate the map using Simplex Noise and this is done once when the chunk is created. I ...
2
votes
0answers
407 views

How and when to split draw calls in OpenGL and OpenGL ES

My application (with a modernish OpenGL >= 3.0 and an OpenGL ES 2.0 backend) renders more or less streaming data with up to millions of vertices with different vertex layouts and sizes (some simple, ...
2
votes
0answers
130 views

What am I doing wrong, in regards to multi-texture?

I am writing a bump mapping demo, so I need an image texture, and a normal texture which should be loaded into the fragment shader. This is the texture part of my OpenGL code: ...
2
votes
0answers
39 views

Testing spheres without extracting planes

I am currently a bit stuck. On OpenGL I am attempting to do view frustum culling, so far I managed to do it by using a PCM. Where center is the world position of the mesh. ...
2
votes
0answers
181 views

How to map trapezoid image to rectangle cubemap face?

I am writing a 360 video application on oculus mobile SDK. My video frame has a trapezoid region and I need to map it into a rectangle region. In the above figure, trapezoid ...
2
votes
0answers
171 views

Clipping drawn mesh by arbitrary volume

I'm trying to create a visual effect where an arbitrary part of the main scene is either clipped out by or cropped to an arbitrary volume. That is to say, I might want to draw just the area of the ...
2
votes
0answers
73 views

How to mitigate this strange pattern shown in Phong lighting?

I am creating an entire lighting scene in OpenGL. The entire scene consist of only one point light. I noticed some strange z-fighting like pattern. This flickers when I move the camera. Can anyone ...
2
votes
0answers
54 views

why collision not detection not happened in Two Sphere

I start practice 3d collision detection of sphere in OpenGl containing two sphere one sphere hit using cannon gun but collision not detect when it hit and when i debug code collision statement triger ...
2
votes
0answers
370 views

Generate screen space distance field from depth buffer

I've been wanting to try out raymarching on real 3D scenes to implement effects like AO, soft-shadows and such. I pretty much know how to use signed distance functions (as described by Inigo Quilez) ...
2
votes
0answers
357 views

Enabling OpenGL lighting seems to disable blending

I have the following code to set up for some 2D drawing using OpenTK. I originally wrote it without any lighting considerations, but later added the lighting block. This version of the code uses ...
2
votes
0answers
445 views

Linear color workflow with render to texture - Banding in alpha channel?

In OpenGL, I am using GL_SRGB8_ALPHA8 for the OpenGL internal texture format for my textures and render targets. This eliminated some banding I was seeing in dark ...
2
votes
0answers
208 views

Limit/Clamp camera movement using quaternions

I'm making a camera object for rendering with OpenGL. However, instead of using the typical "LookAt" method I'm trying to use just a Quaternion for orientation and a Vector3 for position. Instead of ...
2
votes
0answers
344 views

OpenGL cubemap binding

I'm experimenting a strange behaviour of textures inside my shaders. Basically I need and bind two cubemap textures inside my shader but only one gets actually bound. I've tried swapping the two ...
2
votes
0answers
251 views

Texture Mapping to procedurally generated geometry

How can I calculate texture coordinates of such geometry? The angle shown in the image (89.90 degree) may vary, therefore the geometry figure is changing and is not always such uniform.(maybe like ...
2
votes
0answers
108 views

How to store sprite data in a VBO?

I'm planning on rendering many sprites in my games, but I am not sure which method of storing their data to use. I haven't tried all of them yet, but I want to see if I also have anything important ...
2
votes
0answers
327 views

FXAA Shader turns image upside-down

I'm trying to use an existing FXAA shader for anti-aliasing, which works, but when I try to run it, the filtered image is upside-down (vertically flipped) ...
2
votes
0answers
236 views

GLSL shader with light colors wrong on nvidia optimus

So, I built some code to draw a spinning cube with a red light on the right side, and a blue one on the left. I run it on my laptop with optimus graphics, and on my desktop with nvidia. On the laptop, ...
2
votes
0answers
441 views

blending with OpenGL glBlendFunc and glBlendEquation

I want to draw a bunch of images in front of a background. Where images overlap, I want those to be blended together (for now, using a mix of 0.5 source * 0.5 destination color every time an image ...
2
votes
0answers
858 views

OpenGL Render Queue Design

I am currently designing the rendering system for a 2D game built in C++ and OpenGL, and am unsure about how to go about implementing a sorting procedure to maximise efficiency and minimize OpenGL ...
2
votes
0answers
371 views

Subsurface Scattering - Transmittance

I have a question related to SSS and especially transmittance. I've looked at several papers about that topic, most of them from Jorge Jimenez, which are very interesting and, I admit, a bit hard for ...