Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [shadow-mapping]

Shadow mapping is a process by which shadows are added in 3D graphics scenes.

0
votes
1answer
40 views

Custom shadow mapping in Unity. Works with preservative Light view but not with Orthographic

So 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
0answers
18 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
1answer
69 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: ...
0
votes
0answers
10 views

How can I tell if a vertex is mapped outside the texture map?

Let's say I create a shadow map from a specific view and then apply that map to a scene. Some objects lie outside the map and they take colors depending on how you defined the shadow map (for example ...
1
vote
0answers
21 views

Problem generating multiple shadow maps in a loop

I've successfully implemented shadow mapping for a specific direction as you can see in the image below: Now I want to do omnidirectional shadow mapping but without using a cube map. My first step ...
0
votes
1answer
27 views

I can't make the cube map to use shadow mapping - or it seems so

Basically, I'm following tutorials as I'm very new to OpenGL. I managed to perform shadow mapping towards just one direction, meaning I created 2D texture depth map. Now with omnidirectional shadow ...
0
votes
0answers
25 views

Cascading Shadow Maps - Spotlight Projection

In all the cascading shadow map explanations I have read, the final projection into the shadow-map is done using an orthographic projection. This makes sense for a directional light because a ...
0
votes
1answer
98 views

Omnidirectional Faded Soft Shadows

I'm doing research to implement a shadow algorithm for omnidirectional soft shadows in a real-time 3D renderer. I've read about PCF but to me it doesn't look very realistic since it doesn't "fade" ...
0
votes
1answer
216 views

Directly pass from transform feedback buffer to fragment shader

I am building terrain using a lod algorithm and deferred cascaded shadowmaps. The tessellated terrain is about 6,000,000 triangles. I tried this using 2 methods. 1st method: Both the deferred shadow ...
0
votes
1answer
96 views

How can you pass a large amount of textures or equivalent to the fragment shader in OpenGL?

I am adding shadow mapping to a game engine I am working on. For this effect, each light source needs it's own associated shadow map cube texture. I am going to be exaggerated and say there can be ...
0
votes
1answer
130 views

How to create a depth-recording shader for shadow mapping?

I am attempting to implement shadow maps. I am first going to implement spotlights over directional lights (I am aware this is harder). Since I was already rendering the geometry, my attempt was to ...
0
votes
1answer
71 views

Using Fragment Color to store individual bits (GLSL) may introduce issues if OpenGL does any evaluation of the floats before writing them to memory

I need to be able to output individual bits from a fragment shader. I need a lot of bits per fragment too, otherwise I will face a tremendous performance drag. Let's say that we have a whole bunch ...
1
vote
1answer
58 views

OpenGL Shadowmaps Limit

I would like to render an OpenGL scene with an arbitrary number of point lights (at least 1024) with shadows enabled. My current method of rendering shadowmaps, however, cannot do this. Let me ...
0
votes
3answers
510 views

OpenGL ES 2.0 Shadow Mapping - depth only FBO not working due to GL_FRAMEBUFFER_INCOMPLETE_ATTACHMEN

I am trying to add simple shadow mapping to my friends gles 2.0 app. It is based on gles 2.0 and PowerVR SDK. The problem I encounter is that FBO is not valid due to ...
1
vote
0answers
58 views

How to get point depth in shadow space for point light?

I'm implementing exponential shadow maps, and so far I have directional lights and spotlights working perfectly. Currently I'm trying to apply this technique to point lights with cubemapped shadows. ...
0
votes
1answer
189 views

How do I write to a 16-bit depth buffer using Monogame and HLSL?

I'm working on shadow mapping. Part of the implementation involves drawing 3D models to a depth buffer with recommended 16-bit depth. To that end, I'm first creating a render target as follows: ...
0
votes
1answer
179 views

Shadow Shimmering When Moving Objects

I am having a shadow shimmering in my scene when using a shadow mapping technique. I know that there is a lot of posts over the internet dealing with this subject but my issue is slightly different. ...
0
votes
0answers
340 views

