- add: new tiles and another ui tweaks (#11)
* - fix: audio crash * - tweak: main menu * connect gui * some shaders here * tiles
This commit is contained in:
38
Content.Client/_White/Overlays/GrainOverlay.cs
Normal file
38
Content.Client/_White/Overlays/GrainOverlay.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Shared.Enums;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client._White.Overlays;
|
||||
|
||||
public sealed class GrainOverlay : Overlay
|
||||
{
|
||||
[Dependency] private readonly IPrototypeManager _prototype = default!;
|
||||
|
||||
private readonly ShaderInstance _shader;
|
||||
|
||||
public GrainOverlay()
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
_shader = _prototype.Index<ShaderPrototype>("Grain").Instance().Duplicate();
|
||||
}
|
||||
|
||||
public override OverlaySpace Space => OverlaySpace.WorldSpace;
|
||||
|
||||
public override bool RequestScreenTexture => true;
|
||||
|
||||
protected override void Draw(in OverlayDrawArgs args)
|
||||
{
|
||||
if (ScreenTexture is null)
|
||||
return;
|
||||
|
||||
var worldHandle = args.WorldHandle;
|
||||
|
||||
_shader.SetParameter("SCREEN_TEXTURE", ScreenTexture);
|
||||
_shader.SetParameter("strength", 40.0f);
|
||||
|
||||
worldHandle.UseShader(_shader);
|
||||
worldHandle.DrawRect(args.WorldBounds, Color.White);
|
||||
worldHandle.UseShader(null);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user