2025-04-24 13:39:00 +00:00
|
|
|
|
|
|
|
using Godot;
|
|
|
|
using Godot.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
namespace Rokojori
|
|
|
|
{
|
|
|
|
[Tool]
|
|
|
|
[GlobalClass]
|
2025-04-26 20:04:11 +00:00
|
|
|
public partial class RadialBlur2:RDGraphCompositorEffect
|
2025-04-24 13:39:00 +00:00
|
|
|
{
|
2025-04-26 20:04:11 +00:00
|
|
|
public RadialBlur2():base()
|
2025-04-24 13:39:00 +00:00
|
|
|
{
|
2025-04-25 08:13:22 +00:00
|
|
|
Initialize();
|
2025-04-24 13:39:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
[Export]
|
|
|
|
public Vector2 center = new Vector2( 0.5f, 0.5f );
|
|
|
|
|
|
|
|
[Export]
|
|
|
|
public float radius = 0.5f;
|
|
|
|
|
|
|
|
[Export]
|
|
|
|
public float intensity = 0.5f;
|
|
|
|
|
|
|
|
[Export]
|
|
|
|
public float samples = 16f;
|
|
|
|
|
|
|
|
|
|
|
|
CEG_ScreenColorTexure screenColorTexture;
|
|
|
|
CEG_BufferTexture bufferTexture;
|
|
|
|
|
|
|
|
CEG_Copy copy;
|
2025-04-26 20:04:11 +00:00
|
|
|
CEG_RadialBlur radialBlur;
|
2025-04-24 13:39:00 +00:00
|
|
|
|
|
|
|
void Initialize()
|
|
|
|
{
|
2025-04-26 20:04:11 +00:00
|
|
|
screenColorTexture = new CEG_ScreenColorTexure( graph );
|
|
|
|
bufferTexture = CEG_BufferTexture.ScreenSize( graph );
|
2025-04-24 13:39:00 +00:00
|
|
|
|
2025-04-26 20:04:11 +00:00
|
|
|
copy = new CEG_Copy( graph );
|
|
|
|
radialBlur = new CEG_RadialBlur( graph );
|
2025-04-24 13:39:00 +00:00
|
|
|
|
2025-04-25 08:13:22 +00:00
|
|
|
|
2025-04-26 20:04:11 +00:00
|
|
|
graph.InitializeNodes();
|
|
|
|
|
|
|
|
|
2025-04-24 13:39:00 +00:00
|
|
|
|
|
|
|
copy.SetTextureSlotInputs( screenColorTexture, bufferTexture );
|
|
|
|
radialBlur.SetTextureSlotInputs( copy.output, copy.input );
|
|
|
|
|
|
|
|
|
2025-04-26 20:04:11 +00:00
|
|
|
graph.SetProcessOrder(
|
2025-04-24 13:39:00 +00:00
|
|
|
screenColorTexture, bufferTexture,
|
|
|
|
copy, radialBlur
|
|
|
|
);
|
|
|
|
}
|
2025-04-26 20:04:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
protected override void ForAllViews()
|
2025-04-24 13:39:00 +00:00
|
|
|
{
|
|
|
|
radialBlur.constants.Set(
|
|
|
|
center,
|
|
|
|
radius,
|
|
|
|
intensity,
|
|
|
|
samples,
|
|
|
|
Vector2.Zero
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2025-04-26 20:04:11 +00:00
|
|
|
|
2025-04-24 13:39:00 +00:00
|
|
|
}
|
|
|
|
}
|