broken
This commit is contained in:
@@ -1,31 +1,28 @@
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
|
||||
namespace RebootKit.Engine.Graphics.Pixelize
|
||||
{
|
||||
public class PixelizePass : ScriptableRenderPass
|
||||
{
|
||||
private static int PixelBufferID = Shader.PropertyToID("_PixelBuffer");
|
||||
namespace RebootKit.Engine.Graphics.Pixelize {
|
||||
public class PixelizePass : ScriptableRenderPass {
|
||||
static readonly int PixelBufferID = Shader.PropertyToID("_PixelBuffer");
|
||||
|
||||
private PixelizeFeature.PassSettings _settings;
|
||||
RenderTargetIdentifier _colorBuffer;
|
||||
int _frameHeight;
|
||||
int _frameWidth;
|
||||
|
||||
private RenderTargetIdentifier _colorBuffer;
|
||||
private RenderTargetIdentifier _pixelBuffer;
|
||||
readonly Material _material;
|
||||
RenderTargetIdentifier _pixelBuffer;
|
||||
|
||||
private Material _material;
|
||||
private int _frameWidth;
|
||||
private int _frameHeight;
|
||||
readonly PixelizeFeature.PassSettings _settings;
|
||||
|
||||
public PixelizePass(PixelizeFeature.PassSettings settings)
|
||||
{
|
||||
public PixelizePass(PixelizeFeature.PassSettings settings) {
|
||||
_settings = settings;
|
||||
renderPassEvent = settings.RenderPassEvent;
|
||||
_material = CoreUtils.CreateEngineMaterial("Hidden/Szafa/Pixelize");
|
||||
}
|
||||
|
||||
public override void OnCameraSetup(CommandBuffer cmd, ref RenderingData renderingData)
|
||||
{
|
||||
public override void OnCameraSetup(CommandBuffer cmd, ref RenderingData renderingData) {
|
||||
_colorBuffer = renderingData.cameraData.renderer.cameraColorTargetHandle;
|
||||
RenderTextureDescriptor descriptor = renderingData.cameraData.cameraTargetDescriptor;
|
||||
|
||||
@@ -43,21 +40,15 @@ namespace RebootKit.Engine.Graphics.Pixelize
|
||||
_pixelBuffer = new RenderTargetIdentifier(PixelBufferID);
|
||||
}
|
||||
|
||||
public override void OnCameraCleanup(CommandBuffer cmd)
|
||||
{
|
||||
if (cmd == null)
|
||||
{
|
||||
throw new System.ArgumentNullException(nameof(cmd));
|
||||
}
|
||||
public override void OnCameraCleanup(CommandBuffer cmd) {
|
||||
if (cmd == null) throw new ArgumentNullException(nameof(cmd));
|
||||
|
||||
cmd.ReleaseTemporaryRT(PixelBufferID);
|
||||
}
|
||||
|
||||
public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
|
||||
{
|
||||
public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData) {
|
||||
CommandBuffer cmd = CommandBufferPool.Get();
|
||||
using (new ProfilingScope(cmd, new ProfilingSampler("Pixelize Pass")))
|
||||
{
|
||||
using (new ProfilingScope(cmd, new ProfilingSampler("Pixelize Pass"))) {
|
||||
// Blit(cmd, _colorBuffer, _pixelBuffer, _material);
|
||||
// Blit(cmd, _pixelBuffer, _colorBuffer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user