This commit is contained in:
2024-09-20 20:30:10 +02:00
commit 4fabf1a6fd
29169 changed files with 1706941 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
using UnityEngine.Rendering;
namespace UnityEditor.Rendering
{
static class CoreMenuItems
{
[MenuItem("Assets/Create/Shader/Custom Render Texture", priority = CoreUtils.Priorities.assetsCreateShaderMenuPriority + 2)]
static void MenuCreateCustomRenderTextureShader()
{
string templatePath = $"{CoreUtils.GetCorePath()}/Editor/CustomRenderTexture/CustomRenderTextureShader.template";
ProjectWindowUtil.CreateScriptAssetFromTemplateFile(templatePath, "New Custom Render Texture.shader");
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7e2d77127041cd24faf2847015043c6f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,38 @@
Shader "CustomRenderTexture/#NAME#"
{
Properties
{
_Color ("Color", Color) = (1,1,1,1)
_MainTex("InputTex", 2D) = "white" {}
}
SubShader
{
Blend One Zero
Pass
{
Name "#NAME#"
CGPROGRAM
#include "UnityCustomRenderTexture.cginc"
#pragma vertex CustomRenderTextureVertexShader
#pragma fragment frag
#pragma target 3.0
float4 _Color;
sampler2D _MainTex;
float4 frag(v2f_customrendertexture IN) : SV_Target
{
float2 uv = IN.localTexcoord.xy;
float4 color = tex2D(_MainTex, uv) * _Color;
// TODO: Replace this by actual code!
uint2 p = uv.xy * 256;
return countbits(~(p.x & p.y) + 1) % 2 * float4(uv, 1, 1) * color;
}
ENDCG
}
}
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 6e1b69fb677bd95439f31bff8ca1c431
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: