Ticket #143 (closed enhancement: fixed)
[PATCH] Shadowing: Selectively disable/enable for actors through properties
| Reported by: | nicolai | Owned by: | philip |
|---|---|---|---|
| Priority: | If Time Permits | Milestone: | Alpha 10 |
| Component: | Core engine | Keywords: | simple |
| Cc: |
Description
Basically the default for actors would be that they would cast a shadow and they would recieve a shadow. Only need flags if they don't in either case. Something like:
<not_recieve_shadows /> <not_cast_shadow />
Attachments
Change History
comment:1 in reply to: ↑ description Changed 4 years ago by Mythos_Ruler
comment:3 Changed 3 years ago by Philip
- Keywords simple added
Some of this is almost implemented already.
See source/graphics/ObjectBase.cpp for loading the actor XML files - currently it detects <castshadow/> elements, which most (all?) actors (in binaries/data/mods/public/art/actors) set. Shadow-casting is enabled by default anyway, so it's never going to be disabled.
Maybe the best approach is:
- Change the m_CastShadows default to false.
- Make sure all actors have <castshadow/>.
- Verify that the property is pushed through to the renderer, and rendered correctly.
As a second stage:
- Add support for a <noreceiveshadow/> (or use <receiveshadow/> and add it to all the current actors and to the Actor Editor tool), which will probably require renderer changes too.
Changed 3 years ago by lubosz
- Attachment receiveshadows.diff added
Patch for ActorEditor?, Model, ObjectBase? and ObjectEntry? to support receiving shadows
Changed 3 years ago by lubosz
- Attachment actors.diff added
Changes in actors. Every actor now contains <castshadow/> and <receiveshadow/>
Changed 3 years ago by lubosz
- Attachment changeActors.py added
Python script which walks the actors and adds the tags
comment:4 Changed 3 years ago by anonymous
- Milestone Environment Demo deleted
Milestone Environment Demo deleted
comment:10 Changed 2 years ago by historic_bruno
- Summary changed from Shadowing: Selectively disable/enable for actors through properties to [PATCH] Shadowing: Selectively disable/enable for actors through properties
Changed 16 months ago by historic_bruno
- Attachment receiveshadows_r11037_02072012.patch added
updated version applied to r11037
comment:18 Changed 16 months ago by historic_bruno
- Keywords simple added; simple, review removed
- Milestone changed from Alpha 9 to Backlog
This ticket can be unmarked for review and sent to backlog, because the patch lacks the renderer changes needed to make <receiveshadow/> work.
comment:19 Changed 13 months ago by Philip
- Status changed from new to closed
- Resolution set to fixed
Hmm, this got delayed a bit...
The renderer is finally capable of per-object disabling of shadow-receiving. I no longer think it makes sense as an actor flag, though - disabling shadow-receiving seems ugly and wrong and unnecessary except for objects with emissive materials (i.e. glowing, so it's lit by itself rather than by the shadowable sun), and in that case it's more appropriate to set a flag in the material XML files instead.
So, r11500 lets materials say <define name="DISABLE_RECEIVE_SHADOWS" value="1"/>, though we don't have any that use that yet.
r11499 makes the engine respect the actor <castshadow/> flag properly (as per the patches here), and r11497 and r11498 add that flag to all the current actors.

Replying to nicolai:
This would be excellent if this is applicable to items such as grass sprites, because they cast ugly shadows, but I'd still like them to receive shadows.