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
18
votes
1 answer

Pointers on modern OpenGL shadow cubemapping?

Background I am working on a 3D game using C++ and modern OpenGL (3.3). I am now working on the lighting and shadow rendering, and I've successfully implemented directional shadow mapping. After reading over the requirements for the game I have…
toficofi
  • 583
  • 6
  • 24
16
votes
1 answer

Shadow Mapping - artifacts on thin wall orthogonal to light

I'm having an issue with back faces (to the light) and shadow mapping that I can't seem to get past. I'm still at the relatively early stages of optimizing my engine, however I can't seem to get there as even with everything hand-tuned for this one…
mobob
  • 849
  • 10
  • 17
15
votes
1 answer

glsl sampler2DShadow and shadow2D clarification

Quick background of where I'm at (to make sure we're on the same page, and sanity check if I'm missing/assuming something stupid): Goal: I want to render my scene with shadows, using deferred lighting and shadowmaps. Struggle: finding clear and…
Phildo
  • 986
  • 2
  • 20
  • 36
13
votes
1 answer

What causes shadow acne?

I have been reading up on shadow mapping, and found the following tutorial: http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-16-shadow-mapping/ It makes sense to me up until the point where the author starts discussing the "shadow…
nicebyte
  • 1,498
  • 11
  • 21
10
votes
1 answer

Multi lights shadow mapping does not work correctly using GLSL

I have implemented the basic shadow mapping algorithm but it works correctly with only one light. I want to render a scene with two following point lights : Light_1 - position : vec3(-8.0f, 5.0f, 8.0f), direction : vec3(1.3f, -1.0f, -1.0f) Light_2…
user1364743
  • 5,283
  • 6
  • 51
  • 90
8
votes
3 answers

ThreeJS [r85]: Custom Shader with Shadowmap

I've created a custom shader to be able to use a BlendMap with 4 different textures but I'm unable to get the shadows/lightning effects to work with it. What am I missing here? Or is there some other way I can achieve same functionality? Mesh…
8
votes
1 answer

Odd OpenGL shadow mapping behaviour

I am working on a 3D game in C++ and OpenGL 3.2 with SFML. I have been struggling to implement point light shadow mapping. What I have done so far seems to conform to what I have learnt and examples I have seen, but still, no shadows. What I have…
toficofi
  • 583
  • 6
  • 24
7
votes
1 answer

How to use a single shadow map for multiple point light sources?

As I understand it, shadow-mapping is done by rendering the scene from the perspective of the light to create a depth map. Then you re-render the scene from the POV of the camera, and for each point (fragment in GLSL) in the scene you calculate the…
mpen
  • 272,448
  • 266
  • 850
  • 1,236
7
votes
1 answer

Shadow mapping in OpenGL with a spotlight produces unusual effect

I have been trying to implement shadow mapping. Whilst I think that I am now close, I have come stuck with a strange effect (illustrated below): As you can see, the shadow region appears too small. There is also an unusual effect on the cube…
Homar
  • 1,520
  • 2
  • 17
  • 26
6
votes
0 answers

incomplete attachment using GL_TEXTURE_2D_ARRAY with depth component

I'm trying to use opengl texture arrays for storing a lot of shadow maps. Unfortunately, I always get an "incomplete attachment" error on checking the framebuffer. I tried to set up my texture array like in nvidia's cascaded shadow mapping example…
maumau
  • 61
  • 2
5
votes
2 answers

Shadow mapping shader

I've got a shader that implements shadow mapping like this: #version 430 core out vec4 color; in VS_OUT { vec3 N; vec3 L; vec3 V; vec4 shadow_coord; } fs_in; layout(binding = 0) uniform sampler2DShadow shadow_tex; uniform vec3…
skiwi
  • 66,971
  • 31
  • 131
  • 216
5
votes
1 answer

OpenGL Shadow Map

I am trying to do a basic shadow map but for some reason, It doesn't render properly. Video of the Problem I render the house using a flat shader: int shadowMapWidth = WINDOW_SIZE_X * (int)SHADOW_MAP_RATIO; int shadowMapHeight = WINDOW_SIZE_Y *…
Jubei
  • 1,686
  • 1
  • 17
  • 28
4
votes
1 answer

Legacy OpenGL: What's wrong with my shadow mapping code?

I'm trying to implement shadow mapping in legacy OpenGL (yes, I know it's deprecated but however), but it's not working right. Almost everything is black (see picture, in the lower left I added a view from the light source). I checked the depth…
Mario
  • 99
  • 1
  • 7
4
votes
1 answer

pssm shadow map near clip culling issue

I am trying to wrap my head around the cascaded shadow maps and I encountered an issue with near field culling. Basically objects behind the camera get culled and the shadows for that split get culled as well. Take a look at the following image. I…
Saik
  • 993
  • 1
  • 16
  • 40
4
votes
1 answer

Cascaded shadow map texture access bug on OpenglGL

I'm trying to implement the cascaded shadow map, and I have a bug when I want to access to the corresponding depth texture of each partition of my frustum. To be more specific my problem occur when I want to select the correct shadow texture, if I…
1
2 3
13 14