Combining parallax occlusion mapping with shadow mapping

I've implemented shadow mapping and parallax occlusion mapping and both of them are working well, but I can't combine them. My problem is that if a model casts shadow to another model which uses POM, ...
3
votes
1answer
120 views

Shadow map sample is weird

I'm attempting to implement Shadow mapping in opengl/GLSL and have encountered a problem with sampling the shadow map itself. I have confirmed that the shadow map is correctly rendered: However, ...
4
votes
3answers
2k views

How do modern game engines handle many shadow casting lights?

This is a very general question, and not aimed at any particular language or graphics API; I am more interested in the theories & algorithms behind the solutions. I'm reasonably familiar with the ...
1
vote
2answers
2k views

Projection Texture Mapping

I have been trying to understand how projective texture works; and, even I have been able to achieve the result by following the steps in tutorial, I fail to understand how it works in my mind. To my ...
0
votes
1answer
102 views

How can i solve this artifact in CSM

I have the next issue when a object is suspended in the air far enough of the ground. How the algorithm works: It checks if the coordinates in the light view matrix of this cascade are inside the ...
0
votes
1answer
485 views

Deferred shadow mapping

Question: What am i doing wrong in the CalcShadowFactor method? It looks like the depth check is not working correctly. Body: I'm using deferred rendering in my engine and i have generated the ...
1
vote
0answers
137 views

Cascade Shadow Map Problems DirectX 11

So after fixing all my lighting and shadow problems that my new terrain system showed me that I had I have an issue with my shadow maps, I have had it since my XNA days but because of my world setup, ...
1
vote
0answers
232 views

Opengl - SpotLight shadow map issue

I have a light / shadow system that implements a spot light too. Every lights are working fine, but the spot light is acting weird. If i dont use any type of "shadow softening" method, it works ...
0
votes
0answers
228 views

Opengl - Spotlight shadow clipping problem

I implemented a light system + shadow mapping. Everything works fine with point light / directionnal light, but when i come to do spotlight shadow mapping, its a little messy. Im pretty sure this is ...
1
vote
1answer
107 views

Problem with RGBA sampled shadowmap

I'm having a problem with the generation of a shadowmap that is converted to RGBA. The following glsl code is used to put the depth into the depthbuffer : ...
0
votes
0answers
102 views

Opengl - Shadow map working with Nvidia graphics but not working with AMD

At school i am using an up to date NVIDIA graphic card and i did my shadow map suscessfully. I tried to copy the project and try it at home with my AMD graphic card (which i just updated). Now ...
0
votes
1answer
228 views

Opengl - Shadow mapping issue

I am currently trying to do a shadow map. Here is the depth map when drawn on a quad (Which looks good to me): And here is the final result when i try to cast the shadow in my fragment shader: As ...
1
vote
0answers
93 views

Shadow Mapping, why does my shadow change size and position when I rotate my light?

I have looked far and wide for this and have not found any issue like this, so far. Basically, when my light is at a certain angle my shadows seem to be correctly positioned and scaled, yet if I ...
1
vote
2answers
285 views

Shadow mapping too slow and ugly! [closed]

As many of you are, I am working on a game. I have just added my first attempt at shadow mapping (standard variation) and quite frankly I am very disappointed. I am literally squeezing as much out ...
0
votes
1answer
181 views

Why does lightmapping take so long compared to real time shadows?

I am using Unity 5. As a test, I set the realtime shadow resolution to max and the distance to cover my entire scene with no cascades. As expected, it lagged severely, but I could still move the ...
1
vote
0answers
187 views

Front Face Culling with Shadowmapping

