Air as a part material - appears fully transparent but still casts shadows

As a Roblox developer, it is currently not possible to have invisible parts cast shadows. A good solution to this is to make the Air material available to use on parts. It would appear completely invisible on all transparency settings, but would still cast shadows. This would be incredibly useful, and would allow for more creativity and control over how shadows work in Roblox.

The Air material used to do this, until an update broke it. I am simply asking for this behavior to be reverted. The person who posted this was told that it wasn’t a bug, and it was unintentional behavior. I think it would be useful to have this “feature” back.

Use cases:

  • Darkness effects, like the example shown in the bug report linked above.
  • Top-down games where the roof is hidden so that the player can see through it, but the roof shadows shouldn’t disappear.

If Roblox is able to address this issue, it would improve my development experience because it would be possible to have invisible parts cast shadows.

25 Likes

In my opinion, a better feature request would be the ability to force enable shadows on translucent and transparent parts. That makes it much more flexible and easily applicable for more situations, and also is a much more sensical way of creating transparent parts that can cast shadows (Air doesn’t normally cast shadows?)

29 Likes

What about a NoRender material? Adding another property for this reason feels like API clutter.

2 Likes

I would have suggested replacing the CastShadow boolean with an enum instead, which wouldn’t bloat the API.

9 Likes

That would break scripts, and wouldn’t be ideal. The best method would probably be just to make a new boolean under BasePart labelled “AlwaysCastShadow”.

It’s not the prettiest way, but the next best option would be to deprecate CastShadow and create a new property that has enum options for shadow behavior - then remove CastShadow from the property view all together. It would still work, but would be deprecated in favor of the new enum.

Edit: Misread the post, he was referring to deprecating CastShadow in favor of a an enum. :slight_smile:

4 Likes

Yeah, that’s what I was suggesting. Deprecation > removal :stuck_out_tongue:

5 Likes

Yeah, that’s a great idea! Something like this would work:

Enum.CastShadowMode (or something like that)

  • Default - equivalent to CastShadow = true, hiding shadow if transparency is below 0.7
  • Always - casts shadow regardless of transparency setting
  • Never - equivalent to CastShadow = false
3 Likes

That creates a new issue though. Would the part always cast shadows as if its transparency was 0? What if I find the shadow to be too dark, but don’t want the part to be visible?

1 Like

I’d consider the fine tuning of shadow transparency to be out of the scope of this feature request. This is simply about being able to turn on shadows for parts > 0.7 transparency; for other transparencies the appearance of shadows wouldn’t be changed.

I’d vouch for a complete part class extension, something comparable to how NegativePart is so specialized, for instance. A dedicated shadow caster would be good.

5 Likes