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 ...
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 ...
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.
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 ...
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 ...
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 ...
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 ...
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 ...
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.
...
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.
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 ...
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 ...
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 ...
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:
...
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 ...
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: ...
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 <...
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 ...
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 ...
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,...
1
vote
Calculating the shadow cast by triangle onto the YZ plane
Find the equation of each line that starts on the light and goes through a vertex of the triangle. Then make the equation equal to the equation of the plane.
Basically, lightPosition + ...
1
vote
Accepted
Omnidirectional Faded Soft Shadows
A mathematically perfect point light that shines in exactly straight rays doesn't cast soft shadows.
Imagine you're a tiny bug crawling along the shadow-receiving surface. From each spot you crawl to,...
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 ...
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 ...
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 :
...
1
vote
How can I fix my shadow caster problem?
I solved this problem by adding Transparent Queue tag to my shader.
...
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...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
shadows × 240lighting × 69
shadow-mapping × 69
unity × 62
opengl × 60
shaders × 37
2d × 30
glsl × 29
xna × 16
c# × 13
c++ × 12
3d × 12
directx × 12
rendering × 10
graphics × 10
fragment-shader × 10
depth-buffer × 9
deferred-rendering × 9
hlsl × 8
java × 7
mathematics × 6
lwjgl × 6
libgdx × 5
directx11 × 5
projection × 5