2022 possible shadow bug

Shadows are casting improperly.
The window areas are not casting a shadow - they should be.

When I hide one of the exterior wall faces, the shadow corrects itself.
EG:

No groups or components are assigned as “Do not Cast Shadows”. It’s all simple geometry that I created myself.

Have tried this on 2 different computers with different graphics cards (one a Quadro, the other a GeForce).

Cheers

Shadowbug.skp (10.5 MB)

Curious. Setting the raw geometry of the exterior wall to not cast shadow also fixes. Something odd going on here.

Yeah I noticed that.

I think I also set it to Not show a shadow, then set it back to Show shadows, then it worked…

It reminds me of the bug that occurs when a Face-cutting component doesnt cut a face sometimes, but then it works if you open the parent component and close it again.

Feels like some sort of double negative problem as it’s shining through two walls, the transparency of the second is overriding the first. Oddly adding a third surface adds up to correct behavior again.

1

Yep, its a slightly odd application of materials, but thats how i make buildings.

Actually now that you mention it, ive struggled with shdows/transparency in 2022. When an face material is less than 50% opacity i thought it would typically (SU2021) be invisible to the sun’s rays.
I’ll do some testing when back at my PC.

Not at SU right now, but the threshold is at 70% opacity, if I remember right.

Check how you both have the Material Transparency set, is it Faster or Nicer?

Especially if your materials use PNG images with transparency. PNG transparency, BTW, has no effect on shadow casting.

Correct - 70% is the threshold (not sure where I got 50% from),
(sidenote: wouldn’t it be great if shadows matched the opacity of their face?? eg a 50% lighter shadow for a 50% transparent object)

Also correct - Transparency quality doesn’t affect shadows, (it just improves the AA on PNG’s edges). (sidenote: I’m not sure there’s any performance impact from higher transparency these days since GPUS are more than capable of rendering vast amounts of alpha).

2022 changes the way Transparency is applied. By default its applied to BOTH sides of a face if that face is styled using default front/back materials. Which is a good system, I think…in theory.
I suspect this bug occurs when 2021 models are bought into 2022, and unknowingly impacted by this change.

My drawing method (like others) uses transparent “back” faces so that we can see into (or out of) rooms.

Here’s a graphical explanation of what I think is happening:

I think it is a bug because a shadow should not be cast through a face if that face has one solid side. I can’t think of any good reason why shadow would disrespect a solid face…

I don’t see a change. It has always been possible to paint the two sides of a face with two different materials. When you use the Paint tool to a face that has no applied materials, and choose a transparent material, it applies the material to both sides of the face automatically. If the front face already has a material on it and you paingt the back face, the material will apply only to the back face.

If you want the shadow casting to be retained, use an opaque material with a totally transparent PNG texture.

The problem seems to be the result of ill formed window components that are set to Cut Openings. This little script will clear the cuts_opening flag for all of the components in the model and seems to resolve the issue. (not yet tested with SU2022)

model = Sketchup.active_model
defs = model.definitions
sel = model.selection
sel.clear
model.start_operation('Clear Cuts-Opening Falgs', true)
defs.each { |defn|
  if defn.behavior.cuts_opening?
    p defn
    defn.behavior.cuts_opening = false
    sel.add(defn.instances)
  end
}
model.operation_commit
nil

This topic was automatically closed after 186 days. New replies are no longer allowed.