To avoid shadow acne I usualy use front face culling which works great. But for my current implementation the mesh is a quite complex terrain (depending on the lod level) and than the shading (dot ...
1
vote
1answer
959 views

Implementing Shadow Mapping in Python and OpenGL 2.1

I am trying to create a little shadow mapping demo. My code is currently divided into three rendering passes: Pass 1 - Create the depth texture that will be used for shadow mapping on an offscreen ...
5
votes
0answers
93 views

How do I align the cube in which shadows are computed with the view frustrum? (“View Space aligned frustum”)

Short and concise: Given 8 world space positions that form a cube of arbitrary size, position and orientation and given an arbitrary light direction. How do I compute the View and Projection matrix ...
0
votes
1answer
111 views

My point light shadows only really work if my point light is at the world origin (0,0,0)

When I move the light, the shadows will fall apart as if their occluders aren't occluding them in certain areas. For example, in the following scene, I move a pointlight 400 units down the Z axis, I ...
1
vote
1answer
143 views

HLSL pixel inside a view (cascaded shadowmapping)

I'm figuring out shadowmapping in HLSL (see also this question). I understand that I need projection matrices for each cascading shadowmap. I use this code to create the projections: ...
1
vote
1answer
675 views

HLSL Shadowmap shader for large scale environments

I'm working on a racing game in Monogame. The game runs fine so far using Monogame's BasicEffect (link to video). I wanted to add shadows so I implemented a shadowmap using this as a base. and a ...
1
vote
0answers
166 views

Direct3D11: Directional Shadow Maps

I've recently implemented shadow maps on my project. However, I'd like to add a feature that allows the light direction to be dynamically changed, so that the terrain can be viewed using different ...
3
votes
1answer
499 views

Issues with depth calculation in HLSL shader

I'm currently trying to implement shadow maps in my graphics framework. I ran into an issue with depth calculations I wasn't able to solve myself (yet). I did a lot of testing and debugging and think ...
2
votes
0answers
71 views

Consistent Shadow Map Filtering

I want to filter my shadow map generated by PSSM, but the problem is that I have a inconsistent filter size. The problem is that the shadow map sources rotate to find the best fit for the camera ...
4
votes
3answers
403 views

Can't find the solution to the “shadow acne” problem

This is how it looks now: This is the code that generate the shadow matrix an shaders source: ...
4
votes
0answers
132 views

Virtual infinite plane in shadow map

I have a WebGL deferred rendering pipeline, where I'm rendering shadow map with VSM technique. The goal is that the scene, or model, is hovering in space, and in addition to casting shadow on itself, ...
1
vote
0answers
48 views

Directional light view frustum stabilisation

Calculating directional light view frustum based on scene objects(bounding frustum) results in noticeable scene jittering on camera movement in CSM and non-CSM rendering code paths. What are the ...
1
vote
0answers
43 views

DirectX 9 Light projection

I am trying to see changes of component 'z' from light space. In vertex shader component 'z' divide 'w' is not 0. But after sending float4 with texcoord1 to pixel shader its 0. All matrices are good. ...
4
votes
1answer
812 views

How to attach a framebuffer to a whole cube map from a GL_TEXTURE_CUBE_MAP_ARRAY?

I'm trying to make shadow cube maps in an array. I want to draw each shadow map with a single pass using a geometry shader, which I read about here: https://stackoverflow.com/questions/462721/...
4
votes
1answer
232 views

Only one object rendered to FBO for Shadow Map

I've been playing around with rendering shadow maps using FBOs in OpenGL. I set up a simple directional light in my engine and managed to get a shadow map rendered. My Scene is a big castle and the ...
3
votes
0answers
553 views

Shadow mapping - Can't get the right texture coordinates

I'm trying to implement shadow maps for Spotlight's, but alas I can't get them to work. I have verified that my fragment shader is getting the shadow map texture. I can sample from it in the ...
0
votes
1answer
287 views

Generate Mesh of Shadow Volume

Given a mesh, I want to generate another mesh that is effectively a shadow volume of this mesh. I am looking for an algorithm/solution/implementation/reference that can do this under the following ...
40
votes
1answer
8k views

Why is shadow mapping the standard?

Though I am a programmer by trade, I have barely touched game development at all. I've had this question for some time, and now that I'm looking into game development I thought it would be a good time ...