Difference between revisions of "GPU Instancer Pro:APIDocumentation"

From GurBu Wiki
Jump to: navigation, search
(Created page with "About GPU Instance Pro | Getting Started | Terminology | GPU_Instancer_Pro:BestP...")
 
Line 1: Line 1:
 
[[GPU_Instancer_Pro|About GPU Instance Pro]] | [[GPU_Instancer_Pro:GettingStarted|Getting Started]] | [[GPU_Instancer_Pro:Terminology|Terminology]] | [[GPU_Instancer_Pro:BestPractices|Best Practices]] | [[GPU_Instancer_Pro:APIDocumentation|API Documentation]] | [[GPU_Instancer_Pro:FAQ|F.A.Q.]]
 
[[GPU_Instancer_Pro|About GPU Instance Pro]] | [[GPU_Instancer_Pro:GettingStarted|Getting Started]] | [[GPU_Instancer_Pro:Terminology|Terminology]] | [[GPU_Instancer_Pro:BestPractices|Best Practices]] | [[GPU_Instancer_Pro:APIDocumentation|API Documentation]] | [[GPU_Instancer_Pro:FAQ|F.A.Q.]]
 +
 +
 +
 +
 +
== Camera Events ==
 +
<br>
 +
==== RegisterRenderer ====
 +
----
 +
<br>
 +
<code>public static bool '''RegisterRenderer'''(UnityEngine.Object '''source''', GameObject '''prefab''', out int '''rendererKey''')</code>
 +
<br><br>
 +
{| class="wikitable"
 +
|-
 +
!colspan="2" | Parameters
 +
|-
 +
| <code>'''source'''</code> || The source responsible for registering the renderer. E.g. the MonoBehaviour class
 +
|-
 +
| <code>'''prefab'''</code> || GameObject that the renderers will be based on
 +
|-
 +
| <code>'''rendererKey'''</code> || Integer key that uniquely identifies the renderer
 +
|}
 +
<br>
 +
'''Description:'''
 +
<br><br>
 +
The RegisterRenderer method is used to set up GPUI renderers for the specified GameObject. This method needs to be called to produce a renderKey, which can then be used with the SetMatrices method to start rendering instances with the given transform matrices. To stop the rendering, the DisposeRenderer method should be called with the rendererKey output.<br><br><br><br>
 +
 +
==== RegisterRenderer ====
 +
----
 +
<br>
 +
<code>public static bool '''RegisterRenderer'''(UnityEngine.Object '''source''', GameObject '''prefab''', GPUIProfile '''profile''', out int '''rendererKey''')</code>
 +
<br><br>
 +
{| class="wikitable"
 +
|-
 +
!colspan="2" | Parameters
 +
|-
 +
| <code>'''source'''</code> || The source responsible for registering the renderer. E.g. the MonoBehaviour class
 +
|-
 +
| <code>'''prefab'''</code> || GameObject that the renderers will be based on
 +
|-
 +
| <code>'''profile'''</code> || GPUIProfile that determines various rendering settings
 +
|-
 +
| <code>'''rendererKey'''</code> || Integer key that uniquely identifies the renderer
 +
|}
 +
<br>
 +
'''Description:'''
 +
<br><br>
 +
The RegisterRenderer method is used to set up GPUI renderers for the specified GameObject. This method needs to be called to produce a renderKey, which can then be used with the SetMatrices method to start rendering instances with the given transform matrices. To stop the rendering, the DisposeRenderer method should be called with the rendererKey output.<br><br><br><br>
 +
 +
==== DisposeRenderer ====
 +
----
 +
<br>
 +
<code>public static void '''DisposeRenderer'''(int '''rendererKey''')</code>
 +
<br><br>
 +
{| class="wikitable"
 +
|-
 +
!colspan="2" | Parameters
 +
|-
 +
| <code>'''rendererKey'''</code> || Integer key that uniquely identifies the renderer
 +
|}
 +
<br>
 +
'''Description:'''
 +
<br><br>
 +
Disposes the renderer data previously defined with the RegisterRenderer method.<br><br><br><br>
 +
 +
==== SetMatrices ====
 +
----
 +
<br>
 +
<code>public static bool '''SetMatrices'''(int '''rendererKey''', Matrix4x4[] matrices)</code>
 +
<br><br>
 +
{| class="wikitable"
 +
|-
 +
!colspan="2" | Parameters
 +
|-
 +
| <code>'''rendererKey'''</code> || Integer key that uniquely identifies the renderer
 +
|}
 +
<br>
 +
