How can I make shadows that have sharp edges and not blurry?

Hi, guys
I want to make a nice and clean shodow on an object with the shadow not to de blured? And i want the shadows to be accurate.

Hi Ivailo Korakov,

I’m not too sure exactly where to start with the way your question is phrased since it doesn’t give a whole lot of detail about what you’re attempting to do other than have nice shadows. I’m really not sure if you want a nice crisp hard edge shadow and cannot get that or if you want a blurred edge shadow? If I’m wrong with my information let me know and I’ll see if I can appropriately answer.

A lot of the shadow quality will depend on how you’re using meshes within your scene.

If you are using Static meshes’ you will need to have a 2nd UV channel for your Lightmap shadow information to be baked into. All shadows with static meshes will be pre-computed.

If you are using movable objects you will not need a lightmap and all shadow will be dynamically generated from the light source.

I’ve attached an image of a cane with the image on the left being Static with a lightmap and the image on the right being Movable not using a lightmap.

I’ve not done anything using default setting. I did play a Skylight within the scene to make the shadows not appear so dark.

The Movable objects shadow on the right you can see it has the fuzziness around the edge and the static has a much more crisp hard edged shadow.

If you can clarify if this is what you were asking or if there is a specific issue I can help you resolve I’d be glad to help!

Thank you!

Tim

Thank you a lot Tim for the response and your atention to my question !

I am sorry for the not soo specific question. First this is my mistake. I didn’t put “not” infront of “to de blured” and this made the question confusing. The thing you showed me covers almost my problem. But i have another one. Here are some pictures of it.

This is with the lighting builded and the object set to static for the better shadow without a lightmap.And also i get an eror for overlapping UVs. (77%)

But when i set the mesh to movable the problem disappear.But then we have another problem :

The shadow just dosen’t mach the place of the mesh.This is not a small thing and i need a nice shadow there. But this is not only for small things also it is on a big meshes. And also the shadow is really bad one.How i can fix those things with the first and second image. Do i have to make a lightmap (I don’t know how but i will look into it)?

Hi Ivailo Korakov,

No problem on the confusion! I’m happy to help. :slight_smile:

For proper lightmapping set up you can look at this documentation at WorldofLevelDesign.com

We also have our official documentation on Lightmapping as well.

Now, for some basics about lighting. If you use Static or Stationary lights you will need a 2nd UV channel that is setup in your 3D modeling program. This will be your lightmap where shadow information will be baked so that it’s not handled while the game running. You’ll also want to turn the lightmap resolution on your meshes up. The default is 64 but you would want to use something higher more than likely.

As for the second part of your question regarding the soft shadows from your directional light.

You can fix this a couple of way. If you’re not going to move the directional light in the sky then select for it to be “Stationary” in the details panel.

If you are using a movable sun, set it to “Movable” in the details panel and you can adjust the “Dynamic shadow distance movable light” parameter under the Cascaded Shadow Maps tab to best fit your situation.

Let me know if this works for you!

Thank you!

Tim

I’d like to add that that the issue shown in the last image can be made better by selecting the directional light, going to the Cascaded Shadow Map section and reducing the dynamic shadow distance moveable, and setting your directional light to be movable. You can play with things like the number of cascades and the distribution. This is only for if you need dynamic shadows; static shadows will be much easier to get a nicer result from.

The basic reason for the poor shadow contact in that image, is that the light is trying to project a shadow for an area MUCH bigger than your small play space, and there is not much shadow resolution being designated for that little area. Tweaking those settings allows you to tailor the shadows for a certain scene.

For what it is worth, thin tent straps like that will pretty much always be a challenge to get nice shadows dynamically.

1 Like

Thank you all guys for the big support on the queation.The thing is that i have a lot of exams at the mpment and i can’t test and do all the things
you said. Whe n i try those things i will share the results with you and if there is a problem i will tell you. Ones again thank you for all the support.

Hey all, sorry to bump this old post, however I’m having the same issues. Lowering the “Cascaded Shadow Map” works, though the caveat to that, is the directional light I’m using must be static. All the lightmap UV’s are properly laid out, so no issues there. Your help is much appreciated :).

Maybe this has already been said, but have you tried reducing the distance on your cascaded shadows? Higher resolution will help!

Actually, lowering the value does fix this, but at the cost of having shadows across your landscape and foliage disappear. Instead, what you can do is increase the number of shadow cascades. This will help keep the shadows sharp at all distances. If you first double the number of cascades to 6, you’ll see that all of a sudden the shadows that were blurry are now crisp. Then, if you need it, increasing the Dynamic Shadow Distance will cost more, but it will also make sure you can see shadows on distant foliage and landscape scenery.