Questions tagged [shadows]

Dark spaces cast by the presence of a solid object blocking the flow of light. Often helpful for telling where your character is going to land.

Filter by
Sorted by
Tagged with
1 vote
1 answer
98 views

Pick which directional light shades which object

Suppose you have two directional lights pointing at one sphere from different angles. You would expect the sphere to cast two shadows, but it turns out that this isn't the default behavior. The first ...
1 vote
1 answer
2k views

Drawing faded lightmap in 2D polygon

I have been making a 2D visiblity algorithm by following this tutorial http://simblob.blogspot.se/2012/07/2d-visibility.html I have managed to create the light vertices and it works fine when I draw ...
4 votes
2 answers
2k views

Hide some objects from the camera (fog)

I'm trying to implement a visibility representation in a 2D game ( no plains, no quads - plain 2D ) In the examples below I have calculated what the player can see using raytracing and added all the ...
1 vote
0 answers
230 views

How can I modify my procedural shadows to also show some of the walls?

I'm rendering shadows in Libgdx with the method from this tutorial. I think it's a nice and easy method. I render all my shadows in a framebuffer, then invert it. Before invert: After Invert: ...
5 votes
1 answer
2k views

C++ OpenGL ShadowMap Issue/Artifacts

I am currently implementing basic shadow mapping in my C++ Custom Engine using GLSL 4.10. It is currently working with basic PCF anti-aliasing and very minimal reduction for unwanted artifacts. Here ...
2 votes
1 answer
177 views

XNA Diffuse Shader Issue. Edge lighting problem. Image Attached

As you can see in this image the diffuse shading is working correctly in some places but in other places such as the the bottom of the sphere you can see the squares/triangles of the mesh. Any idea ...
3 votes
1 answer
702 views

Shadow mapping. I don't understand what to do after creating the depth texture

I'm taking an intro to computer graphics course, so this is something we haven't touched on. I am reading this tutorial http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-16-shadow-...
0 votes
0 answers
415 views

How to move vertices of matrix in order to cast a 2d shadow?

I am trying to add shadows to my 2D xna game. Currently I have created a "shadow" using the texture of the caster with a transparent gray color, rotated, and stretched using a matrix. This, though, ...
0 votes
1 answer
153 views

XNA Masking Mayhem

I'd like to start by mentioning that I'm just an amateur programmer of the past 2 years with no formal training and know very little about maximizing the potential of graphics hardware. I can write ...
2 votes
2 answers
2k views

How to achieve a Gaussian Blur effect for shadows in LWJGL/Slick2D?

I am currently trying to implement shadows into my game, and after a lot of searching in the interwebs I came to the conclusion that drawing hard edged shadows to a low resolution pass combined with a ...
1 vote
1 answer
2k views

Why are shadows not snapping to the objects?

I'm using a directional light in Unity to cast shadows. However, the shadows don't appear to be "snapped" to the objects creating them. The object appears to be floating in mid air while it actually ...
-1 votes
1 answer
1k views

Minecraft - like lighting engine

So I was looking on how to create a minecraft - like lighting engine and I found the following post: How can I implement lighting in a voxel engine? The answer to it was incredible and perfectly ...
1 vote
1 answer
237 views

how to define a field of view for the entire map for shadow?

I recently added "Shadow Mapping" in my XNA games to include shadows. I followed the nice and famous tutorial from "Riemers" : http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series3/Shadow_map.php . ...
0 votes
1 answer
257 views

CSM DX11 issues

I got CSM to work in OpenGL, and now Im trying to do the same in directx. I'm using the same math library and all and I'm pretty much using the alghorithm straight off. I am using right-handed, column ...
4 votes
1 answer
534 views

PCF shadow shader math causing artifacts

For a while now I used PCSS for my shadow technique of choice until I discovered a type of percentage closer filtering. This method creates really smooth shadows and with hopes of improving ...
1 vote
1 answer
2k views

How can I simulate shadows for a 2D top-down game? [duplicate]

I'm trying to simulate shadows for a 2D top-down RPG (in Python), but I can't think of the best way to do this So far I've tried making copies of the original game entities and turning all opaque ...
4 votes
0 answers
1k views

implementing shadows into my 2D GLSL-based lighting system

I'm writing a lighting system in OPENGL using GLSL shaders, and I'm pretty happy with the light casting I have so far, but I'm totally stuck on casting shadows. Everything I've found online on this ...
0 votes
2 answers
363 views

Single texture or one texture per light for shadow mapping

The basic implementations of shadow mapping that I have seen create a depth texture for each light source affecting the scene. I'm just curious as to why this might be done rather than using and ...
2 votes
1 answer
960 views

Shadow Map field-of-view

I'm implementing a shadow map algorithm with a spotlight (a spotlight that always "looks" at a given object). My issue is that for some configuration, part of the object the light is "looking at" is ...
14 votes
1 answer
2k views

Is a Gaussian blur a fairly accurate representation of soft shadow edges?

I'm not sure if real life soft shadows (from close,large light sources) have a Gaussian or linear falloff, or something else. I'm working on something where I can create the shadows by manipulating ...
1 vote
1 answer
323 views

Depth Map resolution shifting

the problem is with shadow mapping as you can see, actually it works fine but in a certain condition that the Depth Map size must be equal to the size of rendering buffer, I use an infinite ...
1 vote
1 answer
370 views

Center directional light shadow to the cameras eye

I'm currently drawing my directional light shadow using this view and projection: ...
0 votes
2 answers
170 views

Trouble getting shadow maps working

I am trying to implement shadow maps in my game following this tutorial. For some reason, the light is not being occluded. In the above screenshot, the big white sprite in the foreground is a ...
3 votes
2 answers
4k views

Unity - Part of the sprite is covered in shadow

I have a sprite with Transparent/Cutout/Diffuse shader. Recieving shadows is turned on in SpriteRenderer. The light is a pointlight and I am using deffered rendering path. However when I am above or ...
2 votes
1 answer
934 views

Cascaded shadowmapping problem with split distances

I'm doing cascaded shadow mapping and I have problem. From the cameras position, the splits are [camPos, 6], [camPos+6, 12], [camPos+12, 18] and [camPos+18, 100]. The "mSplitDistance" variable is the ...
5 votes
1 answer
3k views

Shadow mapping does not work correctly using GLSL shaders

I'm a beginner in shadow mapping. I have in my scene two meshes : a cube and a floor. The scene is lighted by a single point light. Here's for the following display the light properties : ...
0 votes
0 answers
149 views

Box2D—Dropshadow

I am about to create a Jump'n'run game using Box2D for the physics. I am asked to add a Dropshadow to the main Character, but as I noticed this could become quite complicated. Basically the Light ...
10 votes
0 answers
991 views

How to create 2D shadows [duplicate]

I'd like to create lights and shadows in a 2D environment, like in the image below: I did several searches but got no results. Do you have any hint?
0 votes
0 answers
201 views

Cast shadow without rendering object

I'm new to UDK, and am using it to develop a survival-horror game based heavily on shadows. My question is short: is there a way to create an actor that, when rendered, ONLY renders its shadow (not ...
2 votes
1 answer
163 views

Minimal Projection Matrix

i hope you can help me. I'm currently stuck at the creation process for projection matrices used by shadow maps. The problem is the following: I got the spot/directional light projectionmatrix/...
0 votes
0 answers
91 views

"Blinking" graphical bug when rotating shadow matrix

So, we have implemented Krypton shadows into our code for our 2D game, and it's working beautifully. Only issue is that we're running into a bizarre graphical bug when rotating the shadows with the ...
2 votes
2 answers
1k views

Where should shaders and lights be in a component-based entity system?

Where should I put the shader and the light / shadow calculation? Should that be a component too? And should the rendering system know how to handle them or should there be a separate light system? ...
1 vote
1 answer
5k views

Directional shadow mapping view/projection matrices

I've got shadow mapping with directional lights working, but I believe I am constructing the view/projection matrices wrong. Here's how I build them: ...
4 votes
1 answer
2k views

