LogoLogo
API Status
  • 👋Welcome
  • 🌐What is Morpheus Platform?
    • Interoperability
  • â„šī¸Help
    • 📗Glossary
    • 🆘Support
    • Firewall problems
    • EULA
  • CREATION
    • 🎮Unreal Development
      • ⚡Get Started
        • âš’ī¸Download the Editor
        • âĢUpload Content
        • 🌎Creating your own map
        • 📝Morpheus Base Project
        • ❓Differences from Unreal
          • 🧍Character Configuration
        • 📡Morpheus Networking
          • Introduction to Morpheus Networking
          • Network Levels
          • Replicated Properties
          • RPCs
          • Morpheus Render Targets
          • Morpheus Array
          • Networking FAQ
          • Replicating Sublevels
      • 📚Features & Guides
        • 📒Example Plugin
          • Nameplates
          • In-game roles
          • Resizing
        • 🏊Actor Pooling
        • 🔊Audio
        • 🎭Avatars
          • Creating an Avatar
          • Attachments
            • MML Attachments
          • Custom Animation Variables
          • Importing an NFT collection
          • Capsules and Mesh Transforms
        • 🤖Bots
        • đŸŽ™ī¸Chat
          • Unreal Text Chat
        • đŸŽ›ī¸Control Panels
          • Control Panel Configuration
          • DJ booth mission control
          • Observer Controls
        • 🔉Crowd Audio
        • đŸ¤ŧCrowd Rendering
          • Legacy Animated Crowd
            • Animated Crowd Console Commands
            • Attaching static meshes to crowd members
          • Crowd Materials
          • Performance Parameters
          • Live Config Settings
          • Crowd Animation
            • Crowd Anim Blueprint
              • User Guide - Crowd Anim Blueprint
              • Reference Guide - ABP Nodes
                • Animation Playback
                • States and State Machines
                • Variables
                • Transitions
                • Special
                • Blends
                • Additional Notes
        • 🍱Helpers & Extras
          • "Instanced Objects" in Blueprints
          • Objects with "world context"
          • Making DataAsset classes
          • Duplicate Objects
          • The Bootflow Subsystem
          • The "Wait For Condition" System
          • Advanced Graphics settings
          • Listening to inputs on UObjects
          • Morpheus UserID
          • World Services
          • M2Extras: Skins System
        • đŸ–Ĩī¸Loading Screen
        • ⚡Live Config
          • Editing for a World
          • Editing Locally
          • Default Settings
          • Accessing via Blueprint
          • Adding New Settings
          • Overriding Defaults
          • Using Arrays
        • 🧊MML
        • đŸ•ēMotion Capture
        • 📡Networking
        • đŸ“ĸNotifications
        • Raycastable Crowd
        • 🌐Singletons
        • 📱Streaming & Multiplatform
          • GFN on mobile
        • đŸ–Ĩī¸UI
          • "UI Mode"
        • đŸ—ƒī¸User Collections
          • Creating a New Object Definition
          • Accessing from Unreal
            • Creating Objects Definitions
            • Transfer Objects
            • User Collection Views
            • Receiving Updates
        • đŸ“ēVideo Players
          • Embedded Video Player
          • Millicast video streaming
            • How to Setup an In-Game Video Stream
            • Picture-in-Picture mode
          • Streaming Video Player
            • How to Setup a URL Video Player
            • Picture-in-Picture mode
        • 🐞Visual Debugging
          • Inspector
        • đŸĒŸWeb UI
        • Online Services
          • KV Store Service
        • 💠Web Requests
          • Http Requests
            • Legacy HTTP Nodes
          • JSON Handling
          • WebSockets
          • Identity Validation
          • Allowed External URLs
          • Walkthrough Example
            • Example Counter Service
        • âœˆī¸World Travel
          • World Travel in the editor
        • Avatar Physics Assets
        • Action Gameplay Helper Components
      • 🔑Workflows
        • â†—ī¸Upgrade the Editor
          • đŸ–Ĩī¸Version History
        • âš™ī¸Editing Project Settings
        • 📈Profiling
        • đŸ§ēMarketplace Importing
        • đŸ› ī¸Extra Workflows
          • Setup Play-in-Editor
          • Setup Local Asset Validation
          • Adding Gameplay Tags
          • Validating Game Assets
          • Custom Connection Modes
          • Connect Editor to a World
          • Common Issues
      • 📚Useful Reading
        • ⭐Best Practices
    • 🌎Worlds
      • 📩Invite Players
        • Setting Role Groups
      • Persistent Worlds
      • Always on Worlds
    • 📅Running events
      • ✅Large scale events - Checklist
      • 👾Anti-Cheat (EAC)
      • 🎮Player Entry
        • 📱React Native
        • Steam
        • đŸ’ģHardware Reqs
      • đŸŽĨBroadcast
        • 📹OBS Integration
      • Failover
      • 🏁Capacity And Queue Management
  • ADMINS
    • đŸ‘ĒAccess Control
      • Adding metaverse contributors
      • Creating a new project
    • 💲Pricing
      • Development Support
      • Included Usage & Overages
      • Cloud Streaming
      • Access Modes
      • War Room Support
      • Platform SLA
    • âš™ī¸Settings
      • đŸ—ƒī¸Projects
  • APIs and Tooling
    • đŸ–Ĩī¸API Reference
      • Accounts
      • Events
      • Key/Value Store
      • Organizations
      • Realtime
      • User Profile
      • World Builder
      • Worlds
    • đŸ’ģTemplate Web App
      • đŸ’ĸModeration
    • Pixel Streaming
    • 🚀Launcher
  • Integrations
    • 📊Analytics
      • Sending events from web
      • 🎮Sending Events from Unreal
    • đŸ’ŦChat
      • 🎮Integrating Pubnub with your Unreal Project
      • Adding Moderation to Chat
