Ticket #143 (closed enhancement: fixed)

Opened 7 years ago

Last modified 13 months ago

[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

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

Change History

comment:1 in reply to: ↑ description Changed 4 years ago by Mythos_Ruler

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 Changed 4 years ago by feneur

  • Owner nicolai deleted

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

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

Changed 3 years ago by lubosz

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

Changed 3 years ago by lubosz

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:5 Changed 3 years ago by wacko

  • Milestone set to Backlog

comment:6 Changed 3 years ago by fabio

  • Milestone changed from Backlog to Alpha 3

comment:7 Changed 2 years ago by k776

  • Milestone changed from Alpha 3 to Alpha 4

comment:8 Changed 2 years ago by feneur

  • Keywords simple, review added; simple removed

comment:9 Changed 2 years ago by k776

  • Milestone changed from Alpha 4 to Alpha 5

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

comment:11 Changed 2 years ago by k776

  • Milestone changed from Alpha 5 to Alpha 6

comment:12 Changed 23 months ago by k776

  • Milestone changed from Alpha 6 to Alpha 7

comment:13 Changed 23 months ago by k776

  • Owner set to lubosz

comment:14 Changed 23 months ago by k776

  • Priority changed from Nice to Have to If Time Permits

comment:15 Changed 23 months ago by k776

  • Owner changed from lubosz to philip

comment:16 Changed 21 months ago by k776

  • Milestone changed from Alpha 7 to Alpha 8

comment:17 Changed 18 months ago by k776

  • Milestone changed from Alpha 8 to Alpha 9

Changed 16 months ago by historic_bruno

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.

comment:20 Changed 13 months ago by k776

  • Milestone changed from Backlog to Alpha 10
Note: See TracTickets for help on using tickets.