Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#1771 closed defect (fixed)

[PATCH] Building previews casting overproportioned shadows

Reported by: zoot Owned by: ben
Priority: Nice to Have Milestone: Alpha 14
Component: Core engine Keywords: patch
Cc: Patch:

Description

Attachments (3)

disable_casting_shadows_on_preview_models.patch (4.8 KB ) - added by Eric Bobbitt 11 years ago.
no_preview_shadows_05222013.patch (3.0 KB ) - added by historic_bruno 11 years ago.
new modified version of ericb's patch
no_preview_shadows_08172013.patch (5.3 KB ) - added by historic_bruno 11 years ago.
update disabling decal shadows

Download all attachments as: .zip

Change History (15)

comment:1 by historic_bruno, 11 years ago

Preview entities don't really exist in the game, so it makes little sense for them to have shadows. They also cause ugly artifacts. It seems better for them to neither cast nor receive shadows.

comment:2 by historic_bruno, 11 years ago

Keywords: simple graphics added
Priority: Should HaveNice to Have

comment:3 by Eric Bobbitt, 11 years ago

This definitely needs review as I'm recursively removing flags from the model after recursively setting them. (This sounds odd, but I didn't see any direct means of enabling the flag to begin with, so it didn't appear to be a matter of just not enabling the flag MODELFLAG_CASTSHADOWS)

comment:4 by Eric Bobbitt, 11 years ago

Keywords: review patch added
Summary: Building previews casting overproportioned shadows[PATCH] Building previews casting overproportioned shadows

comment:5 by Eric Bobbitt, 11 years ago

I forgot to mention that the model still receives shadows -- I couldn't figure out where this was being set, or rather, where it could be unset from.

comment:6 by Eric Bobbitt, 11 years ago

DISABLE_RECEIVE_SHADOWS is now set

comment:7 by Kieran P, 11 years ago

Keywords: simple graphics removed
Milestone: BacklogAlpha 14

comment:8 by historic_bruno, 11 years ago

There are a few problems in the patch:

  • In the new CModel::RemoveFlagsRec function, you are checking if the MODELFLAG_IGNORE_LOS flag is being removed, but then ignore LOS, where I think it should be doing the opposite (not ignoring LOS)
  • In CCmpVisualActor::InitModel, where you are setting material defines, I think those are only going to apply to the parent model, not to all the sub-models recursively (e.g. props)
  • Also there's no reason to set modelFlags to 0 before adding the flag, in fact, there's no need to use the variable at all, it can be passed directly into RemoveFlagsRec

However, because it's not only flags that need to be recursively removed but also material definitions that need to be added recursively, I have modified the original patch to use a CModel::RemoveShadowsRec function instead. This patch seems to work, except the decal on some preview models still receives a shadow, which is slightly annoying.

Last edited 11 years ago by historic_bruno (previous) (diff)

by historic_bruno, 11 years ago

new modified version of ericb's patch

by historic_bruno, 11 years ago

update disabling decal shadows

comment:9 by ben, 11 years ago

Owner: set to ben
Resolution: fixed
Status: newclosed

In 13706:

Removes shadow casting and receiving on preview entities, patch started by ericb, fixes #1771

comment:10 by leper, 11 years ago

Keywords: review removed

comment:11 by historic_bruno, 11 years ago

So, I was able to remove the decal shadows by modifying the terrain shaders slightly (they didn't support the DISABLE_RECEIVE_SHADOWS definition), and decal-only models like fields needed a special case.

comment:12 by leper, 11 years ago

In 13945:

Let corpses cast shadows again. Refs #1771.

Note: See TracTickets for help on using tickets.