Skip to main content
44 votes
Accepted

Why do some games show lights shine through walls?

Expanding on TomTsagk's correct answer, I thought it might help to describe a bit more about why games work like this. Light in games doesn't really "travel" from the source, to the surface, to the ...
DMGregory's user avatar
  • 135k
23 votes

Why do some games show lights shine through walls?

Long story short, this happens for performance reasons. When there's a light on the screen, by default it shines on all objects (obstructed or not), so the game would need to make extra calculations ...
Tom Tsagkatos's user avatar
5 votes
Accepted

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

Realtime shadow maps allocate texels for everything the light can see. Lightmaps allocate texels for everything. This makes a big difference in several cases: faces occluded from the light don't ...
DMGregory's user avatar
  • 135k
4 votes
Accepted

How can I make shadows darker in unity5 without changing light intensity?

Use a spot light with increased Range and Spot Angle. Use full shadow Strength.
Sourav Paul Roman's user avatar
4 votes

Jagged shadows with default settings

So it seems like while changing the quality settings did increase the quality of the shadows it did not remove the artifacts, but when I was int he QualitySettings menu, I saw some settings that I had ...
zimooo2's user avatar
  • 93
4 votes
Accepted

Cave lighting in Unity

Some information on the Grow Home/Grow Up art direction here if you're still interested :) We relied very heavily on our custom Fresnel shader for... well... the entire look of the game. But it was ...
Jack's user avatar
  • 56
4 votes
Accepted

Deriving shadow position from a 2D heightmap

You can associate a "shadow height" with each cell on your map. This is the elevation something would need to have above 0 / "sea level" in order to rise out of the shadow and into ...
DMGregory's user avatar
  • 135k
3 votes

How can I get PagedGeometry grass to receive shadows?

This is not my answer, but a reference to what I believe is the solution to the question. The post I am linking to below (titled "paged geometry trees and shadows") directly describes solving the ...
Tim Holt's user avatar
  • 10.3k
3 votes
Accepted

Pixelated shadows in Unity

You're reaching the upper limits of the built in lights. The alternative is to create your own (rather complicated, it's a combination of shaders, materials and scripting) or find a replacement on the ...
House's user avatar
  • 73.3k
3 votes
Accepted

Strange realtime shadows in Unity3D

Just like your main rendering camera, your shadowcasting lights have a near plane. They can only see geometry that's out past the near plane - anything closer along the light's axis gets clipped out. ...
DMGregory's user avatar
  • 135k
3 votes
Accepted

Making Unity shadows work at a small scale

@DMGregory's suggestion was enough to point me in the right direction... Changing the camera clipping plane didn't help, however, changing the max shadow distance worked.
Basic's user avatar
  • 1,278
2 votes
Accepted

How does one model the sun in a ray tracer?

If you take sun as a point, you can not have shadows smoothing/blurring for tall objects. Notice how due to measurable sun angular size, the sahdow gets smoother/blurry the farther it lies from the ...
Kromster's user avatar
  • 10.7k
2 votes
Accepted

Shadow casting in 2D OpenGL

For your last question, yes, you have to iterate through every caster, in same cases even multiple times. I've just made a simple game based on shadow and light ( https://youtu.be/fNp7GeHxInI ). Of ...
Liuka's user avatar
  • 585
2 votes

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

First of all, I am not very familiar with monogame specifically, but what I say apply to DirectX 11, which I expect Monogame is using under the hood. Now, for most cases, you don't need to expicitly ...
János Turánszki's user avatar
2 votes

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

I would use a Cube Map Texture Array for this. You can query the maximum array texture layers with: ...
Robinson's user avatar
  • 311
2 votes

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

One of the things you need to understand that the red component is actually visually correct. The Z Depth is being embedded in values close to 1. If you want to just see a colour change to see ...
ErnieDingo's user avatar
  • 1,150
2 votes

Phantom objects in ray tracing

The issue was not testing that the intersection needs to happen between the object and the light position. i.e I was raytracing past the light. i.e the check: ...
Makogan's user avatar
  • 260
2 votes

Can you access the vertices passed into GLSL as an array?

The obvious answer is to pass the data once: as a storage buffer. Period. Nobody's forcing you to use vertex attributes, after all. You can use gl_VertexID and <...
Nicol Bolas's user avatar
  • 26.1k
2 votes

Unity - jagged shadows when export as apk?

I know this question is almost a year old now, but I ran into a similar problem and couldn't find a lot of info. What happened for me was I just created a template scene and was testing things out and ...
Oxters Wyzgowski's user avatar
2 votes

Matrix math in cascade shadow mapping

I have figured a hacky (at least from my lack of understanding) way to fix the issue - construct a new light view matrix every time. This is also what is happening in Vulkan example of cascade shadow ...
shybovycha's user avatar
2 votes
Accepted

How does planar shadow projection interact with perspective projection?

As mentioned in the question, the author makes a rather misleading statement: Observe that this equation modifies the w-component so that sw=n\$\cdot\$L. Thus, when the perspective divide takes place,...
Daniel's user avatar
  • 131
1 vote
Accepted

Unity Shadow shows on my Android device but NOT my Windows Mobile device

OK. So the only conclusion I can make here is Lumia 640 XL cannot support anymore advanced 'fancy' stuff compared to other normal devices. Thats all I can assume. Thanks. Why I say so: I even ...
elliotching's user avatar
1 vote

Proper indoor lighting without directional light

Static lights should use the light map (as they don't change, there is no need to use dynamic resources). Moving lights, should use some form of real-time shadow mapping, which involves doing a sort ...
Ian Young's user avatar
  • 2,649
1 vote
Accepted

How can I animate shadow in surface shader?

Just add "addshadow" to your #pragma surface surf Standard alphatest:_Cutoff vertex:vert line. Boom Unity does the rest. So it looks like this : ...
Uri Popov's user avatar
  • 3,027
1 vote

How can I fix my shadow caster problem?

I solved this problem by adding Transparent Queue tag to my shader. ...
Seyed Morteza Kamali's user avatar
1 vote
Accepted

A shader that casts shadows, doesn't receive shadows and doesn't render any textures/models at all?

As mentioned in the comment by DMGregory, there is an option in the renderer to do this...
user3797758's user avatar
  • 3,641
1 vote

Shadow Shimmering When Moving Objects

The easiest way to overcome this would be blurring your shadows. This is obviously not a perfect solution, but might be worth trying it out, it might just solve your problem. Now, there are multiple ...
János Turánszki's user avatar
1 vote

How to receive shadows on animated object In optimize way?

The 2 pass system is the only way. It's how the engine handles shadows. Here's an example of a shadow pass from unity's manual. You'd need to modify the shadow pass' vertex shader. ...
Zebraman's user avatar
  • 819

Only top scored, non community-wiki answers of a minimum length are eligible