Page MenuHomeWildfire Games

Introduce some sort of prop LOD
AbandonedPublic

Authored by wraitii on May 27 2019, 7:31 PM.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Summary

This is a response to issues with new actors using dozens of props, resulting in dozens of draw calls.

This introduces "rendering priorities" for props. These can be "must", "should" or "eyecandy". Props will only get rendered if the corresponding setting in config>renderprops is set.

See the gaul barracks for example, which can look more or less naked as required:



Open questions:

  • How to call this? I went with "render priority", but I guess it could be called LOD.

Next steps:

  • Create a GUI setting, though this will likely require restarting given how I'm handling it.
  • Change our existing actor files.
Test Plan

Compile, test in game

Diff Detail

Event Timeline

wraitii created this revision.May 27 2019, 7:31 PM
Owners added subscribers: Restricted Owners Package, Restricted Owners Package, Restricted Owners Package.May 27 2019, 7:31 PM

Wouldn't it better to split refactoring and adding new feature?

It would, but I started halfway through and don't have time to clean it up... I probably will do that tomorrow.

Stan added a subscriber: Stan.EditedMay 27 2019, 7:46 PM

ZaThanks for the feature! How many draw calls with your examples ?
Can there be an override in the atlas actor viewer ?
The actor editor needs to be updated accordingly if it wasn't automatically.

Edit: Will also need to rebake Ao or it might look weird.

In D1926#79561, @Stan wrote:

Edit: Will also need to rebake Ao or it might look weird.

