58 lines
1.1 KiB
C#
58 lines
1.1 KiB
C#
|
|
using System.Diagnostics;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System;
|
|
using Godot;
|
|
|
|
|
|
|
|
namespace Rokojori
|
|
{
|
|
[Tool]
|
|
[GlobalClass]
|
|
public partial class TextureDilationCompositerEffect:CompositorEffect
|
|
{
|
|
RenderingDevice renderingDevice;
|
|
Rid frameBuffer;
|
|
|
|
public void _Init()
|
|
{
|
|
EffectCallbackType = EffectCallbackTypeEnum.PostOpaque;
|
|
renderingDevice = RenderingServer.GetRenderingDevice();
|
|
|
|
}
|
|
|
|
public override void _Notification(int what)
|
|
{
|
|
|
|
}
|
|
|
|
public override void _RenderCallback( int effectCallbackType, RenderData renderData )
|
|
{
|
|
if ( renderingDevice == null || effectCallbackType != (int) EffectCallbackTypeEnum.PostOpaque )
|
|
{
|
|
return;
|
|
}
|
|
|
|
var renderBuffers = (RenderSceneBuffersRD) renderData.GetRenderSceneBuffers();
|
|
|
|
if ( renderBuffers == null )
|
|
{
|
|
return;
|
|
}
|
|
|
|
var size = renderBuffers.GetInternalSize();
|
|
|
|
if ( size.X == 0 || size.Y == 0 )
|
|
{
|
|
return;
|
|
}
|
|
|
|
var groups = new Vector3((size.X - 1.0f) / 8.0f + 1.0f, (size.Y - 1.0f) / 8.0f + 1.0f, 1.0f).Floor();
|
|
|
|
|
|
}
|
|
}
|
|
|
|
} |