softer shadow with glass.

i donwloaded Hard Surface asset. I want to know if there is a way to make transparent materials to cast a softer shadow than a wall. I can make the glass to dont cast shadow, but i cant find how to make the glass to cast soft shadow.

Is there a way?

Nope. :frowning:

You fake it. Use photoshop or gimp. Create your shadow, change the opacity, save it as a png, import it into unity, place it in the scene.

Might help! ;0)

well is not exactly what i look for, because my glass cast a shadow, but this shadow is as dark as a shadow casted by a block of solid material. My question was if is posible to make that a shader cast a shadow less dark than a wall, like some light cross through it.

Apologies, hmm try this…

  • Add another light set it to cast lighter shadows.
  • Set it to a separate ‘glass’ layer and only effect objects in this layer.
  • Put the glass object in this layer.
  • Set your normal light to not cast shadows/effect objects in the glass layer.

Does it work now?

Arowx’s answer is correct. Another way to do it would be to make a custom shader that has a custom shadow caster pass. There’s an example of a similar effect on the unify community http://wiki.unity3d.com/index.php?title=TransparentShadowCaster

That wiki one is quite different, though, as it’s the same shadow color with cutout pieces.

Dont work, basically because the object where Glass is casting the shadow is not in glass layer. i tried lots of things using 2 lights, changing potency, layers, but dont work.

C is for cookie that’s good enough to… err cast a lighter shadow. Would that work? Seems like a good use for them.

Darn it so you would need to duplicate every surface that can have a glass shadow and put it in the glass layer!

Do you think it’s worth putting in a bug report to Unity to say that the lighting and shadow casting layering system is not flexible enough, e.g. Objects cannot be in multiple layers?

so there is no way for an object to cast a shadow with diferent strength?

That’s not a “bug”. How many real-time renderers / games have you seen that do what’s being asked for here? I do believe I’ve seen it done, but it ain’t cheap/common.

1503378--84765--$glassCube.jpg

Ok this is my attempt with a plane (duplicated and two cubes), you can see that both cubes cast a shadow, the plane is pink because I attempted to make the glass shadow light red, to try and get a red shadow.

So it does work it’s just not going to support colored glass using this approach, also it looks like the simple transparent shadow shader does not pass the strength of the shadow from the light settings.

The Black lines are because I used the hard surface glass shader, which has a go at doing reflection.

However I think that with some shader magic (raise the question on the shader sub forum with a link to this thread) and Unity will be able to do what you want it to do.

Unfortunately I have hit the limit of my rather none-existent shader programming skills.

Good Luck and post back with you’re findings!