Material Clustering Benchmark
ClusteringAlgorithms.ClusteringRTsAndBuffers Class Reference

Call Allocate before using and Dispose after using. More...

Inheritance diagram for ClusteringAlgorithms.ClusteringRTsAndBuffers:

Public Member Functions

void Allocate ()
 
 ClusteringRTsAndBuffers (int numClusters, int workingSize, int fullSize, int jitterSize)
 Textures are not allocated in the constructor. Call Allocate manually before using. More...
 
void Dispose ()
 
void Downsample (ComputeShader csHighlightRemoval, bool staggeredJitter, bool doDownscale)
 Update textureWorkRes by downsampling textureFullRes More...
 
ClusterCenters GetClusterCenters ()
 Get a pooled instance of ClusterCenters with a copy of the data from ComputeBuffer. Safe to modify. More...
 
int PickRandomCluster (int numClusters)
 
void RandomizeClusterCenters ()
 
void SetClusterCenters (Vector4[] clusterCentersBufferData)
 Reads the cluster centers data from the array and loads it into the ComputeBuffer. More...
 
void SetDeterministicClusterCenters ()
 
void UpdateRandomPositions ()
 

Public Attributes

readonly int fullSize
 
readonly int jitterSize
 
readonly int numClusters
 
RenderTexture rtResult
 
readonly int workingSize
 

Static Public Attributes

const int max_num_clusters = 32
 
const bool randomInit = true
 

Properties

ComputeBuffer cbufClusterCenters [get]
 
ComputeBuffer cbufRandomPositions [get]
 
bool isAllocated [get]
 
ClusteringTextures texturesFullRes [get]
 
ClusteringTextures texturesWorkRes [get]
 

Detailed Description

Call Allocate before using and Dispose after using.

Definition at line 10 of file ClusteringRTsAndBuffers.cs.

Constructor & Destructor Documentation

◆ ClusteringRTsAndBuffers()

ClusteringAlgorithms.ClusteringRTsAndBuffers.ClusteringRTsAndBuffers ( int  numClusters,
int  workingSize,
int  fullSize,
int  jitterSize 
)
inline

Textures are not allocated in the constructor. Call Allocate manually before using.

Definition at line 91 of file ClusteringRTsAndBuffers.cs.

Member Function Documentation

◆ Allocate()

void ClusteringAlgorithms.ClusteringRTsAndBuffers.Allocate ( )
inline

Definition at line 104 of file ClusteringRTsAndBuffers.cs.

◆ Dispose()

void ClusteringAlgorithms.ClusteringRTsAndBuffers.Dispose ( )
inline

Definition at line 287 of file ClusteringRTsAndBuffers.cs.

◆ Downsample()

void ClusteringAlgorithms.ClusteringRTsAndBuffers.Downsample ( ComputeShader  csHighlightRemoval,
bool  staggeredJitter,
bool  doDownscale 
)
inline

Update textureWorkRes by downsampling textureFullRes

Definition at line 232 of file ClusteringRTsAndBuffers.cs.

◆ GetClusterCenters()

ClusterCenters ClusteringAlgorithms.ClusteringRTsAndBuffers.GetClusterCenters ( )
inline

Get a pooled instance of ClusterCenters with a copy of the data from ComputeBuffer. Safe to modify.

Don't forget to dispose.

Returns

Definition at line 31 of file ClusteringRTsAndBuffers.cs.

◆ PickRandomCluster()

int ClusteringAlgorithms.ClusteringRTsAndBuffers.PickRandomCluster ( int  numClusters)
inline

Definition at line 68 of file ClusteringRTsAndBuffers.cs.

◆ RandomizeClusterCenters()

void ClusteringAlgorithms.ClusteringRTsAndBuffers.RandomizeClusterCenters ( )
inline

Definition at line 199 of file ClusteringRTsAndBuffers.cs.

◆ SetClusterCenters()

void ClusteringAlgorithms.ClusteringRTsAndBuffers.SetClusterCenters ( Vector4[]  clusterCentersBufferData)
inline

Reads the cluster centers data from the array and loads it into the ComputeBuffer.

Parameters
clusterCentersBufferData

Definition at line 41 of file ClusteringRTsAndBuffers.cs.

◆ SetDeterministicClusterCenters()

void ClusteringAlgorithms.ClusteringRTsAndBuffers.SetDeterministicClusterCenters ( )
inline

Definition at line 168 of file ClusteringRTsAndBuffers.cs.

◆ UpdateRandomPositions()

void ClusteringAlgorithms.ClusteringRTsAndBuffers.UpdateRandomPositions ( )
inline

Definition at line 73 of file ClusteringRTsAndBuffers.cs.

Member Data Documentation

◆ fullSize

readonly int ClusteringAlgorithms.ClusteringRTsAndBuffers.fullSize

Definition at line 86 of file ClusteringRTsAndBuffers.cs.

◆ jitterSize

readonly int ClusteringAlgorithms.ClusteringRTsAndBuffers.jitterSize

Definition at line 21 of file ClusteringRTsAndBuffers.cs.

◆ max_num_clusters

const int ClusteringAlgorithms.ClusteringRTsAndBuffers.max_num_clusters = 32
static

Definition at line 12 of file ClusteringRTsAndBuffers.cs.

◆ numClusters

readonly int ClusteringAlgorithms.ClusteringRTsAndBuffers.numClusters

Definition at line 20 of file ClusteringRTsAndBuffers.cs.

◆ randomInit

const bool ClusteringAlgorithms.ClusteringRTsAndBuffers.randomInit = true
static

Definition at line 13 of file ClusteringRTsAndBuffers.cs.

◆ rtResult

RenderTexture ClusteringAlgorithms.ClusteringRTsAndBuffers.rtResult

Definition at line 15 of file ClusteringRTsAndBuffers.cs.

◆ workingSize

readonly int ClusteringAlgorithms.ClusteringRTsAndBuffers.workingSize

Definition at line 85 of file ClusteringRTsAndBuffers.cs.

Property Documentation

◆ cbufClusterCenters

ComputeBuffer ClusteringAlgorithms.ClusteringRTsAndBuffers.cbufClusterCenters
get

Definition at line 18 of file ClusteringRTsAndBuffers.cs.

◆ cbufRandomPositions

ComputeBuffer ClusteringAlgorithms.ClusteringRTsAndBuffers.cbufRandomPositions
get

Definition at line 19 of file ClusteringRTsAndBuffers.cs.

◆ isAllocated

bool ClusteringAlgorithms.ClusteringRTsAndBuffers.isAllocated
get

Definition at line 154 of file ClusteringRTsAndBuffers.cs.

◆ texturesFullRes

ClusteringTextures ClusteringAlgorithms.ClusteringRTsAndBuffers.texturesFullRes
get

Definition at line 17 of file ClusteringRTsAndBuffers.cs.

◆ texturesWorkRes

ClusteringTextures ClusteringAlgorithms.ClusteringRTsAndBuffers.texturesWorkRes
get

Definition at line 16 of file ClusteringRTsAndBuffers.cs.


The documentation for this class was generated from the following file: