Technique used to produce shadows in a 3D scene, by drawing objects to a texture or textures, and then mapping them onto a scene.
Questions tagged [shadow-mapping]
199 questions
1
vote
1 answer
sampler2DShadow bias component not working in GLSL?
I am trying to implement shadow maps in opengl core 3.3. When I send a bias to the texture function in GLSL it doesn't seem to do anything at all. Am I using it wrong?
#version 330
uniform sampler2D diffusetex;
uniform sampler2D normaltex;
uniform…
user2475269
1
vote
0 answers
Shadow Mapping: How do I generate a texture from my first pass (as rendered to the depth framebuffer)?
I am generating a simple scene with directional light. My aim is to create the scene's shadows through shadow mapping. I have looked all over for help on this topic to no avail. As far as I can tell, my code should be equivalent to that which I have…

user3335168
- 11
- 1
1
vote
1 answer
Small artifacts with simple hard shadow mapping technique using OpenGL and GLSL
I have a strange behaviour with my hard shadows I have never seen before because of the somber color of the textures I used (these artifacts was not visible). Here's some screenshots of my problem with 3 different shadowmap resolutions:
1) Shadowmap…

user1364743
- 5,283
- 6
- 51
- 90
1
vote
0 answers
Shadow map in OpenGL
I've problem with shadow map in OpenGL.
Well, the shadows look like this:
https://i.stack.imgur.com/7wWm2.png
My vertex shader:
#version 330 core
layout(location = 0) in vec3 vertex;
layout(location = 1) in vec3 normal;
…

ly000
- 343
- 4
- 12
1
vote
1 answer
Sampling outside of shadowmap leads to unusual behavior
I am running into issues when sampling points outside my light's view and therefore my shadow map. This is what I get whenever my shadow map is created with the texture parameter for GL_TEXTURE_WRAP set to GL_CLAMP or GL_CLAMP_TO_EDGE:
What I have…

jbills
- 694
- 1
- 7
- 22
1
vote
1 answer
opengl using depth buffer for shadows- any reason not to just render z to tex rather than use depth buffer?
So I'm working on implementing shadow mapping. So far, I've rendered the geometry (depth, normals, colors) to a framebuffer from the camera's point of view, and rendered the depth of the geometry from the light's point of view. Now, I'm rendering…

Phildo
- 986
- 2
- 20
- 36
1
vote
0 answers
Pointlight Shadow Cube Mapping
So i managed to create shadow maps for a directional light (extended at infinity). Now i am trying to create point light shadow cube map, so the shadows spread in the direction of the light->fragment. I created a new FBO like so:
//gen new…

D.Razvan
- 325
- 1
- 5
- 18
1
vote
1 answer
Shadow mapping does not work correctly using GLSL and OpenGL
I have a scene composed with 2 meshes (plane, cube), a light and a camera. I want to display shadows on my scene using shadow mapping technique with GLSL shaders and OpenGL.
Here's the result I have (for a sake of simplicity, my cube and my plane…

user1364743
- 5,283
- 6
- 51
- 90
1
vote
1 answer
Three.js shadows casting on unobstructed faces, low resolution to boot
Here's my issue:
.
The shadows on the text should not be there and despite my changes to the shadowMap resolution, nothing changes. This is the code used to generate the mesh:
var materialArray_Flying = [
new THREE.MeshPhongMaterial( {…

AdamSpurgin
- 951
- 2
- 8
- 28
1
vote
1 answer
Strange shadow map behaviour, do I compute my coordinates correctly?
I wrote a shadow map shader for my graphics engine. I followed these tutorials:
Part 1 and the following part.
Unfortunately, the results I get are quite a bit off. Here are some screenshots. They show what my scene normally looks like, the scene…

Uli Holtmann
- 226
- 2
- 7
1
vote
1 answer
Opengl 3.3+ incorrect shadows when using shadow mapping
I am trying to implement shadow mapping on my landscape editor with OpenGL 3.3+. Using a few tutorials I have managed to get my code to compile and run but the whole landscape is in shadow except for the back row of my landscape grid (smallest z).
I…

graphicsProgrammer
- 13
- 3
1
vote
1 answer
Improving shadow map performance of point lights?
I'm making point lights with shadow maps, and currently I have it done with six depth map textures, each rendered individually and applied to the light map. This works quite well, but the performance cost is high.
Now, to improve the performance by…

manabreak
- 5,415
- 7
- 39
- 96
1
vote
0 answers
Shadow Mapping Wobble
Ive been researching omnidirectional shadow mapping and have been stuck on this problem for a while. Basically the shadows seem to wobble as the camera is moved or rotated. I made a video here:
http://youtu.be/w8IAdNPglAc
The problem is most visible…

user1848064
- 47
- 5
1
vote
1 answer
Problems caused by depth-stencil buffer created by default
I'm learning from a sample in DirectX SDK on shadow map. This sample created a stencil surface during initialization, and says:
Create the depth-stencil buffer to be used with the shadow map
We do this to ensure that the depth-stencil buffer is…

user2310794
- 67
- 3
- 9
1
vote
1 answer
OpenGL ES 2.0 - Rendering depth buffer
I have read some tutorials and trying to wrap my head around OpenGL ES 2.0. While trying to create a depth buffer, my JVM crashes. Btw I am using LibGDX framework.
IntBuffer depthBuffer = BufferUtils.newIntBuffer(1);
// AFAIK this puts 1…

jellyfication
- 1,595
- 1
- 16
- 37