#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)
Change History (15)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
Keywords: | simple graphics added |
---|---|
Priority: | Should Have → Nice to Have |
comment:3 by , 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 , 11 years ago
Keywords: | review patch added |
---|---|
Summary: | Building previews casting overproportioned shadows → [PATCH] Building previews casting overproportioned shadows |
comment:5 by , 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.
by , 11 years ago
Attachment: | disable_casting_shadows_on_preview_models.patch added |
---|
comment:7 by , 11 years ago
Keywords: | simple graphics removed |
---|---|
Milestone: | Backlog → Alpha 14 |
comment:8 by , 11 years ago
There are a few problems in the patch:
- In the new
CModel::RemoveFlagsRec
function, you are checking if theMODELFLAG_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 intoRemoveFlagsRec
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.
by , 11 years ago
Attachment: | no_preview_shadows_05222013.patch added |
---|
new modified version of ericb's patch
by , 11 years ago
Attachment: | no_preview_shadows_08172013.patch added |
---|
update disabling decal shadows
comment:10 by , 11 years ago
Keywords: | review removed |
---|
comment:11 by , 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.
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.