Do you suggest 2 AO maps? Or do you suggest ignore AO for toggleable props?

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/ps/GameSetup/Config.h
|   1| /*·Copyright·(C)·2017·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2017"

source/renderer/scripting/JSInterface_Renderer.cpp
|   1| /*·Copyright·(C)·2018·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2018"

source/renderer/DecalRData.cpp
|   1| /*·Copyright·(C)·2015·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2015"

source/renderer/Renderer.h
|   1| /*·Copyright·(C)·2017·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2017"

source/simulation2/components/CCmpUnitRenderer.cpp
|   1| /*·Copyright·(C)·2018·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2018"

source/renderer/OverlayRenderer.cpp
|   1| /*·Copyright·(C)·2015·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2015"

source/renderer/ShadowMap.cpp
|   1| /*·Copyright·(C)·2017·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2017"

source/graphics/MaterialManager.cpp
|   1| /*·Copyright·(C)·2018·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2018"

source/graphics/Model.h
|   1| /*·Copyright·(C)·2016·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2016"

source/gui/MiniMap.cpp
|   1| /*·Copyright·(C)·2017·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2017"

source/tools/atlas/GameInterface/View.cpp
|   1| /*·Copyright·(C)·2017·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2017"

source/tools/atlas/GameInterface/View.cpp
| 213| 
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Invalid number of character '{' when these macros are defined: 'MESSAGESSETUP_NOTFIRST'.

source/renderer/ParticleRenderer.cpp
|   1| /*·Copyright·(C)·2011·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2011"

source/graphics/ObjectEntry.cpp
|   1| /*·Copyright·(C)·2016·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2016"

source/graphics/LOSTexture.cpp
|   1| /*·Copyright·(C)·2014·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2014"

source/renderer/scripting/JSInterface_Renderer.h
|   1| /*·Copyright·(C)·2018·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2018"

source/graphics/Model.cpp
|   1| /*·Copyright·(C)·2016·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2016"

source/renderer/PatchRData.cpp
|   1| /*·Copyright·(C)·2017·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2017"

source/ps/GameSetup/Config.cpp
|   1| /*·Copyright·(C)·2017·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2017"

source/tools/atlas/GameInterface/ActorViewer.cpp
| 213| »   void·UpdatePropList();
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Invalid number of character '{' when these macros are defined: 'MESSAGESSETUP_NOTFIRST'.

source/graphics/ObjectBase.h
|   1| /*·Copyright·(C)·2016·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2016"
Executing section JS...
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/1520/display/redirect

Stan added a comment.May 27 2019, 7:55 PM

Two AOs seem like a waste of space. Also might require multiple uvs which isn't good. Updqtung props means rebaking aos anyways and now that I found a way to do it on the Gpu it should be faster

In D1926#79566, @Stan wrote:

Two AOs seem like a waste of space. Also might require multiple uvs which isn't good. Updqtung props means rebaking aos anyways and now that I found a way to do it on the Gpu it should be faster

So you suggest to ignore AO for toggleable props?

Stan added a comment.May 27 2019, 8:00 PM

Unless the props is really complex and needs its own ao they should have none. That means more space for the main structure and less drawcalls. Also having fifty different aos for one barrel kills the idea XD

In D1926#79568, @Stan wrote:

Unless the props is really complex and needs its own ao they should have none. That means more space for the main structure and less drawcalls. Also having fifty different aos for one barrel kills the idea XD

I mean why not to leave the current AO maps? I think most people won't notice any meaningful difference.

Stan added a comment.May 27 2019, 8:05 PM

Do you see the black spot where the shield should be ? People will complain.

In D1926#79570, @Stan wrote:

Do you see the black spot where the shield should be ? People will complain.

Just the shield was long staying there and the rest of the wall is burnt on sun :)

Can't people complain about missing AO?

Stan added a comment.May 27 2019, 8:10 PM

Harder to see on barrels. But they might yes :)

Stan added inline comments.May 27 2019, 8:20 PM
source/renderer/DecalRData.cpp
220 ↗(On Diff #8171)

Nuke parenthesis.

source/renderer/Renderer.cpp
676 ↗(On Diff #8171)

Haven't we checked for that just above ?

source/renderer/TerrainRenderer.cpp
653 ↗(On Diff #8171)

Does this mean the game crashes on arb ?

TBH I think you should assume props up to the "should" level will be rendered, for AO. I don't think it matters much if people complain, because the whole point of this feature is that it reduces graphical beauty for speed.

Stan added a comment.May 28 2019, 10:32 AM

TBH I think you should assume props up to the "should" level will be rendered, for AO. I don't think it matters much if people complain, because the whole point of this feature is that it reduces graphical beauty for speed.

Yeah, but since I answer their questions on the forums, it will be on me anyway ?

In D1926#79630, @Stan wrote:

TBH I think you should assume props up to the "should" level will be rendered, for AO. I don't think it matters much if people complain, because the whole point of this feature is that it reduces graphical beauty for speed.

Yeah, but since I answer their questions on the forums, it will be on me anyway ?

Well either don't or link to my comment :p

wraitii updated this revision to Diff 8176.May 28 2019, 10:55 AM
wraitii retitled this revision from Clean up rendering options and introduce some sort of prop LOD to Introduce some sort of prop LOD.
wraitii edited the summary of this revision. (Show Details)

Cleaned up of D1929.

Build failure - The Moirai have given mortals hearts that can endure.

Linter detected issues:
Executing section Source...

source/graphics/ObjectBase.h
|   1| /*·Copyright·(C)·2016·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2016"

source/graphics/Model.h
|   1| /*·Copyright·(C)·2016·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2016"

source/graphics/ObjectEntry.cpp
|   1| /*·Copyright·(C)·2016·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2016"

source/graphics/Model.cpp
|   1| /*·Copyright·(C)·2016·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2016"
Executing section JS...
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/1525/display/redirect

Stan added inline comments.May 28 2019, 11:14 AM
source/graphics/ObjectBase.cpp
205

any reason for prio and not priority ?

source/graphics/ObjectEntry.cpp
242

Can't you just not add it, instead of marking as hidden ? :) Or does that allow you to do reenable them without restarting the game ?

wraitii added inline comments.May 28 2019, 11:17 AM
source/graphics/ObjectBase.cpp
205

renderpriority looks too long to me :p

source/graphics/ObjectEntry.cpp
242

Could be done. Hiding them would allow us to change it at runtime easier I guess, thought that's unimplemented so far.

Stan added a comment.EditedMay 28 2019, 11:23 AM

Any way to easily make props mutually exclusive ? Like for instance having a prop only show up when in must, but not in eyecandy ? So that you could replace animated oars by a big static mesh for instance ?

Also, can it be extended to the visual actor ? Like

<VisualActor>
  <Actor renderprio="high">structures/hellenes/farmstead.xml</Actor>
  <Actor renderprio="low">structures/hellenes/farmstead.xml</Actor>
  <Actor renderprio="medium">structures/hellenes/farmstead.xml</Actor>
  <FoundationActor>structures/fndn_5x4.xml</FoundationActor>
</VisualActor>

or "should", "must", "eyecandy" ^^

EDIT: Would kinda be the LOD system ^^"
Make it a bit smarter by switching actors depending on the camera and you get it.

source/graphics/ObjectEntry.cpp
242

When is this code called ?

historic_bruno added inline comments.
source/graphics/ObjectBase.cpp
205

I agree with Stan, "prio" is a weird abbreviation. Four more letters saves confusion here.

luiko added a subscriber: luiko.Dec 20 2019, 9:15 AM
wraitii abandoned this revision.May 30 2020, 2:32 PM

Seems better to do a distance-based filtering than this odd hardcoding tbh. I find Angen's approach in D2440