Powered by GitBook
On this page
  • What is a Render Target?
  • Available Render Targets
  • Setting up Render Targets
  • Setting the Render Targets during runtime
  • Checking which Render Target is currently in use
  • Render Target State
  • Additional Render Target Events

Was this helpful?

  1. CREATION
  2. Unreal Development
  3. Get Started
  4. Morpheus Networking

Morpheus Render Targets

PreviousRPCsNextMorpheus Array

Last updated 4 months ago

Was this helpful?

What is a Render Target?

In Morpheus, every client sees every AMorpheusActor in the world, no matter how far away that AMorpheusActor is. If your game has 10000 players, each client will have 10000 player AMorpheusActors in their scene.

This means that, for high-scale types of AMorpheusActor, you cannot have very expensive components on that AMorpheusActor. For example, 10000 skeletal mesh components, or 10000 character movement components, would significantly slow down the client and server.

Morpheus has a feature called render targets which addresses this. A render target is a way of rendering an AMorpheusActor, which can change dynamically.

Available Render Targets

Currently, a render target can be either:

  • Nothing.

  • A non-AMorpheusActor actor of a given class.

  • A member of an animated crowd.

An AMorpheusActor can have only one render target active at any given point, and you can configure automatic handling of which render target to apply, when.

By default, an AMorpheusActor will never load any render targets.

Setting up Render Targets

In your AMorpheusActor derived Blueprint, you will find the MorpheusRenderTargetComponent

In the details panel of the component you can control its render targets:

Server Render Target

This is the render target always applied on the server. Although the server doesn't render anything, it can sometimes be convenient to have a server-side actor associated with an AMorpheusActor.

Authoritative Client Render Target

This is the render target which is always applied on the client which has authority over this AMorpheusActor.

Actors with authoritative render targets will not have their LOD switched and calculated.

LOD Group Id

In order for an actor to be rendered, it must be assigned to a FMorpheusLODGroup

By default, we have the PlayerClient LOD group ID but you can add as many as you want from the project settings when clicking Create LOD Group

If the LOD group ID is not assigned we fallback to the DefaultLODGroup in the following setting.

Default LOD Group

Each LOD Group has a list of FMorpheusLODGroupLevel and FMorpheusLODGroupBucket.

  • A LOD Group Level defines the NumEntities that can be rendered in that level.

  • A LOD Group Bucket is used to prioritize some actors over others within the same LOD Group. It defines a MaxDistance within which the actors belonging to that bucket will be prioritized.

Each non-authoritative client will render the closest NumEntities entities (within the same FMorpheusLODGroup) starting from LOD 0.

