This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.Rendering; | |
using UnityEngine.Rendering.Universal; | |
public class RenderObjectsToTextureFeature : ScriptableRendererFeature | |
{ | |
public RenderObjectsToTexturePass.Settings Settings = new(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static float2 kernel3UVs[9] = { | |
float2(-1, 1), float2(0, 1), float2(1, 1), | |
float2(-1, 0), float2(0, 0), float2(1, 0), | |
float2(-1, -1), float2(0, -1), float2(1, -1), | |
}; | |
void DoubleKernel3x3_float(Texture2D Texture, SamplerState Sampler, float TexelWidth, float TexelHeight, float2 UV, | |
float3x3 KernelX, float3x3 KernelY, float Thickness, out float Out) | |
{ | |
const float2 texelSize = float2(TexelWidth, TexelHeight); | |
const float2 offset = Thickness / texelSize; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Serializable] | |
public struct SaveTag : IComponentData { } | |
[Serializable] | |
public struct MissingRenderMeshTag : IComponentData { } | |
[Serializable] | |
public struct MissingPhysicsColliderTag : IComponentData { } | |
[Serializable] |