How can I create 2D shadows that let me detect when the player is inside them?

I'm working on a 2D platform game, and I want my platforms to cast shadows along with some way to detect if the player is inside the shadow area (that is, not hit by the sun). More specifically: I ...
9 votes
3 answers
11k views

First time shadow mapping problems

I have implemented basic shadow mapping for the first time in OpenGL using shaders and I'm facing some problems. Below you can see an example of my rendered scene: The process of the shadow mapping I'...
6 votes
1 answer
3k views

Slope scaled depth bias with normal maps

I'm using a slope scaled depth bias to reduce shadow acne with shadow maps. However, it's causing artifacts when used with normal mapped surfaces because the bias varies over the surface, where it ...
4 votes
1 answer
1k views

Deferred rendering with VSM - Scaling light depth loses moments

I'm calculating my shadow term using a VSM method. This works correctly when using forward rendered lights but fails with deferred lights. ...
0 votes
1 answer
2k views

Creating a 2D texture array for depth view

Following my question here, I decided to create an 2D texture array for all of my depth screen texture so that I can use them for shadows for all my lights. I'm having an issue setting it up, I'm ...
4 votes
2 answers
408 views

Shadowmap first phase and shaders

I am using OpenGL 3.3 and am tryin to implement shadow mapping using cube maps. I have a framebuffer with a depth attachment and a cube map texture. My question is how to design the shaders for the ...
2 votes
1 answer
14k views

How to opitimize Shadows in Unity 3D

I made the shadow of Solider in my game using Unity pro shadows feature. http://docs.unity3d.com/Documentation/Manual/Shadows.html The performance of my game becomes very slow after adding these ...
0 votes
1 answer
2k views

What is required for casting shadows in JavaFX 8 3D?

In a scene with an added point light the shapes are not casting shadows on each other. Is anything required to cause them to cast shadows?
1 vote
1 answer
840 views

Infinite terrain shadows

I'm creating an infinite terrain engine, which generates the terrain either with fractals or noise. How can I make dynamic shadows for the sun on this terrain, if I don't know in advance what will be ...
2 votes
1 answer
632 views

How stencil buffer and glFrontFace help making a shadow?

I'm trying to understand the tutorial 27th in Nehe website. This is about how to cast a shadow of an object using stencil buffer in OpenGL. The idea here is checking the directions of all the faces of ...
1 vote
0 answers
387 views

Unity Pro - Shadow rendering issue

I am using Unity Pro 4.2.1f4 and I always have this sort of glitch. This is due to the shadows and the bias. Even with a low bias this is happening. I've found a thread that talks about that but I ...
0 votes
1 answer
200 views

Shadows go through meshes, and also being applied to itself

I am using Ogre3D and I am using stencil shadows for my character. They work pretty well, but I have 2 problems: first, the shadow is applied to the entity it is casting the shadow, and secondly, the ...
1 vote
0 answers
468 views

Simple shadow casting in 2.5D game

I am trying to build simple game and I just bumped on some logical problem that I am sure many of you already came across. I have a plane - floor and several sprites-trees that have tree texture on ...
0 votes
0 answers
238 views

Shadow-casting through time acting in "reverse" before next notciable shadowmap update

question was re-written to better explain the problem I have a scene of big thin parallelepiped, small cube, and a light source, all aligned on Y axis, like so: ...
2 votes
1 answer
257 views

The math behind Variance Shadow Maps - moments

I am not asking how to implement them (that's not particularly difficult), but I'm having a bit of trouble understanding why the moments used in Chebyshev's inequality (indirectly) are equal to the ...
10 votes
1 answer
894 views

How do I implement 2D shadows cast between layers?

How could I implement 2d shadows that are cast by objects in a different layer? NOT like the dynamic lighting in the well known tutorial from Catalin Zima : But like the shadows of the pipes in this ...
4 votes
2 answers
4k views

2D XNA Tile Based Lighting. Ideas and Methods [closed]

I am currently working on developing a 2D tile based game, similar to the game 'Terraria'. We have the base tile and chunk engine working and are now looking to implement lighting. Instead of the tile ...