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
2
votes
1 answer
Setting gl_FragDepth causes lag?
I designed a very basic set of depth shaders for rendering depth to my shadow map depth textures.
This is the code for the depth fragment shader that I used :
#version 330 core
in vec3 FragPos;
uniform vec3 lightPos;
uniform float farPlane;
void…

skeelz
- 57
- 8
2
votes
1 answer
Automatize adjustment of the Shadow Map Projection (by projection the points of interest onto the near clipping plane of the light source)
I am working with OpenGL so Coding in C++.
Task:
I have a simple scene where I have one object, a one-point source of light, and a camera. Now I am moving the light around the object and up. When I reached all positions I want, I rotate the object…

MolineraNegra
- 31
- 4
2
votes
1 answer
How to position Shadow Mapping with Window Size?
A short time ago I was testing Shadow Mapping using OpenGL, and it worked. But when I tried to change the window size to full screen, the Shadow-Mapping size also changed, I thought about using the window height and width in the size variable inside…

Arthur Sally
- 134
- 1
- 10
2
votes
1 answer
Shadow mapping for many light sources - is it slow?
I've reached a point where I've implemented deferred rendering and shadow mapping for a single light source. I was looking forward to adding more light sources to see how deferred rendering improves the performance but I realized that shadow mapping…

John Katsantas
- 571
- 6
- 20
2
votes
1 answer
Depth buffer is not filled with data in shadow map render pass
I'm currently working on my shading in Vulkan. I've created a separate render pass for my shadow map basing on SaschaWillem's and Itoral's code. The base of my app was based on VulkanTutorial.
The problem I'm having is that the depth buffer the Z…

Michał Łąpieś
- 39
- 5
2
votes
0 answers
OpenGL shadow map not render over cast shadow objects
In my shadow map implementation for directional lights I have a collection of items which I iterate them to render their depth to a depth buffer then iterate them again to render them normally with the generated shadow map, each item has a bool…

Mohamed Mousa El-Kheshen
- 461
- 1
- 3
- 12
2
votes
1 answer
OpenGL shadow map incorrect shadows over the object
I implement the shadow map with directional light in an android Native OpenGL C++ application, the shadow is rendered correctly but there some bugs in my code that makes the result as in the attached image:
as shown there are strange triangulated…

Mohamed Mousa El-Kheshen
- 461
- 1
- 3
- 12
2
votes
2 answers
Hardware PCF for Shadow Map using OpenGL
I'm using OpenGL 4.3 under GeForce GTX 750 to create Shadow Map. Right now the basic effect, shown as below, seems to be correct:
To erase the blocky-effect, I've tried to do a 2x2 PCF manually in the shader. It leads to the following result, which…

Narusaki
- 97
- 1
- 2
- 11
2
votes
1 answer
Monogame and HLSL - Point Light Shadow Mapping artifacts
I am making a game in Monogame. I am using a forward rendering and I've decided to write a shader that will callculate lightning using Blinn-phong shading model. I have implemented this model to work with three types of Light - directional Light,…

Bigos102
- 23
- 3
2
votes
1 answer
Cubemap PCF: Get the plane perpendicular to a vector at a given point
I'm trying to implement PCF for a shadow cube map in OpenGL 2.0. I thought I'd found a solution here (search for Percentage closer filtering (PCF) algorithm to find the start of the section on cube map PCF), but the code is relying on the…

nils
- 338
- 4
- 11
2
votes
1 answer
How to dynamically update the resolution of the Shadow Map in THREE.js when changing resolution?
I want to dynamically change the resolution of the shadows of a spotlight in THREE.js. This question first seems relevant but it is not about my issue. I change the parameters of shadowmap dynamically but this is not affecting the scene. Even when…

Sohail Si
- 2,750
- 2
- 22
- 36
2
votes
0 answers
How do you fix wobbling shadow edges?
I've implemented an omni-directional shadow map and I've noticed a rather unwanted behaviour on the shadows. It seems like when the angle between the occluded points and the light source is really steap, then the egde of the shadow starts to wobble.…

SvinSimpe
- 850
- 1
- 12
- 28
2
votes
1 answer
DirectX11 and Rasterizer depth bias
I have problems with Z-fighting for my moving directional light casting shadows.
I'm trying to tinker with the rasterizer config when rendering the shadowmaps. There are three fields related to depth bias (DepthBias, SlopedScaleDepthBias,…

KaiserJohaan
- 9,028
- 20
- 112
- 199
2
votes
1 answer
Modern artifact-free shadow mapping
I'm trying to find the optimal shadow mapping technique(s) for use in my game engine. So far I've implemented standard shadow maps with PCF, cascaded shadow maps, and variance shadow maps. However, none of them seem to be providing satisfactory…

Jagoly
- 939
- 1
- 8
- 32
2
votes
0 answers
Variance Shadow Map Depth Issue
I have been trying to get variance shadow mapping to work in my webgl application, but I seem to be having an issue that I could use some help with. In short, my shadows seem to vary over a much smaller distance than the examples I have seen out…

Mat
- 961
- 12
- 28