'''Description:'''
 +
<br><br>
 +
Sets the transform matrix data to a renderer previously defined with the RegisterRenderer method.<br><br><br><br>
 +
 +
==== SetMatrices ====
 +
----
 +
<br>
 +
<code>public static bool '''SetMatrices'''(int '''rendererKey''', List<Matrix4x4> matrices)</code>
 +
<br><br>
 +
{| class="wikitable"
 +
|-
 +
!colspan="2" | Parameters
 +
|-
 +
| <code>'''rendererKey'''</code> || Integer key that uniquely identifies the renderer
 +
|}
 +
<br>
 +
'''Description:'''
 +
<br><br>
 +
Sets the transform matrix data to a renderer previously defined with the RegisterRenderer method.<br><br><br><br>
 +
 +
==== SetMatrices ====
 +
----
 +
<br>
 +
<code>public static bool '''SetMatrices'''(int '''rendererKey''', NativeArray<Matrix4x4> matrices)</code>
 +
<br><br>
 +
{| class="wikitable"
 +
|-
 +
!colspan="2" | Parameters
 +
|-
 +
| <code>'''rendererKey'''</code> || Integer key that uniquely identifies the renderer
 +
|}
 +
<br>
 +
'''Description:'''
 +
<br><br>
 +
Sets the transform matrix data to a renderer previously defined with the RegisterRenderer method.<br><br><br><br>
 +
 +
==== SetBufferSize ====
 +
----
 +
<br>
 +
<code>public static bool '''SetBufferSize'''(int '''rendererKey''', int bufferSize)</code>
 +
<br><br>
 +
{| class="wikitable"
 +
|-
 +
!colspan="2" | Parameters
 +
|-
 +
| <code>'''rendererKey'''</code> || Integer key that uniquely identifies the renderer
 +
|}
 +
<br>
 +
'''Description:'''
 +
<br><br>
 +
Sets the transform matrix data to a renderer previously defined with the RegisterRenderer method.<br><br><br><br>
 +
 +
==== AddCameraEventOnPreCull ====
 +
----
 +
<br>
 +
<code>public static void '''AddCameraEventOnPreCull'''(UnityAction<GPUICameraData> cameraEvent)</code>
 +
<br><br>
 +
{| class="wikitable"
 +
|-
 +
!colspan="2" | Parameters
 +
|}
 +
<br>
 +
'''Description:'''
 +
<br><br>
 +
Adds a method to execute before each camera's visibility calculations.<br><br><br><br>
 +
 +
==== RemoveCameraEventOnPreCull ====
 +
----
 +
<br>
 +
<code>public static void '''RemoveCameraEventOnPreCull'''(UnityAction<GPUICameraData> cameraEvent)</code>
 +
<br><br>
 +
{| class="wikitable"
 +
|-
 +
!colspan="2" | Parameters
 +
|}
 +
<br>
 +
'''Description:'''
 +
<br><br>
 +
Removes the method previously added with the AddCameraEventOnPreCull method.<br><br><br><br>
 +
 +
==== AddCameraEventOnPreRender ====
 +
----
 +
<br>
 +
<code>public static void '''AddCameraEventOnPreRender'''(UnityAction<GPUICameraData> cameraEvent)</code>
 +
<br><br>
 +
{| class="wikitable"
 +
|-
 +
!colspan="2" | Parameters
 +
|}
 +
<br>
 +
'''Description:'''
 +
<br><br>
 +
Adds a method to execute after each camera's visibility calculations and before draw calls.<br><br><br><br>
 +
 +
==== RemoveCameraEventOnPreRender ====
 +
----
 +
<br>
 +
<code>public static void '''RemoveCameraEventOnPreRender'''(UnityAction<GPUICameraData> cameraEvent)</code>
 +
<br><br>
 +
{| class="wikitable"
 +
|-
 +
!colspan="2" | Parameters
 +
|}
 +
<br>
 +
'''Description:'''
 +
<br><br>
 +
Removes the method previously added with the AddCameraEventOnPreRender method.<br><br><br><br>
 +
 +
==== AddCameraEventOnPostRender ====
 +
----
 +
<br>
 +
<code>public static void '''AddCameraEventOnPostRender'''(UnityAction<GPUICameraData> cameraEvent)</code>
 +
<br><br>
 +
{| class="wikitable"
 +
|-
 +
!colspan="2" | Parameters
 +
|}
 +
<br>
 +
'''Description:'''
 +
<br><br>
 +
Adds a method to execute after each camera's draw calls.<br><br><br><br>
 +
 +
