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
DaggerfallBillboardBatch
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
|
Improve this Doc
View Source
FramesPerSecond
Declaration
[Range(0F, 30F)]
public float FramesPerSecond
Field Value
|
Improve this Doc
View Source
RandomDepth
Declaration
[Range(1F, 127F)]
public int RandomDepth
Field Value
|
Improve this Doc
View Source
RandomSpacing
Declaration
public float RandomSpacing
Field Value
|
Improve this Doc
View Source
RandomStartFrame
Declaration
public bool RandomStartFrame
Field Value
|
Improve this Doc
View Source
RandomWidth
Declaration
[Range(1F, 127F)]
public int RandomWidth
Field Value
|
Improve this Doc
View Source
ShadowCasting
Declaration
public ShadowCastingMode ShadowCasting
Field Value
|
Improve this Doc
View Source
TextureArchive
Declaration
[Range(0F, 511F)]
public int TextureArchive
Field Value
Properties
|
Improve this Doc
View Source
IsCustom
Declaration
public bool IsCustom { get; }
Property Value
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
|
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
|
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
|
Improve this Doc
View Source
Clear()
Clear all billboards from batch.
Declaration
|
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
Extension Methods
MBExtensions.Invoke<T1, T2, T3, T4>(MonoBehaviour, Action<T1, T2, T3, T4>, T1, T2, T3, T4, Single)