blob: 6087702a2a2524c4d1d6004b5b4e01b3075fc566 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
[UdonBehaviourSyncMode(BehaviourSyncMode.None)]
public class LinearPipeline : UdonSharpBehaviour
{
[Header("Pipeline Assets")]
public string pipelineGeneratedPath = "Assets/yum_food/gpu_fft/Pipeline_Generated";
public Texture initialState;
public Material[] materials;
public RenderTexture[] renderTextures;
private bool isValid;
void Start()
{
ValidatePipeline();
}
private void ValidatePipeline()
{
isValid = materials != null &&
renderTextures != null &&
materials.Length > 0 &&
materials.Length == renderTextures.Length;
if (!isValid)
{
Debug.LogError($"[LinearPipeline] Invalid configuration on {gameObject.name}");
}
}
public void RunPipeline()
{
if (!isValid || initialState == null) return;
VRCGraphics.Blit(initialState, renderTextures[0], materials[0], -1);
for (int i = 1; i < materials.Length; i++)
{
VRCGraphics.Blit(renderTextures[i-1], renderTextures[i], materials[i], -1);
}
}
}
|