Material Clustering Benchmark
Subsampling.cs
Go to the documentation of this file.
1using UnityEngine;
3
5{
7 {
8 public Subsampling(
9 int kernelSize,
10 UnityEngine.Video.VideoClip[] videos,
11 ComputeShader csHighlightRemoval
13
15 {
16 var workList = new BenchmarkDescription(
17 ClusteringTest.LogType.Variance,
18 "Subsampling (KHM)"
19 );
20
21 foreach (UnityEngine.Video.VideoClip video in this.videos)
22 {
23 /*
24 ! lowest textureSize must be no less, than kernel size
25 */
26 for (int textureSize = 512; textureSize >= 8; textureSize /= 2)
27 {
28 foreach (int numClusters in new int[] { 3, 4, 6, 9, 12, 15, 19, 24, 32 })
29 {
30 workList.dispatches.Push(
32 staggeredJitter: false,
33 video: video,
34 doDownscale: false,
35 dispatcher: new DispatcherKHMp(
36 computeShader: this.csHighlightRemoval,
37 numIterations: 3,
38 doRandomizeEmptyClusters: false,
39 useFullResTexRef: true,
40 parameters: DispatcherKHMp.Parameters.Default(),
41 clusteringRTsAndBuffers: new ClusteringRTsAndBuffers(
42 numClusters: numClusters,
43 workingSize: textureSize,
45 jitterSize: 1
46 )
47 )
48 )
49 );
50 }
51 }
52 }
53
54 return workList;
55 }
56 }
57}
readonly UnityEngine.Video.VideoClip[] videos
Subsampling(int kernelSize, UnityEngine.Video.VideoClip[] videos, ComputeShader csHighlightRemoval)
Definition: Subsampling.cs:8
override BenchmarkDescription GenerateBenchmark()
Definition: Subsampling.cs:14
Call Allocate before using and Dispose after using.
static Parameters Default()
Default value of Parameters.p is 2.5, which we experimentally confirmed to be optimal for our dataset...
const int fullTextureSize