rj-action-library/Runtime/Rendering/CompositorEffects/GreyScale/GreyScaleEffect.cs

41 lines
845 B
C#
Raw Normal View History

2025-04-23 12:00:43 +00:00
using Godot;
using Godot.Collections;
using System.Collections.Generic;
namespace Rokojori
{
[Tool]
[GlobalClass]
public partial class GreyScaleEffect:SingleShaderCompositorEffect
{
public static readonly string shaderPath =
RokojoriPlugin.Path( "Runtime/Rendering/CompositorEffects/GreyScale/GrayScaleShader.glsl" );
protected override void OnConfigure()
{
EffectCallbackType = EffectCallbackTypeEnum.PostTransparent;
_shaderPath = shaderPath;
_groupSize = 8;
}
2025-04-24 13:39:00 +00:00
protected override void SetConstants()
2025-04-23 12:00:43 +00:00
{
constants.Set(
(Vector2)context.internalSize,
Vector2.Zero
);
}
protected override void RenderView()
{
context.Assign_ScreenColorTexture();
context.pushConstants = constants;
context.Render();
}
}
}