Material Clustering Benchmark
ScanlineJitter.cs
Go to the documentation of this file.
1using UnityEngine;
3
5{
7 {
9 int kernelSize,
10 UnityEngine.Video.VideoClip[] videos,
11 ComputeShader csHighlightRemoval
13
15 {
16 var workList = new BenchmarkDescription(
17 ClusteringTest.LogType.Variance,
18 "Scanline jitter (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 for (
29 int jitterSize = 1;
30 jitterSize * textureSize <= 512 && jitterSize <= 32;
31 jitterSize *= 2
32 )
33 {
34 workList.dispatches.Push(
36 staggeredJitter: false,
37 video: video,
38 doDownscale: false,
39 dispatcher: new DispatcherKHMp(
40 computeShader: this.csHighlightRemoval,
41 numIterations: 3,
42 doRandomizeEmptyClusters: false,
43 useFullResTexRef: true,
44 parameters: DispatcherKHMp.Parameters.Default(),
45 clusteringRTsAndBuffers: new ClusteringRTsAndBuffers(
46 numClusters: 32,
47 workingSize: textureSize,
49 jitterSize: jitterSize
50 )
51 )
52 )
53 );
54 }
55 }
56 }
57
58 return workList;
59 }
60 }
61}
readonly UnityEngine.Video.VideoClip[] videos
override BenchmarkDescription GenerateBenchmark()
ScanlineJitter(int kernelSize, UnityEngine.Video.VideoClip[] videos, ComputeShader csHighlightRemoval)
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