Questions tagged [shadow-mapping]

Technique used to produce shadows in a 3D scene, by drawing objects to a texture or textures, and then mapping them onto a scene.

199 questions
3
votes
1 answer

Shadow mapping and depth values confusion

I am doing shadow mapping for spotlights in a deferred OpenGL 4.3 renderer. I've been trying to follow some tutorials on the subject, and modelled by fragment shader after it, but what I do not understand is the final comparison to calculate the…
KaiserJohaan
  • 9,028
  • 20
  • 112
  • 199
3
votes
1 answer

Shadow mapping in Opengl-es 2.0 with cubemap

I'm quite new to OpenGL ES and I'm trying to add some shadows to my current scene. I decided to do that with the help of a cubemap. I'm using OpenGL es 2.0, so geometry shader or the gl_FragDepth variable is unavailable for me. I've googled some so…
Terrordrone
  • 139
  • 2
  • 12
3
votes
0 answers

OpenGL shadow mapping weirdness with uniform array

I was trying to run a little game/demo written by a friend of mine for mostly educational purposes, Land of Dreams. I noticed some extremely strange behaviour on my computer, even though the application was reportedly run successfully on several…
Kristóf Marussy
  • 1,202
  • 8
  • 18
3
votes
1 answer

OpenGL 3+ with orthographic projection of directional light

I'm currently having an issue with directional light shadow maps from a moving (sun-like) light source. When I initially implemented, the light projection matrix was computed as 3D, and the shadow map appears beautifully. I then learned that for…
Chris
  • 43
  • 6
3
votes
1 answer

OpenGL 3.3 Two different results on two GPUs nVidia Optimus with Shadow mapping

So i'm working on a project (to both learn and create a game in the future) in C++ and for rendering i've chose OpenGL 3.3. I've been working on Intel HD 4000 built in my processor as it opens default new apps and everything went sweet. But then…
RippeR
  • 1,472
  • 1
  • 12
  • 23
3
votes
1 answer

glsl performance: tan(acos(x)) vs sqrt(1-x*x)/x

I am writing a glsl fragment shader in which I use shadow mapping. Following this tutorial http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-16-shadow-mapping/ , I wrote this line to evaluate the shaodw bias to avoid the shadow…
darius
  • 837
  • 9
  • 22
3
votes
1 answer

2d shadow mapping

I have been wondering about how to implement this with openGL: I have a map, with a flat floor and walls. Every thing here is 2d, there is no 3d geometry, only 2d poligons that compose the map. Using the vertex of the polygons I cast shadows, to…
Leo
  • 1,174
  • 11
  • 25
3
votes
0 answers

Depth Stencil and Shadow resource empty

After Spending about 3 days trying to get shadow mapping to work I'm having some trouble getting the shadow mapped passed in to the shaders. First I initialize the depth stencil and the resource view, then i draw ( I believe ) to the depth stencil.…
Gribbles
  • 31
  • 1
3
votes
1 answer

Omnidirectional Shadow Mapping Spot Lights

I was implementing omnidirectional shadow mapping in a deferred renderer but am having trouble solving this problem: Here is a picture: This is what happened when I just position six spot lights pointing along each axis in positive and negative…
2
votes
1 answer

light view matrix in stable cascaded shadow mapping

I have recently implemented cascaded shadow maps and make it stable by following this post. Now everything works, except that when I move directional light to the top mid of the world, the shadow suddenly turns all dark. With some debugging I find…
teamclouday
  • 121
  • 1
  • 7
2
votes
1 answer

Setting up GL_TEXTURE_2D_ARRAY, framebuffer incomplete

For cascaded shadow mapping I'm trying to use a GL_TEXTURE_2D_ARRAY for the individual shadow maps. However following tutorials found online and even looking up things in a textbook I can't seem to create a working framebuffer, as it always errors…
Á. Márton
  • 497
  • 1
  • 3
  • 21
2
votes
0 answers

In PSSM/CSM implement, how to guarantee the whole shadow casters in the scene in the calcuated splitted light frustums?

I have implemented the PSSM/CSM shadow map.PSSM/CSM use the current camera's frustum to calculate the splitted light frustums, and so improved the shadow quality, especially to casters near current camera.but casters which out of current camera's…
june81
  • 21
  • 1
2
votes
1 answer

Render to a layer of a texture array in OpenGL

I use OpenGL 3.2 to render shadow maps. For this, I construct a framebuffer that renders to a depth texture. To attach the texture to the framebuffer, I use: glFramebufferTexture2D( GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, shdw_texture, 0…
Bram
  • 7,440
  • 3
  • 52
  • 94
2
votes
2 answers

Opengl : SSAO vs Shadow mapping

Literary every tutorial that has written an article on SSAO ends with 'dosent exactly produce realistic results'. We can get much more accurate shadows with shadow mapping without the extra memory required to store a texture[or an uniform array]…
Sync it
  • 1,180
  • 2
  • 11
  • 29
2
votes
0 answers

Encoding geometry information for Sub-Pixel Shadow Mapping

I'm trying to implement the SPSM approach described in this paper: http://jmarvie.free.fr/Publis/2014_I3D/i3d_2014_SubPixelShadowMapping.pdf First, why am I trying to do this: I am currently using a shadow map, rendered from the viewpoint of a…
1 2
3
13 14