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
0 answers
Understanding generation of omnidirectional shadowmap
I'm currently learning about how to generate omnidirectional shadowmap for point light from the following resource:
https://learnopengl.com/Advanced-Lighting/Shadows/Point-Shadows
The author is talking about layered rendering where instead of doing…

Jorayen
- 1,737
- 2
- 21
- 52
0
votes
1 answer
Webgl - Rendering depth to texture returns gl.INVALID_FRAMEBUFFER_OPERATION in Safari
If you look at the following snippet in Safari (taken from https://webglfundamentals.org/webgl/lessons/webgl-shadows.html), you will notice it looks different than in other browsers, because the depth texture is always completely black:
'use…

cboe
- 469
- 1
- 9
- 25
0
votes
1 answer
Varying shadow acne artifacts on different Android devices
I have a problem with the following shader function in my android opengl project:
highp float calculateShadow(highp float cosTheta, highp vec4 shadowCoord)
{
highp float bias = 0.005 * sqrt ( 1.0f - cosTheta * cosTheta ) / cosTheta;
bias =…

AudioGuy
- 413
- 5
- 18
0
votes
1 answer
Cascaded shadow map unexpected behavior
I'm implementing the Cascaded Shadow Map technique, I get unexpected result
First I initialize the buffer and the textures:
glGenFramebuffers(1, &m_fbo);
glBindFramebuffer(GL_FRAMEBUFFER, m_fbo);
glGenTextures(NUM_CASCADES, m_shadowMap);
for (uint…

Mohamed Moussa
- 103
- 1
- 13
0
votes
0 answers
Trouble rendering to multiple cube maps
I'm trying to implement shadow mapping to a scene with many light sources. I've successfully managed to render to a cube map and use the resulting texture to detect the shadows.
However, when trying to make a second cube map texture, I lose my…

John Katsantas
- 571
- 6
- 20
0
votes
1 answer
Why are shadowmapping shaders working backwards?
I'm studying shadowmapping shaders at the moment and one question that arises is why do we first shade surfaces(lambert/phong) and then map shadows onto them, as opposed to just additively lighting pixels up? That strikes me as the opposite of how…

BMC
- 3
- 1
0
votes
1 answer
XCode 7.2.1 OpenGL Profiler: See Framebuffer contents
I'm currently attempting to use the OpenGL Profiler tool for XCode 7.2.1 to debug a non-functioning shadow map for an C/C++ OpenGL Application. As of yet, I can't seem to locate a feature that allows me to see the contents of a buffer (frame buffer…

mwPlouffe
- 15
- 2
0
votes
1 answer
directx 11 omnidirectional shadow mapping shadow wrong projected
I code ommidirectional shadow mapping by c++ directx 11. I took algorithm from book: "HLSL Development Cookbook" by Doron Feinstein. But if my screen resolution and all dependences are different with resolution of shadow map, the shadows are in…

fedorholodnuk
- 11
- 2
0
votes
1 answer
shadowmapping and sampler2DShadow
I have been trying to implement shadowmapping in my terrain LOD program. I have spent quite some time researching different techniques and playing around with my code, but I just can't find my error, so it's time to ask the opengl gurus on stack…

Kyy13
- 315
- 1
- 9
0
votes
1 answer
Problems with using a shadow map with deferred rendering Opengl 3.3
I am trying to implement simple shadow mapping for a project i am working on. I can render the depth texture to the screen so i know it's there, the problem is when I sample the shadow map with the shadow texture coordinates it seems as if the…

Gicla
- 9
- 3
0
votes
0 answers
Using color cubemaps for shadow mapping in OpenGL
I'm trying to make an omnidirectional shadow map (from a point light) in OpenGL. To avoid passing tons of matrices around and having to move in between world space and light space with a depth map, I thought I might be able to use a color texture…

Otto von Bisquick
- 177
- 1
- 2
- 17
0
votes
1 answer
Striation in my shadows
I'm casting shadows across a screenspace texture based on the values in another texture.
My "depth" texture, it's not really depth, just colour values that are sampled for heights, looks like this:
We can say that the red channel is my heightmap.
I…

NeomerArcana
- 1,978
- 3
- 23
- 50
0
votes
2 answers
Why is my frag shader casting long shadows horizontally and short shadows vertically?
I have the following fragment shader:
#version 330
layout(location=0) out vec4 frag_colour;
in vec2 texelCoords;
uniform sampler2D uTexture; // the color
uniform sampler2D uTextureHeightmap; // the heightmap
uniform float…

NeomerArcana
- 1,978
- 3
- 23
- 50
0
votes
0 answers
OpenGL ES3 framebuffer generated is completely ignored
I create a framebuffer object to render scene as depth values to render shadow maps , after the scene initialized and all shaders compiled I add the directional light and create the FBO using this code:
glGenFramebuffers(1,…
user8581488
0
votes
1 answer
WebGL2 - Can I query a shadowmap cubemap with non world position?
I'm trying to implement shadow maps for point lights using Webgl2. To do so, I use a cubemap of depth buffers to which I render 6 axis aligned views from the light position.
In the fragment shader I use to render lighting, I query this cubemap…

François Guthmann
- 461
- 1
- 4
- 15