Skip to content

Instantly share code, notes, and snippets.

@ArieLeo
ArieLeo / MeshExtensions.cs
Created February 13, 2024 15:23 — forked from Doprez/MeshExtensions.cs
Get Vertices and Indices from a mesh in Stride3d
using Stride.Games;
using Stride.Rendering;
using System;
using Stride.Core.Serialization;
using Stride.Core;
using Stride.Physics;
using System.Collections.Generic;
using Stride.Core.Mathematics;
public static class MeshExtensions
@ArieLeo
ArieLeo / YourGameDefinition.cs
Created February 13, 2024 15:21 — forked from Eideren/YourGameDefinition.cs
How to setup async shader compilation in stride, note that the game will still freeze initially to compile the fallback
public class YourGameDefinition : Stride.Engine.Game
{
protected override void BeginRun()
{
base.BeginRun();
foreach( var feature in SceneSystem.GraphicsCompositor.RenderFeatures )
{
if( feature is MeshRenderFeature meshRf )
{
meshRf.ComputeFallbackEffect += FallbackForAsyncCompilation;
@ArieLeo
ArieLeo / AnimationEvent.cs
Created February 9, 2024 13:58 — forked from Doprez/AnimationEvent.cs
Stride Animation event trigger
using ImmoApocalypse.Code.Core.Structs;
using Stride.Core;
using Stride.Engine;
using System;
using System.Windows.Media.Animation;
namespace Core;
[DataContract(nameof(AnimationEvent))]
[AllowMultipleComponents]
@ArieLeo
ArieLeo / RenderObjectsPass.cs
Created September 27, 2023 13:44 — forked from wonkee-kim/RenderObjectsPass.cs
Unity URP sample -RenderObjects's RenderPass
using System.Collections.Generic;
using UnityEngine.Rendering.Universal;
using UnityEngine.Rendering;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Rendering.Universal
{
[MovedFrom("UnityEngine.Experimental.Rendering.LWRP")] public class RenderObjectsPass : ScriptableRenderPass
{
RenderQueueType renderQueueType;
@ArieLeo
ArieLeo / RenderObjects.cs
Created September 27, 2023 13:44 — forked from wonkee-kim/RenderObjects.cs
Unity URP sample -RenderObjects's RendererFeature
using System.Collections.Generic;
using UnityEngine.Rendering.Universal;
using UnityEngine.Rendering;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Rendering.Universal
{
[MovedFrom("UnityEngine.Experimental.Rendering.LWRP")]public enum RenderQueueType
{
Opaque,
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class getBonesPath : MonoBehaviour {
public Transform obj;
public AnimationClip _clip;
public bool isOn;
@ArieLeo
ArieLeo / Outline.shader
Created June 8, 2023 09:38 — forked from ScottJDaley/Outline.shader
Wide Outlines Renderer Feature for URP and ECS/DOTS/Hybrid Renderer
// Original shader by @bgolus, modified slightly by @alexanderameye for URP, modified slightly more
// by @gravitonpunch for ECS/DOTS/HybridRenderer.
// https://twitter.com/bgolus
// https://medium.com/@bgolus/the-quest-for-very-wide-outlines-ba82ed442cd9
// https://alexanderameye.github.io/
// https://twitter.com/alexanderameye/status/1332286868222775298
Shader "Hidden/Outline"
{
Properties
@ArieLeo
ArieLeo / Lightbeam.shader
Created May 30, 2023 11:31
UDN Lightbeam Shader converted to Unity
Shader "Lightbeam/Lightbeam" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
_Width ("Width", Float) = 8.71
_Tweak ("Tweak", Float) = 0.65
}
SubShader {
Tags { "Queue" = "Transparent" "IgnoreProjector" = "True"}
Pass {
@ArieLeo
ArieLeo / URP_Normal.shader
Created April 27, 2023 08:47 — forked from shivaduke28/URP_Normal.shader
simple URP Lit shaders for learning
Shader "MyShader/URP_Normal"
{
Properties
{
[Header(Base Color)]
[MainTexture]_BaseMap("_BaseMap (Albedo)", 2D) = "white" {}
[HDR][MainColor]_BaseColor("_BaseColor", Color) = (1,1,1,1)
[Header(Normal)]
[MainTexture]_NormalMap("_NormalMap", 2D) = "white" {}
}
@ArieLeo
ArieLeo / ComponentVariable.cs
Created March 20, 2023 12:58 — forked from adamski11/ComponentVariable.cs
A ComponentVariable<T> can be used as a mini dependancy injection system to allow for rapid prototyping and the referencing of values without having to hard set those references in your scripts.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using UnityEngine;
using UnityEngine.Serialization;
/*To use this script, when you need to get a variable from another script/component, instead of directly
referencing the component and then the specific variable (e.g. rBody.velocity), you would make a "ComponentVariable"