How do i create a black circle below my character in the material?

I dont know if this is possible.
So i messed up quit bad in my project.
Im doing an rts with lots of units. So i disabled the shadows.
And though like, im just gonna do a fake shadow later directly in the mesh.
Like a plane below the mesh with a human like form.
Thats way cheaper. And from far away it looks ok.
But i entirely forget. And did all the units without these…
And now im in trouble and trying to find a way to make the units have some fake simulation of shadows below them.
I could edit the mesh but they are vertex animated textures. And that would be quite some work… Like a week of work or more to change every single character…

So this is what im trying to do:
Original:

Trying to do something like this:


My attempt Project:
TestSphereMaskShadow.rar (1.7 MB)

So thats basically it.
Just trying to draw a black circle mask below my mesh in the material.

3 Likes

image

image

Obviously that’s a real shadow under the ball :wink:

You also might be generally interested in

But all this is related to darkening the base of the character

image

I don’t think you can project onto the ground from the material. To get something on the ground, either part of the mesh needs to be there, ready to shaded, or the character needs a plane hovering above the ground, which you shade like a shadow.

1 Like

Wait - blob shadows! :slight_smile:

1 Like

Thanks a lot. So we cant create a very simple shape like a circle, or a circle mask in our mesh with a material alone?
This is what im trying to do. Not exactly darken the bottom of the mesh, though that is very nice effect too…
Maybe this is not possible…?

Like I say, I don’t think you can project from the mesh onto another mesh ( the ground ).

But see that vid above, might help…

1 Like

I only saw that one now. Okay i will try that one and see. But that looks too good. I dont need the intersection. All i need is a circle drawn a somewhere close to the feet, since my game is 2Dish.
Thanks i will get back here to mark it as solution, if this solves it.

1 Like

Another thing you could do, is use mesh distance fields to shade the ground. That would deal with all the characters at once, but also all the objects, unless you marked them as not using DF

MDF

1 Like

Thanks that looks like a better alternative because it doesnt need an additional mesh to intersect the floor plane like the shadow blob…

Though I tried that now. But it didnt work.
What am i doing wrong?

The floor has the material on it, not the mesh :slight_smile:

( material is not masked )

The floor is set to not affect distance fields ( details in the level ), otherwise it self-shadows.

1 Like

Are you sure? Is this correct what im doing? It seems its doing a very subtle shadow on the sphere though im not sure if thats just me hallucinating after many hours working.
Or am i missing something?
If this is correct then how can i make it more pronounced cause i cant really tell that theres a shadow especially when the sphere is not in contact with the floor?

If you really want blob shadows, the way to do it, is to add a Decal Component to the bottom of your character setup, and make the Decal be a darkening blob. Also make sure that “receive decals” is off for the character itself.

However, I highly doubt this will help – did you actually measure that shadows was too expensive? Shadows are well supported on all modern graphics cards, and are generally well optimized in Unreal Engine. At least as long as you only have one light source (“the sun”) casting shadows, and use cascaded shadows on the terrain, it shouldn’t be a performance problem. Consider: People do fully shadowed forests with tens of thousands of trees, a few hundred animated units won’t change that by many percent.

And obviously you’ll want an actual “shadow blob” material configured on the decal, rather than the default green craters…

1 Like

The sphere is totally normal, no special material. The material is on the floor. Only divide by 100! :smiley:

  1. You will not see anything in the preview pane of the material.

  2. Put a default plane in the map ( not touching the ground, for now ).

  3. Put exactly the material I showed on the plane

  4. It will probably go black on stripey.

  5. Set the plane, in the details panel ( in the level ), to not affect distance fields. ( I don’t know if this option is in UE4. If not, the maybe you have to turn off ‘calculate distance fields’ in the static mesh editor ). I watched your vid, here it is, turn it off on the plane

image

  1. Move any object around on the plane.

That’s it :smiley:

2 Likes

I don’t know if decals is the way to go with thousands of minions… :slight_smile:

2 Likes

I still think “actually just use the regular shadow” is the best option.
It’s what it’s for! It’s why you use Unreal Engine! Else you could just use Godot or something.

1 Like

thanks for the answer. but in this situation i cant apply a decal because its hundreds of thousands and im using ISM. So its not a character.
But thanks for the explanation.

I tried it it seems it casts a little barely noticeable shadow?
Is there a way to make it more intense?

Though i still dont think i can use this for my project. This is so far the best result i got. So im gonna put you as the solution.
Thanks alot.
Though i would prefer it to be more darkened the shadow.
Is that possible?

It’s not a shadow. Take a look at my vid :slight_smile:

The plane is white, but the area near the ball becomes black.

image

Why is your ball and plane black, and many other questions?..

1 Like

I see thanks. But can you make way more dark?

Why is your ball and plane black, and many other questions?..
I dont know, the material has the same settings as yours. I dont know how you made it white without plugging in anything specific in the base color.
In mine it becomes automatically black:

The shadow is also very subtle barely noticeable:

The 1 on the lerp is the white

Just to reiterate, the ball has no special material on it, just a normal material, any one you like. The floor has this material on it, and should look white until you move an object near it.

The floor also needs ‘affects distance field lighting’ unchecked in the details. The ball still needs it checked ( like everything else ).

there must be something im doing wrong, because my material and my plane is black color.
And i dont get to see any significant shadow.
I uploaded the project.
Maybe its because its ue4 ?

TestSphereMaskShadow.rar (2.5 MB)

Im pretty sure i have done all the options exactly as you said. Looked it many times.
Could you take a quick look?