Opened 18 years ago

Closed 12 years ago

Last modified 12 years ago

#143 closed enhancement (fixed)

[PATCH] Shadowing: Selectively disable/enable for actors through properties

Reported by: Nicolai Hähnle Owned by: philip
Priority: If Time Permits Milestone: Alpha 10
Component: Core engine Keywords: simple
Cc: Patch:

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 (4)

receiveshadows.diff (5.9 KB ) - added by Lubosz 14 years ago.
Patch for ActorEditor, Model, ObjectBase and ObjectEntry to support receiving shadows
actors.diff (355.8 KB ) - added by Lubosz 14 years ago.
Changes in actors. Every actor now contains <castshadow/> and <receiveshadow/>
changeActors.py (821 bytes ) - added by Lubosz 14 years ago.
Python script which walks the actors and adds the tags
receiveshadows_r11037_02072012.patch (6.3 KB ) - added by historic_bruno 12 years ago.
updated version applied to r11037

Download all attachments as: .zip

Change History (24)

in reply to:  description comment:1 by Michael D. Hafer, 15 years ago

Replying to nicolai:

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 />

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.

comment:2 by Erik Johansson, 15 years ago

Owner: Nicolai Hähnle removed

comment:3 by Philip Taylor, 14 years ago

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.

by Lubosz, 14 years ago

Attachment: receiveshadows.diff added

Patch for ActorEditor, Model, ObjectBase and ObjectEntry to support receiving shadows

by Lubosz, 14 years ago

Attachment: actors.diff added

Changes in actors. Every actor now contains <castshadow/> and <receiveshadow/>

by Lubosz, 14 years ago

Attachment: changeActors.py added

Python script which walks the actors and adds the tags

comment:4 by (none), 14 years ago

Milestone: Environment Demo

Milestone Environment Demo deleted

comment:5 by Andrew, 14 years ago

Milestone: Backlog

comment:6 by fabio, 14 years ago

Milestone: BacklogAlpha 3

comment:7 by Kieran P, 13 years ago

Milestone: Alpha 3Alpha 4

comment:8 by Erik Johansson, 13 years ago

Keywords: review added

comment:9 by Kieran P, 13 years ago

Milestone: Alpha 4Alpha 5

comment:10 by historic_bruno, 13 years ago

Summary: Shadowing: Selectively disable/enable for actors through properties[PATCH] Shadowing: Selectively disable/enable for actors through properties

comment:11 by Kieran P, 13 years ago

Milestone: Alpha 5Alpha 6

comment:12 by Kieran P, 13 years ago

Milestone: Alpha 6Alpha 7

comment:13 by Kieran P, 13 years ago

Owner: set to Lubosz

comment:14 by Kieran P, 13 years ago

Priority: Nice to HaveIf Time Permits

comment:15 by Kieran P, 13 years ago

Owner: changed from Lubosz to philip

comment:16 by Kieran P, 13 years ago

Milestone: Alpha 7Alpha 8

comment:17 by Kieran P, 12 years ago

Milestone: Alpha 8Alpha 9

by historic_bruno, 12 years ago

updated version applied to r11037

comment:18 by historic_bruno, 12 years ago

Keywords: review removed
Milestone: Alpha 9Backlog

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 by Philip Taylor, 12 years ago

Resolution: fixed
Status: newclosed

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.

comment:20 by Kieran P, 12 years ago

Milestone: BacklogAlpha 10
Note: See TracTickets for help on using tickets.