For example, an actor with the following three LOD levels:

  • 0: Actor render target with actor class ACharacter.

  • 1: Animated crowd render target with high quality vertex animated meshes.

  • 2: None

and belonging to the LOD Group CharacterLODGroup defined with:

  • LOD Level 0: (NumEntities=30)

  • LOD Level 1: (NumEntities=500)

Will render the closest 30 entities as the ACharacter class, the next 500 closest entities as Animated Crowd memers, the remaining actors as imposters, and have no render targets.

The render targets will be automatically swapped when the AMorpheusActors move closer or further away.

LOD Group Buckets

A LOD Group can define buckets, and actors can register to the buckets to be prioritized. This can be done from the MorpheusRenderTargetComponent

For example, using the previously described LOD Group CharacterLODGroup , let's say it also defines these buckets:

  • Bucket 0: (Name=HighPriority, MaxDistance=10000)

  • Bucket 1: (Name=LowPriority, MaxDistance=5000)

Notice that buckets at lower indices will always have higher priority than buckets at higher indices.

UMorpheusRenderTargetManager will prioritize the actors belonging to bucket HighPriority (if their distance from the camera is below 10000) over the actors in the LowPriority group:

  • Actor 0: Belonging to HighPriority bucket and with Distance=7000

  • Actor 1: Belonging to LowPriority bucket and with Distance=1000

  • Actor 2: Doesn't have a bucket assigned (i.e None ) and with Distance=400

In the above situation, the actors will occupy the available slots (NumEntities) in the CharacterLodGroup in the same order they were listed respecting the bucketing order. So actors belonging to the HighPriority bucket will get assigned first followed by LowPriority bucket then the unassigned bucket actors.

Setting the Render Targets during runtime

If you want to update your Render Target setup during runtime, there some blueprint functions that can be used to achieve this:

These options should be used sparingly as they may cause multiple render target reloads depending on the new NumEntities capacity - for example, when calling SetClientLODLevels it will attempt to reload the render target to a sensible default option based on the previous LOD level index.

Checking which Render Target is currently in use

In order to identify which render target is currently in use you can use the following nodes in Blueprints:

If an AMorpheusActor currently has an actor render target enabled, MorpheusActorRenderTargetComponent->CurrentActor is set to the actor. MorpheusActorRenderTargetComponent->CurrentActor is nullptr otherwise.

If an AMorpheusActor currently has an animated crowd render target enabled, MorpheusActorRenderTargetComponent->CurrentAnimatedCrowd is set to the animated crowd actor. MorpheusActorRenderTargetComponent->CurrentAnimatedCrowd is nullptr otherwise.

MorpheusActorRenderTargetComponent->GetClientLODIndex() can be used to determine which client LOD level index is currently active, if any.

Render Target State

The MorpheusActorRenderTargetComponent has a generic state that is stored locally (NOT replicated). This state will be known as the Render Target State and can be used to maintain the rendering state of the MorpheusActor

The Render Target State is of a type called FMorpheusPackedStruct which is a special type that can store any type of a struct.

Before using the Render Target State you will need to create or specify the struct that will represent your rendering state.

Here is a BP example that shows it in action:

You can also respond to updates that occur to your Render Target State via the delegate OnRenderTargetStateUpdated which will fire as a result of any of these triggers:

  • An update to the Render Target State

    • i.e. a call to SetPackedRenderTargetState .

  • A render target transition

    • e.g. Actor to Animated Crowd or vise versa.

  • A render target is first loaded

    • e.g. as a result of a newly spawned MorpheusActor.

Here is an example of how to use this event in Blueprints:

It's recommended to use the delegate OnRenderTargetStateUpdated delegate for updating your render target compared to the Additional Render Target Events below as it's more inclusive.

Additional Render Target Events

The MorpheusActor provides some events to listen for when its render target is updated.

  • OnRenderTargetUpdated : This is triggered when the render target is updated (e.g. switching from Actor to AnimatedCrowd)

  • OnRenderTargetSpawnedEvent : Triggered when the Render Target has been switched to an Actor that has just finished spawning.

🎮
⚡
📡
MorpheusRenderTargetComponent in a MorpheusActor Blueprint
Details panel of a MorpheusRenderTargetComponent