Questions tagged [shadow-mapping]
Shadow mapping is a process by which shadows are added in 3D graphics scenes.
177 questions
0
votes
0
answers
54
views
How does SamplerCmp works compared to Sample (PCF shadow blur)
I'm doing 3x3 PCF blur with either Texture.SampleCmp (from CascadedShadow demo in DX11) or Texture.Sample (DX11 SM5) like this
...
0
votes
1
answer
91
views
Advice on how to best use if possible 4 GatherCmpRed to emulate a 4x4 PCF sampling for shadowmap blur
In a part of my level I have shadows close to the camera where a good blur is important. Currently I have implemented a 4x4 PCF, thus requiring 16 texture samplings.
I'm trying to see if the ...
0
votes
1
answer
74
views
Shadow artifact with cubemap shadow for pointlights
I am facing some difficulties with the use of a cubemap shadow associated to a poinlight (represented as the yellow bicone in the picture). The shadow map itself is generated properly (see picture).
...
0
votes
0
answers
60
views
Shadow mapping frustum fitting based on Y=0 plane
I am trying to calculate tight fitting of shadow map texture based on camera frustum. Since the camera is always going to be looking down on the Y=0 plane, I ...
0
votes
0
answers
69
views
How to build directional light view / proj matrices in DirectX11?
I think I built my matrices wrong:
...
0
votes
0
answers
48
views
Shadow Artifacts on Plane Below a Sphere
I am having this minor issue implementing shadow mapping. The plane below the sphere has these strange artifacts. I can fix it by offsetting the position slightly but I'd rather have it work ...
0
votes
0
answers
41
views
How to visualize the shadowmap as the renderTarget of the main camera in Unity?
I have a Unity project with the builtin pipeline. I would like to save the shadowmap of the directional light source and visualize on screen as the primary renderTarget of the main camera. ...
0
votes
1
answer
68
views
About possibly using Depthstencil 2D array in multiplerendertarget mode
I'm rendering in forward mode my scene with its depth buffer and because I'm using animated characters I'm plannig to find a way to use multiple rendertargets to do the directional shadow pass at the ...
1
vote
1
answer
379
views
How does planar shadow projection interact with perspective projection?
This question is about planar shadows as explained in Frank Luna's DX11 book. The author presents the 4x4 shadow matrix, whose bottom right element is n\$\cdot\$L (where n is the plane's normal and L ...
0
votes
1
answer
138
views
Issues with implementing shadow mapping produces weird results
This is my first attempt in implementing shadow mapping. I am using right hand coordinate system and my projection matrices are producing z values from 0 to 1.
I've decided first to use orthogonal ...
0
votes
0
answers
68
views
Is directional shadow mapping without projection matrix possible?
I have found this code where they use a cubemap for pointlight shadow and they don't need to retrieve the faceindex and the projection matrix. This greatly improve the FPS. I was wondering if this ...
0
votes
1
answer
62
views
Error in directional light shadow projection matrix
I have VC++ code for DX9 that draws shadows perfectly.
...
0
votes
0
answers
466
views
Python Generating a Shadowmap from a Heightmap
I've recently been experimenting with Python and PIL to generate heightmap images using simplex noise. The generated heightmaps are simply 2D numPy arrays with height values ranging from 0-1. I ...
2
votes
1
answer
466
views
Making Unity shadows work at a small scale
I'm trying to cast shadows from a small (3cm) sphere onto a table surface.
If I place a large object, I get shadows as expected, but below a certain size, I get nothing.
I appreciate that under ...
0
votes
1
answer
160
views
How to apply shadows on an animated model
I have followed the learnopengl.com tutorial on skeletal animation, but it does not apply shadow on the animated model.
Here is the vertex shader that is used to display the character. I suspect that <...
0
votes
1
answer
247
views
Using cubemap in view space for shadowing in deferred rendering
I want to render shadows for point lights with a cubemap. My shader uses view space for lighting (directional and point). So I convert ligthposW/lightfocusW in world space to ligthposV/lightfocusV in ...
0
votes
2
answers
381
views
Shadowmapping in view space
UV coordinates for shadow mapping are usually calculated from world position. I want to make it compliant with my screen space reflection (SSR) pipeline which works in view space.
Is it possible to ...
0
votes
1
answer
2k
views
Simulating sprite shadows for a 2D top-down game
I have read some other posts with almost identical titles on here, but they are not exactly what I am looking for. (What I have seen come up a lot in 2D shadows is some sort of "ray-cast effect&...
0
votes
0
answers
219
views
What's the solution to this kind of shadow acne?
I'm working with a OpenGL ES/GLSL homebrew engine my company developed, in C++. Below is a screenshot of it rendering shadow acne. The light's direction is too perpendicular to the face of the curve ...
0
votes
1
answer
107
views
ZBias trouble with alternative cubemap shadow method
I find two methods to produce cubemap for shadow both using the same geometry shader to draw each of the 6 faces. The first one writes in the depth buffer only and is used like this (really I thanks ...
1
vote
2
answers
900
views
Custom directional shadow map from sun
Due to some material features, I need to create my own directional shadow map.
Everything seems to work ok, until the moment where I compare depths.
First I add a camera component to the directional ...
0
votes
1
answer
168
views
problem showing cubemap shadows for point lights in texturecube mode
I'm adding cubemap shadow for point lights. Rendering each face in a separate texture2D seems to work (see picture, right, rendering from yellow point light view). With the same pipeline I can't get ...
0
votes
0
answers
45
views
How to calculate if a complex shadow matches a Texture?
Unreal 4.27, newbie and experimenting, will switch to 5 if supporting features are not available in 4.
I have a light on the left side of the room pointed toward the right side. In the middle of the ...
0
votes
1
answer
253
views
How not to multiply real time and bake shadows? (Unity)
I have one Light Source ( Directional Light ) with Mixed Mode.
Lighting Mode in Lighting Window I seted to Subtractive.
What the problem looks like
How I would like the shadows to blend. How to ...
0
votes
1
answer
994
views
How to calculate the shadow bounding box with a directional light
I'm trying to implement a directional light in my C++ / OpenGL engine, but I struggle to calculate the shadow bounding box (i.e the shadow frustum).
The bounding box has to encompass the main frustum ...
0
votes
0
answers
133
views
Shadow rendering through wall
In our game, shadows generated for dynamic objects through a shadowmap render on the wrong sides of walls.
Here you can see the issue: In the top right corner you see the shadow from a box I placed on ...
0
votes
1
answer
1k
views
Unity baked light messes up a set of objects
On a few objects I use a technique where instead of using geometry, I place planes with a Cutout Material on top of each other, creating a 3D illusion with minimal cost. The thing is, it looks great ...
0
votes
1
answer
809
views
Single Shadowmap for multiple point lights
I'm trying to render a scene using multiple point light casting shadows.
Currently, If I have more than 1 point light, shadows are wrong.
I'm drawing to FBO with a depth cubemap attached to it and in ...
0
votes
1
answer
148
views
How to fix shadow not casted to terrain when rendering using default and terrain shader (depth shader included)?
Given that I have the TerrainShader class and DefaultShader class. Also a FBO (Frame Buffer Object) shadow map
The ...
2
votes
1
answer
2k
views
How to move the shadow map with the camera?
I implemented a directional light and a shadow map for that light based on learnopengl.com tutorials. And it is working great, but I would like to move the shadow map with camera/player, so I have ...
0
votes
0
answers
105
views
Issues with percentage closer filtering
I'm trying to code a simple game via OpenGL C++.
I've implemented a point light, parallax effect with textures, objects from blender etc. but I seem to have an issue with my percentage closer ...
1
vote
1
answer
244
views
2D shadow from polar coordinates has hard cut-off at a certain radius
I'm trying to cast shadows from a 1D texture that goes from white to back according to the distance given by an occlusion map. That part I think I got it right. The problem lies on the algorithm to ...
0
votes
1
answer
452
views
Peter Panning Depth Bias Problem
No matter how I experiment with RasterizerState Depth Values, I always get a detached shadow which is called peter panning. Ive even adjusted the near plane for the light camera. It always seems to ...
2
votes
1
answer
1k
views
Is linear filtering possible on depth textures in OpenGL?
I'm working on shadow maps in OpenGL (using C#).
First, I've created a framebuffer and attached a depth texture as follows:
...
1
vote
0
answers
253
views
Shadowmapping with multiple light sources
I am using shadow-mapping to add shadows to my world.
Currently, I use one lightsource, which means I have to draw my world twice: once in the lightview, once in the camera view.
I want to add more ...
3
votes
1
answer
1k
views
Forward Shading with multiple shadow-casting lights
I am currently thinking about how to organize shadowing and lighting.
We use forward rendering and currently, our algorithm looks like this:
collect all items that are visible in the view
for each ...
1
vote
1
answer
612
views
Trouble generating a depth map (black screen)
I am having trouble generating a depth map for my scene. I tried to figure out this issue a 2 weeks ago and got nowhere after days of trying to fix it, so I took a break and tried to tackle it again ...
0
votes
1
answer
549
views
How do I calculate the bounding box for an ortho matrix for Cascaded shadow mapping?
I've been trying to get a cascaded shadow mapping system implemented on my engine, though it appears to be that the bounding boxes for the cascades aren't correct.
The part I'm interested in can be ...
2
votes
1
answer
2k
views
Calculating Directional Shadow Map using Camera Frustum
I'm trying to calculate the 8 corners of the view frustum so that I can use them to calculate the ortho projection and view matrix needed to calculate shadows based on the camera's position. Currently,...
0
votes
1
answer
210
views
samplerCube for point light shadow map has dark corners relative to screen aspect ratio / size?
I almost have point light shadows working but the corner of the samplerCube that I use for the shadow map has corners that get darker depending on the main camera. Is this something to do with a ...
1
vote
1
answer
258
views
Distant objects remain fully lit at sunset, when they should be in the mountain's shadow
I'm trying to make dynamic sunrises and sunsets in my game but I have some problems. My scene is surrounded by mountains and when the sun tint is still hot the sun is not visible but, the trees that ...
0
votes
1
answer
788
views
How can I fix the artifacts near the shadow edges in my variance shadow map?
I'm trying to implement variance shadow mapping in my engine. I'm using WebGL 2 and now I have only one directional light source. It's working, but it has a serious issue near the shadow edges and I ...
1
vote
1
answer
3k
views
Excluding geometry from a shadow casting light in deferred rendering
Is it possible to exclude geometry from a particular shadow casting light in a deferred rendering pipeline? If yes, can it be done correctly or are there limitations? This is mainly to reduce the ...
0
votes
1
answer
273
views
shadow mapping with directional light and octree
i am about to add shadow mapping to my simple game, i have a map level structured in an octree the camera culls out the octree nodes out of the vieweing frusutm and everything runs smooth. Now i want ...
1
vote
1
answer
2k
views
Problems implementing shadow maps in directx
I am trying to implement shadow maps in my Dx11 rendering engine. I created a shadow map texture2d, a shader resource view, a depth stencil, a viewport, and a rasterizer state, as recommended by ...
2
votes
1
answer
1k
views
opengl shadow map peter panning effect
I am implementing the shadow map in opengl with opentk everything works fine except I have a peter panning effect that I can't solve it by changing the face culling to front then render to the depth ...
0
votes
0
answers
806
views
GLSL Atomics With Floats
I am implementing SDSM and in a GLSL compute shader I need to min/max vec3 values to compute the shadow map bounds. The sample implementation (in HLSL) uses vectors in "light space" that spans from 0-...
1
vote
1
answer
3k
views
Custom shadow mapping works with perspective light view but not with orthographic
About a week ago, I decided to make my own shadow mapping technique in Unity based on my understanding of the whole thing. The entire experience was somewhat successful. I learned a lot and I get to ...
0
votes
2
answers
874
views
Cube map faster than 6 2D textures? - shadow mapping
I've managed to implement shadow mapping to a scene. However, I had problems using a cube map so I eventually gave it up and used 6 2D texture maps instead. To make this work with 6 2D maps, during ...
1
vote
1
answer
415
views
Shadow artifacts/acne on block intersections
This is using the default shader and depth shader from LibGdx. It creates lines at the blocks intersections.
This is what I use to create the blocks models for now:
...