Skip to content

Instantly share code, notes, and snippets.

@w0wca7a
w0wca7a / CustomPostProcessingEffects
Last active December 12, 2025 21:38
Custom post processing image effect in Stride game engine thats working in Game studio and can be configured in Graphics compositor. Used shader https://www.shadertoy.com/view/wllBDM. You must have Stride extension in VS for shader keys generation.
using System;
using System.ComponentModel;
using Stride.Core;
using Stride.Graphics;
using Stride.Rendering;
using Stride.Core.Annotations;
using Stride.Rendering.Compositing;
using Stride.Rendering.Images;
namespace MyGame.PostEffect
@w0wca7a
w0wca7a / GPUBuffer.cs
Last active December 11, 2025 16:03
Getting data from the SDSL Compute Shader in the Stride game engine
using Stride.Core.Mathematics;
using Stride.Engine;
using Stride.Graphics;
using Stride.Rendering;
using Stride.Rendering.ComputeEffect;
public class GPUBuffer : SyncScript
{
private ComputeEffectShader computeEffectShader;
@w0wca7a
w0wca7a / BasicCameraGameController.cs
Created November 28, 2025 18:32
Camera controller for GameControllers in Stride based on DirectInput
using System;
using Stride.Core.Mathematics;
using Stride.Engine;
using Stride.Input;
public class BasicCameraGameController : SyncScript
{
private const float MaximumPitch = MathUtil.PiOverTwo * 0.99f;
private Vector3 upVector;
private Vector3 translation;
@w0wca7a
w0wca7a / AsyncShaderPrecompiler.cs
Last active September 17, 2025 13:03
Async Shader Precompiler for Garaphics compositor in Stride game engine based on https://gist.github.com/Eideren/ef6be9508d8d3b0e460d8a6d15f0937b
// Copyright (c) Stride contributors (https://stride3d.net).
// Distributed under the MIT license.
using Stride.Core.Mathematics;
using System;
using Stride.Rendering;
using Stride.Rendering.Compositing;
using Stride.Rendering.Materials.ComputeColors;
using Stride.Rendering.Materials;
using Stride.Shaders;
@w0wca7a
w0wca7a / TargetComponent.cs
Created September 3, 2025 22:24
TargetRender for Stride game engine
// add this component to Entity, which must be marked as target
using Stride.Core;
using Stride.Engine;
[DataContract]
public class TargetComponent : EntityComponent {}
@w0wca7a
w0wca7a / CursorRender.cs
Created August 16, 2025 20:27
Renderer for cursor image in Stride game engine
/// https://forums.stride3d.net/t/change-mouse-cursor-graphic/1281/5
using Stride.Games;
using Stride.Graphics;
using Stride.Core;
using Stride.Input;
using Stride.Rendering;
using Stride.Rendering.Compositing;
[Display("Demo: Sprite Cursor Renderer")]
@w0wca7a
w0wca7a / DoFEffectMenu.cs
Last active September 26, 2025 21:55
Simple menu with blur in Stride. In this example we not using Depth of field effect in game. If you already using Depth of field, you must save DoF configuration before showing UI, and restore after hiding.
using Stride.Core;
using Stride.Core.Annotations;
using Stride.Core.Mathematics;
using Stride.Engine;
using Stride.Games;
using Stride.Input;
using Stride.Rendering.Compositing;
using Stride.Rendering.Images;
using Stride.UI;
public static class EntityExtensions
{
public static void LookAt(this Entity e, Vector3 target)
{
float azimuth = GetLookAtAngles(e.Transform.Position, target, out float altitude);
var result = Quaternion.RotationYawPitchRoll(azimuth, -altitude, 0);
e.Transform.Rotation = result;
}
public static Vector3 Position(this Entity e) => e.Transform.Position;
private static float GetLookAtAngles(Vector3 source, Vector3 destination, out float altitude)
using Stride.Core.Mathematics;
using Stride.Engine;
using Stride.Input;
namespace SomeNameSpace
{
public class CameraFollow : SyncScript
{
public float DelaySpeed = 0.6f;
@w0wca7a
w0wca7a / RainEffect.cs
Last active April 15, 2025 09:04
Gorgeous rain on glass shader for Stride game engine
// Copyright (c) Stride contributors (https://stride3d.net).
// Distributed under the MIT license.
using Stride.Engine;
using Stride.Graphics;
namespace Additionals.Shader.ShadertoyExam
{
[Display("RainDrops effect")]
[ComponentCategory("Effects")]