Show / Hide Table of Contents

Class DaggerfallBillboardBatch

Draws a large number of atlased billboards using a single mesh and custom geometry shader. Supports animated billboards with a random start frame, but only one animation timer per batch. Currently used for exterior billboards only (origin = centre-bottom). Support for interior/dungeon billboards will be added later (origin = centre). Tries to not recreate Mesh and Material where possible. Generates some garbage when rebuilding mesh layout. This can probably be improved.

Inheritance
Object
Object
Component
Behaviour
MonoBehaviour
DaggerfallBillboardBatch
Namespace: DaggerfallWorkshop
Assembly: Assembly-CSharp.dll
Syntax
[RequireComponent(typeof(MeshFilter))]
[RequireComponent(typeof(MeshRenderer))]
public class DaggerfallBillboardBatch : MonoBehaviour

Fields

| Improve this Doc View Source

BlockOrigin

Declaration
[NonSerialized]
[HideInInspector]
public Vector3 BlockOrigin
Field Value
Type Description
Vector3
| Improve this Doc View Source

FramesPerSecond

Declaration
[Range(0F, 30F)]
public float FramesPerSecond
Field Value
Type Description
Single
| Improve this Doc View Source

RandomDepth

Declaration
[Range(1F, 127F)]
public int RandomDepth
Field Value
Type Description
Int32
| Improve this Doc View Source

RandomSpacing

Declaration
public float RandomSpacing
Field Value
Type Description
Single
| Improve this Doc View Source

RandomStartFrame

Declaration
public bool RandomStartFrame
Field Value
Type Description
Boolean
| Improve this Doc View Source

RandomWidth

Declaration
[Range(1F, 127F)]
public int RandomWidth
Field Value
Type Description
Int32
| Improve this Doc View Source

ShadowCasting

Declaration
public ShadowCastingMode ShadowCasting
Field Value
Type Description
ShadowCastingMode
| Improve this Doc View Source

TextureArchive

Declaration
[Range(0F, 511F)]
public int TextureArchive
Field Value
Type Description
Int32

Properties

| Improve this Doc View Source

IsCustom

Declaration
public bool IsCustom { get; }
Property Value
Type Description
Boolean

Methods

| Improve this Doc View Source

__EditorClearBillboards()

Declaration
public void __EditorClearBillboards()
| Improve this Doc View Source

__EditorRandomLayout()

Declaration
public void __EditorRandomLayout()
| Improve this Doc View Source

AddItem(Int32, Vector3)

Add a billboard to batch.

Declaration
public void AddItem(int record, Vector3 localPosition)
Parameters
Type Name Description
Int32 record
Vector3 localPosition
| Improve this Doc View Source

AddItem(Rect, Vector2, Vector2, Vector3)

Add a billboard to batch. Use this overload for custom atlas material.

Declaration
public void AddItem(Rect rect, Vector2 size, Vector2 scale, Vector3 localPosition)
Parameters
Type Name Description
Rect rect
Vector2 size
Vector2 scale
Vector3 localPosition
| Improve this Doc View Source

Apply()

Apply items to batch. Must be called once all items added. You can add more items later, but will need to apply again.

Declaration
public void Apply()
| Improve this Doc View Source

Clear()

Clear all billboards from batch.

Declaration
public void Clear()
| Improve this Doc View Source

SetMaterial(Int32, Boolean)

Set material all billboards in this batch will share. This material is always atlased.

Declaration
public void SetMaterial(int archive, bool force = false)
Parameters
Type Name Description
Int32 archive

Archive index.

Boolean force

Force new archive, even if already set.

| Improve this Doc View Source

SetMaterial(Material)

Directly set custom atlas material all billboards in batch will share. Custom material allows you to directly set item rects in batch.

Declaration
public void SetMaterial(Material material)
Parameters
Type Name Description
Material material

Extension Methods

MBExtensions.Invoke(MonoBehaviour, Action, Single)
MBExtensions.Invoke<T>(MonoBehaviour, Action<T>, T, Single)
MBExtensions.Invoke<T1, T2>(MonoBehaviour, Action<T1, T2>, T1, T2, Single)
MBExtensions.Invoke<T1, T2, T3>(MonoBehaviour, Action<T1, T2, T3>, T1, T2, T3, Single)
MBExtensions.Invoke<T1, T2, T3, T4>(MonoBehaviour, Action<T1, T2, T3, T4>, T1, T2, T3, T4, Single)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX