Git Product home page Git Product logo

foliageshadowimposters's Introduction

Foliage Shadow Imposters

This plugin now supports packaged games. There are two plugins: one for the editor and one for runtime.

A UE5 plugin to add Foliage Shadow Imposters to Nanite Foliage for increased performance when using World Position Offset (WPO) and Virtual Shadow Maps. We gain performance by disabling the expensive WPO shadow on the Nanite Foliage and replacing it with a cheap non-WPO shadow casting Foliage Shadow Imposter. The compromise here is that the foliage will animate in the wind, but the shadows cast on the ground will not change. This compromise leads to massive performance gains.

This plugin searches all InstancedFoliageActors for an OriginalFoliageMesh and adds a FoliageShadowImposterMesh with the same location, rotation, and scale. The OriginalFoliageMesh should have Nanite Foliage turned on and be set to not cast a shadow in the FoliageType in the Foliage editor. The OriginalFoliageMesh should have World Position Offset enabled. The FoliageShadowImposterMesh should be a low poly LOD for the purpose of casting a cheaper shadow. The FoliageShadowImposterMesh must have FoliageShadowImposterMesh disabled. The plugin will automatically enable the shadow for FoliageShadowImposterMesh, set HiddenInGame, and set cast shadow when hidden.

This plugin requires Unreal Engine 5.1 or higher.

Installation Instructions

  1. Copy the /src/Plugins/FoliageImposters folder to the /Plugins folder in your UE5 project.
  2. Recompile your project in Visual Studio to compile the plugin source code. It isn't precompiled.
  3. Open the UE5 editor and enable the FoliageShadowImposters plugin if it isn't already enabled.
  4. Create a DataTable with row type FoliageShadowImposterReplacementRow.
  5. Add at least one row to the DataTable. Specify an OriginalFoliageMesh to search for in the world. Then pick a FoliageShadowImposterMesh to add to it. Finally, check the ShouldReplace checkbox.
  6. Right click on the new DataTable and click on Copy Reference.
  7. Close the editor.
  8. Open your DefaultGame.ini file and find the [/Script/EngineSettings.GeneralProjectSettings] section.
  9. Add a new line under this section like this. Paste your refernce inside the double quotes. PathToFoliageShadowImposterReplacementDataTable=""
  10. Reopen the editor.
  11. Use the Foliage Editor to place the foliage in the world that you specified as OriginalFoliageMesh in step 5.
  12. Click on the two trees icon in the toolbar at the top-center of the editor window. This will add FoliageShadowImposterMesh for each OriginalFoliageMesh it finds. It will match the location, rotation, and scale of the original. Each time you run the plugin it will remove all of the FoliageShadowImposterMesh's before it adds them again. The plugin will only process rows in the DataTable where the ShouldReplace checkbox is checked.

foliageshadowimposters's People

Contributors

sabredartstudios avatar

Stargazers

Frank avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.