==== RemoveCameraEventOnPostRender ====
 +
----
 +
<br>
 +
<code>public static void '''RemoveCameraEventOnPostRender'''(UnityAction<GPUICameraData> cameraEvent)</code>
 +
<br><br>
 +
{| class="wikitable"
 +
|-
 +
!colspan="2" | Parameters
 +
|}
 +
<br>
 +
'''Description:'''
 +
<br><br>
 +
Removes the method previously added with the AddCameraEventOnPostRender method.<br><br><br><br>

Revision as of 12:59, 11 April 2024

About GPU Instance Pro | Getting Started | Terminology | Best Practices | API Documentation | F.A.Q.



Camera Events


RegisterRenderer



public static bool RegisterRenderer(UnityEngine.Object source, GameObject prefab, out int rendererKey)

Parameters
source The source responsible for registering the renderer. E.g. the MonoBehaviour class
prefab GameObject that the renderers will be based on
rendererKey Integer key that uniquely identifies the renderer


Description:

The RegisterRenderer method is used to set up GPUI renderers for the specified GameObject. This method needs to be called to produce a renderKey, which can then be used with the SetMatrices method to start rendering instances with the given transform matrices. To stop the rendering, the DisposeRenderer method should be called with the rendererKey output.



RegisterRenderer



public static bool RegisterRenderer(UnityEngine.Object source, GameObject prefab, GPUIProfile profile, out int rendererKey)

Parameters
source The source responsible for registering the renderer. E.g. the MonoBehaviour class
prefab GameObject that the renderers will be based on
profile GPUIProfile that determines various rendering settings
rendererKey Integer key that uniquely identifies the renderer


Description:

The RegisterRenderer method is used to set up GPUI renderers for the specified GameObject. This method needs to be called to produce a renderKey, which can then be used with the SetMatrices method to start rendering instances with the given transform matrices. To stop the rendering, the DisposeRenderer method should be called with the rendererKey output.



DisposeRenderer



public static void DisposeRenderer(int rendererKey)

Parameters
rendererKey Integer key that uniquely identifies the renderer


Description:

Disposes the renderer data previously defined with the RegisterRenderer method.



SetMatrices



public static bool SetMatrices(int rendererKey, Matrix4x4[] matrices)

Parameters
rendererKey Integer key that uniquely identifies the renderer


Description:

Sets the transform matrix data to a renderer previously defined with the RegisterRenderer method.



SetMatrices



public static bool SetMatrices(int rendererKey, List<Matrix4x4> matrices)

Parameters
rendererKey Integer key that uniquely identifies the renderer


Description:

Sets the transform matrix data to a renderer previously defined with the RegisterRenderer method.



SetMatrices



public static bool SetMatrices(int rendererKey, NativeArray<Matrix4x4> matrices)

Parameters
rendererKey Integer key that uniquely identifies the renderer


Description:

Sets the transform matrix data to a renderer previously defined with the RegisterRenderer method.



SetBufferSize



public static bool SetBufferSize(int rendererKey, int bufferSize)

Parameters
rendererKey Integer key that uniquely identifies the renderer


Description:

Sets the transform matrix data to a renderer previously defined with the RegisterRenderer method.



AddCameraEventOnPreCull



public static void AddCameraEventOnPreCull(UnityAction<GPUICameraData> cameraEvent)

Parameters


Description:

Adds a method to execute before each camera's visibility calculations.



RemoveCameraEventOnPreCull



public static void RemoveCameraEventOnPreCull(UnityAction<GPUICameraData> cameraEvent)

Parameters


Description:

Removes the method previously added with the AddCameraEventOnPreCull method.



AddCameraEventOnPreRender



public static void AddCameraEventOnPreRender(UnityAction<GPUICameraData> cameraEvent)

Parameters


Description:

Adds a method to execute after each camera's visibility calculations and before draw calls.



RemoveCameraEventOnPreRender



public static void RemoveCameraEventOnPreRender(UnityAction<GPUICameraData> cameraEvent)

Parameters


Description:

Removes the method previously added with the AddCameraEventOnPreRender method.



AddCameraEventOnPostRender



public static void AddCameraEventOnPostRender(UnityAction<GPUICameraData> cameraEvent)

Parameters


Description:

Adds a method to execute after each camera's draw calls.



RemoveCameraEventOnPostRender



public static void RemoveCameraEventOnPostRender(UnityAction<GPUICameraData> cameraEvent)

Parameters


Description:

Removes the method previously added with the AddCameraEventOnPostRender method.