Hello!
My scene consists of a dice box (Constrained space for dice throwing, transparent), but main interaction is done through the “Screen Space - Camera” UI canvas. The problem is that this type of canvas ignores shadows, and if you throw dice in the dice box on top of it, it looks like a dice is floating even after landing, because there is no shadow. I would like to make it render. I would appreciate pointing in the direction of a solution.
Here is how it looks (Gray is representation of UI):
Here is how I want it to look, but without prototype texture:
Thanks in advance!
You description is confusing. What are doing? Are you rendering things on RenderTexture? Or are you parenting the 3d GameObject onto the UI elements?
if it’s case 1, the shadow is rendered on the RenderTexture, but the alpha channel is kept as zero. You need some custom shader to adjust it.
if it’s case 2, UI default shader doesn’t receive shadow. you need to write a ui shader that receive shadow
It is perfectly fine to use multiple cameras in a scene (as long as only one has AudioListener on it), then order them with their camera depth property. So in your case I would have a camera that just renders the 2D UI, and then another camera, above the UI, that renders the 3D dice over a 3D box.
Would this approach do what you are trying to achieve?