Enable Hidden Shadow under Lighting settings of the mesh.
Hey!
I would like to create shadows on my buildings by using certain objects. I donât want these shadow casting objects to be visible though. I only want the shadowing.
How do I do this?
Thankful for an answer!
Hi Slemnils -
There are two ways to achieve this effect. One is under the objects rendering options disable Render in Main Pass. This will keep the shadow but remove the object from the rendering pass.
The second method would be to Check Hidden Shadow to true under lighting and check Actor Hidden in Game under rendering. This will leave the actor visible in the Editor but only the shadow will remain when you play the game.
Thank You
Eric Ketchum
This is not working on 5.1
Tried on 5.1 and it works.
Try enabling the âbHiddenShadowâ and use the function âSetVisibilityâ to make appear/disappear the object runtime.
This is the exact effect Iâm trying to create.
Iâm really green on UE5. Can you point me in the right direction for exactly what âenablingâ a parameter like âbHiddenShadowâ is and how to use functions on an object?
Thanks!
Sure @boboman42 !
The concept is pretty simple and itâs fundamental for any programming language out there.
You have PROPERTIES and FUNCTIONS.
Properties are pieces of data used by your game. For example, your health can be a float parameter, a float is a decimal number like 0.0 .
There are other types of parameters, one of them is called boolean, or bool, and it can be true or false (1 or 0).
In this case âbHiddenShadowâ is a property of the class UStaticMeshComponent, that means when you select your static mesh actor and go to the âDetailsâ pannel, youâll find that variable there. Enable it by clicking the checkbox!
Now, the actor knows it must keep its shadow on when the cube is hidden, but you have to hide it!
You have two options to achieve this:
-
You can just modify another property called âbActorHiddenInGameâ, and the actor will automatically be hidden when your game starts
-
Script your event by using blueprint nodes (which are FUNCTIONS)
Hereâs a great tutorial you can watch to begin with: Begin Play | Blueprints | Tutorial
And hereâs a little tip for the future: when you see a variable starting with âbâ, thatâs a C++ convention to indicate a boolean parameter, but most of the time, due to engine customizations, that initial âbâ is removed, so youâll need to look for âHidden Shadowâ on the editor if you read âbHiddenShadowâ around.
I hope this will be helpful and welcome to the community!
This node (Shadow Pass Switch) could also work depending on the purpose of what youâre trying to do. It helps mainly if the object will need to be visible sometimes because you can change parameters for the Shadow Pass independently but still hava control over the Objectâs Opacity in Real time!
This node allows you treat object and shadow independently.
how about receive shadow only from other objectsâŚ
By using the ShadowPass Switch you could use the Opacity of the Shadow as 0 and the remaning of the Mesh would still receive shadows but would not cast any until you change the value. But at this point you would get better results if you only deactivate the âCast Shadowâ option in the Mesh Detail panel.
I need to do the same: Cast shadows on an invisible object.
Should i use composure?
I need it for render pourpouse, not for realtimeâŚ
non of that works in 5.3.2.
Actor hidden in game with with hidden shadow option, just hides without casting shadows.
disabling ârender in main passâ makes it a mask, but still visible.
Does anyone managed to find a solution in 5.3.2?
Can use the shadow pass switch with opacity mask in the material.