Material Clustering Benchmark
StaggeredJitter.cs
Go to the documentation of this file.
1using UnityEngine;
3using System.Collections.Generic;
4
6{
8 {
10 int kernelSize,
11 UnityEngine.Video.VideoClip[] videos,
12 ComputeShader csHighlightRemoval
14
16 {
17 var workList = new BenchmarkDescription(
18 ClusteringTest.LogType.Variance,
19 "Staggered jitter (KHM)"
20 );
21
22 foreach (UnityEngine.Video.VideoClip video in this.videos)
23 {
24 /*
25 ! lowest textureSize must be no less, than kernel size
26 */
27 for (int textureSize = 512; textureSize >= 8; textureSize /= 2)
28 {
29 for (
30 int jitterSize = 1;
31 jitterSize * textureSize <= 512 && jitterSize <= 32;
32 jitterSize *= 2
33 )
34 {
35 workList.dispatches.Push(
37 staggeredJitter: false,
38 video: video,
39 doDownscale: false,
40 dispatcher: new DispatcherKHMp(
41 computeShader: this.csHighlightRemoval,
42 numIterations: 3,
43 doRandomizeEmptyClusters: false,
44 useFullResTexRef: true,
45 parameters: DispatcherKHMp.Parameters.Default(),
46 clusteringRTsAndBuffers: new ClusteringRTsAndBuffers(
47 numClusters: 32,
48 workingSize: textureSize,
50 jitterSize: jitterSize
51 )
52 )
53 )
54 );
55 }
56 }
57 }
58
59 return workList;
60 }
61 }
62}
readonly UnityEngine.Video.VideoClip[] videos
StaggeredJitter(int kernelSize, UnityEngine.Video.VideoClip[] videos, ComputeShader csHighlightRemoval)
override BenchmarkDescription GenerateBenchmark()
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