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
0
votes
1 answer
Incorrect texture coordinate calculated for shadow map
I am having problems getting the correct texture coordinate to sample my shadow map. Looking at my code, the problem appears to be from incorrect matrices. This is the fragment shader for the rendering pass where I do shadows:
in vec2 st;
uniform…

jbills
- 694
- 1
- 7
- 22
0
votes
1 answer
three.js shadowCascade DirectionalLight
I'm trying to copy the shadowCascade functionality from http://threejs.org/examples/webgl_morphtargets_md2_control.html to my project. I did this 1:1 however I only get a a little bit of shadowing at a certain angles and rotations, and often cut…

Doidel
- 1,743
- 1
- 14
- 22
0
votes
0 answers
Light pass for Shadow Mapping does not work with tesselation?
I am currently implementing Shadow Mapping and I came accross a part of weird logic in my program, I use the following program:
light.vs.glsl
#version 440 core
layout(location = 4) uniform mat4 light_mvp;
layout(location = 0) in vec4…

skiwi
- 66,971
- 31
- 131
- 216
0
votes
1 answer
Rendering orthographic shadowmap to screen?
I have a working shadow map implementation for directional lights, where I construct the projection matrix using orthographic projection. My question is, how do I visualize the shadow map? I have the following shader I use for spot lights (which…

KaiserJohaan
- 9,028
- 20
- 112
- 199
0
votes
1 answer
Shadow mapping. Framebuffer error 36060
I am doing this from a tutorial and i have exactly the code from the tutorial. But for some reason is not working. So i debugged and i saw that it had a 36060 error also know as GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER as far as i know and i don't…

DoNNNy
- 3
- 2
0
votes
1 answer
Rendering the Z-buffer to texture in WebGL
When I create z-buffer texture like so:
gl.bindTexture(GL_TEXTURE_2D, texBuff);
gl.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
gl.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
gl.texParameteri(GL_TEXTURE_2D,…

spearmunkie
- 21
- 1
- 7
0
votes
1 answer
Shadow mapping in separate pass, or not?
In my engine I have lots of shaders that handles specified combination of textures, for example DiffTexShader, NoTexShader, DiffTexNormalMapShader, DiffTexLightmapShader etc.
Now I want do add shadow mapping effect. What is better to do? Is it…

majakthecoder
- 177
- 3
- 14
0
votes
0 answers
Strange behaviour with shadow mapping using GLSL shaders
I've integrated basic shadow mapping. However I noticed a strange behaviour with the rendering. To summarize, the shadow mapping technics requires 2 step. The first to render the scene from the light point of view (filling of a depth texture) and…

user1364743
- 5,283
- 6
- 51
- 90
0
votes
2 answers
OpenGL Shadow Mapping dual shader
I'm attempting to write a simple shadow mapping engine utilizing two separate and distinct shaders using OpenGL and LWJGL. It uses VAO's/VBO's exclusively. The issue appears when the camera is rotated. It is as if the shadow rotates twice as much…

Chris
- 43
- 6
0
votes
0 answers
Shadow maps : sampling on the same UVs
I have a problem using shadow maps in OpenGL when 2 pixels from the camera view are on the same UVs on the shadow map. Here's how this looks like :
shadow map on the same UVs problem http://img7.imageshack.us/img7/4459/ida9.png
Both visible shadows…

user1546493
- 133
- 1
- 1
- 6
0
votes
1 answer
shadow maps, woo trick, depth peeling
I'm trying to make a self-shadowed object (opengl/glsl). The steps I did were these:
1- Render the scene from light to obtain a depth map
2- Render from camera position and calculate the distance of each point to the light source, if the distance of…

Matias Morant
- 513
- 2
- 5
- 12
0
votes
0 answers
Shadow Map too big
All is OK in the shader map texture, but the is scaled (too big).
The coord texture:
mat4 bias = mat4(0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.5, 0.5, 0.5, 1.0);
ShadowCoord = bias * projMatrix * viewModelMatrix *…
0
votes
1 answer
shadowmapping opengl glsl shader graphics math
i'm having difficulties understanding the math between the different shader stages.
in the fragment shader from the lights perspective i basically write out the fragDepth to rgb color
#version 330
out vec4 shader_fragmentColor;
void main()
{
…

ColacX
- 3,928
- 6
- 34
- 36
0
votes
1 answer
OpenGL depth texture artifacts
I'm implementing shadow mapping for my little 3d engine. However, there seem to be artifacts in the depth texture, which can be seen by using the texture and observing the shadows, or drawing the depth texture on a quad.
Here is what the depth…

tiftik
- 978
- 5
- 10
-1
votes
1 answer
Shadow Map: whole mesh is in shadow, there is no light where it should be according to depth map
First time trying to implement shadow map using openGL ang glsl shader language.
I think the first pass where I render to a texture is correct but when I compare the depth values it seems to shadow…

FlowerPower1990
- 67
- 1
- 4