I'm Using Decals to make Blob shadows for my character , but I have a problem. The decals seem to also project threw solid objects and are cast on other objects behind. ( For me that would be the ground) is there any way to stop the decal when it hits the first geometry?
Adjust the Near and Far Planes in the Decal actor properties. You should see the white bounding box adjust in shape. There isn't a way I can figure. without coding, that would handle it in such a way you are asking however.
As long as it's perfectly pointing down, it shouldn't smear along walls.
Take a look at some of the properties in the Decal Render and Decal Filter tabs, they have extra settings that handle some interesting scenarios. Hover over them with your mouse to get the tooltips.
Some good ones to look at
Decal Render:
Slope Scale Depth Bias - render with camera angle bias
Sort Order - if you have multiple decals and want one to always draw on top
Backface Angle - a clip value to have it not project on geometry angles
Blend Range - a range on which it should project on geometry angles (this has a sort of falloff effect for edges)
Decal Filter:
Project On... Booleans - flags for what it should and should not project on
Anyone care to set up a small example in code? basically the decal shouldn't penetrate the floor, but still be able to be cast down if the floor is far away.
If you've attached a decal in code, then you can set the same properties you would in editor in code. Look at the decal actor code and see what you need to set it. I'm assuming this is an added component in the default properties area, so look there in the decal actor code.
Adding it to code would help a lot but in the case of your picture you are probably going to have to do more than that. You can't set the project distance very far as it would still go through the ground then, as you have now. If you make it too low you wouldn't see a shadow when jumping.
What I would do is a decal that has the farplane set to some small value (60 or so, depend on various things) and then trace down from the bottom of the char to know where the ground is at any point. Then place the decal 30 units or so above the ground. So the location of the decal changes continuously, instead of being attached to the character.
Replies
As long as it's perfectly pointing down, it shouldn't smear along walls.
Take a look at some of the properties in the Decal Render and Decal Filter tabs, they have extra settings that handle some interesting scenarios. Hover over them with your mouse to get the tooltips.
Some good ones to look at
Decal Render:
Slope Scale Depth Bias - render with camera angle bias
Sort Order - if you have multiple decals and want one to always draw on top
Backface Angle - a clip value to have it not project on geometry angles
Blend Range - a range on which it should project on geometry angles (this has a sort of falloff effect for edges)
Decal Filter:
Project On... Booleans - flags for what it should and should not project on
What I would do is a decal that has the farplane set to some small value (60 or so, depend on various things) and then trace down from the bottom of the char to know where the ground is at any point. Then place the decal 30 units or so above the ground. So the location of the decal changes continuously, instead of being attached to the character.