Skip to content
This repository was archived by the owner on Sep 21, 2024. It is now read-only.

Commit d563197

Browse files
author
Michael Lohr
committed
Initial Commit
0 parents  commit d563197

10 files changed

+347
-0
lines changed
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using UnityEngine;
2+
using UnityEngine.UI;
3+
4+
using System.Collections;
5+
using System.Collections.Generic;
6+
7+
namespace Default
8+
{
9+
public class #SCRIPTNAME# : MonoBehaviour
10+
{
11+
12+
13+
14+
}
15+
}
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#pragma strict
2+
3+
function Start () {
4+
5+
}
6+
7+
function Update () {
8+
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using UnityEngine;
2+
using UnityEditor;
3+
4+
using System.Collections;
5+
using System.Collections.Generic;
6+
7+
using NUnit.Framework;
8+
9+
namespace Default.Tests
10+
{
11+
public class #SCRIPTNAME#
12+
{
13+
14+
[Test]
15+
public void EditorTest()
16+
{
17+
18+
}
19+
20+
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
Shader "Custom/#NAME#"
2+
{
3+
Properties
4+
{
5+
_Color ("Color", Color) = (1,1,1,1)
6+
_MainTex ("Albedo (RGB)", 2D) = "white" {}
7+
_Glossiness ("Smoothness", Range(0,1)) = 0.5
8+
_Metallic ("Metallic", Range(0,1)) = 0.0
9+
}
10+
SubShader
11+
{
12+
Tags
13+
{
14+
"RenderType"="Opaque"
15+
}
16+
LOD 200
17+
18+
CGPROGRAM
19+
20+
#pragma surface surf Standard fullforwardshadows
21+
#pragma target 3.0
22+
23+
struct Input
24+
{
25+
float2 uv_MainTex;
26+
};
27+
28+
sampler2D _MainTex;
29+
half _Glossiness;
30+
half _Metallic;
31+
fixed4 _Color;
32+
33+
void surf (Input IN, inout SurfaceOutputStandard o)
34+
{
35+
o.Metallic = _Metallic;
36+
o.Smoothness = _Glossiness;
37+
38+
fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
39+
o.Albedo = c.rgb;
40+
o.Alpha = c.a;
41+
}
42+
ENDCG
43+
}
44+
FallBack "Diffuse"
45+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
Shader "Instanced/#NAME#"
2+
{
3+
Properties
4+
{
5+
_Color ("Color", Color) = (1,1,1,1)
6+
_MainTex ("Albedo (RGB)", 2D) = "white" {}
7+
_Glossiness ("Smoothness", Range(0,1)) = 0.5
8+
_Metallic ("Metallic", Range(0,1)) = 0.0
9+
}
10+
SubShader
11+
{
12+
Tags
13+
{
14+
"RenderType"="Opaque"
15+
}
16+
LOD 200
17+
18+
CGPROGRAM
19+
#pragma surface surf Standard fullforwardshadows addshadow
20+
#pragma target 3.0
21+
22+
// Enable instancing for this shader
23+
#pragma multi_compile_instancing
24+
25+
// Config maxcount. See manual page.
26+
// #pragma instancing_options
27+
28+
struct Input
29+
{
30+
float2 uv_MainTex;
31+
};
32+
33+
sampler2D _MainTex;
34+
half _Glossiness;
35+
half _Metallic;
36+
37+
// Declare instanced properties inside a cbuffer.
38+
// Each instanced property is an array of by default 500(D3D)/128(GL) elements. Since D3D and GL imposes a certain limitation
39+
// of 64KB and 16KB respectively on the size of a cubffer, the default array size thus allows two matrix arrays in one cbuffer.
40+
// Use maxcount option on #pragma instancing_options directive to specify array size other than default (divided by 4 when used
41+
// for GL).
42+
UNITY_INSTANCING_CBUFFER_START(Props)
43+
UNITY_DEFINE_INSTANCED_PROP(fixed4, _Color) // Make _Color an instanced property (i.e. an array)
44+
UNITY_INSTANCING_CBUFFER_END
45+
46+
void surf (Input IN, inout SurfaceOutputStandard o)
47+
{
48+
o.Metallic = _Metallic;
49+
o.Smoothness = _Glossiness;
50+
51+
fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * UNITY_ACCESS_INSTANCED_PROP(_Color);
52+
o.Albedo = c.rgb;
53+
o.Alpha = c.a;
54+
}
55+
ENDCG
56+
}
57+
FallBack "Diffuse"
58+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
Shader "Unlit/#NAME#"
2+
{
3+
Properties
4+
{
5+
_MainTex ("Texture", 2D) = "white" {}
6+
}
7+
SubShader
8+
{
9+
Tags
10+
{
11+
"RenderType"="Opaque"
12+
}
13+
LOD 100
14+
15+
Pass
16+
{
17+
CGPROGRAM
18+
#pragma vertex vert
19+
#pragma fragment frag
20+
21+
#pragma multi_compile_fog
22+
23+
#include "UnityCG.cginc"
24+
25+
struct appdata
26+
{
27+
float4 vertex : POSITION;
28+
float2 uv : TEXCOORD0;
29+
};
30+
31+
struct v2f
32+
{
33+
float2 uv : TEXCOORD0;
34+
UNITY_FOG_COORDS(1)
35+
float4 vertex : SV_POSITION;
36+
};
37+
38+
sampler2D _MainTex;
39+
float4 _MainTex_ST;
40+
41+
v2f vert (appdata v)
42+
{
43+
v2f o;
44+
o.vertex = UnityObjectToClipPos(v.vertex);
45+
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
46+
UNITY_TRANSFER_FOG(o,o.vertex);
47+
return o;
48+
}
49+
50+
fixed4 frag (v2f i) : SV_Target
51+
{
52+
fixed4 col = tex2D(_MainTex, i.uv);
53+
UNITY_APPLY_FOG(i.fogCoord, col);
54+
return col;
55+
}
56+
ENDCG
57+
}
58+
}
59+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
Shader "Hidden/#NAME#"
2+
{
3+
Properties
4+
{
5+
_MainTex ("Texture", 2D) = "white" {}
6+
}
7+
SubShader
8+
{
9+
Cull Off ZWrite Off ZTest Always // No culling or depth
10+
11+
Pass
12+
{
13+
CGPROGRAM
14+
#pragma vertex vert
15+
#pragma fragment frag
16+
17+
#include "UnityCG.cginc"
18+
19+
struct appdata
20+
{
21+
float4 vertex : POSITION;
22+
float2 uv : TEXCOORD0;
23+
};
24+
25+
struct v2f
26+
{
27+
float2 uv : TEXCOORD0;
28+
float4 vertex : SV_POSITION;
29+
};
30+
31+
v2f vert (appdata v)
32+
{
33+
v2f o;
34+
o.vertex = mul(UNITY_MATRIX_MVP, v.vertex);
35+
o.uv = v.uv;
36+
return o;
37+
}
38+
39+
sampler2D _MainTex;
40+
41+
fixed4 frag (v2f i) : SV_Target
42+
{
43+
fixed4 col = tex2D(_MainTex, i.uv);
44+
col = 1 - col; // just invert the colors
45+
return col;
46+
}
47+
ENDCG
48+
}
49+
}
50+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using UnityEngine;
2+
3+
using System.Collections;
4+
using System.Collections.Generic;
5+
6+
public class #SCRIPTNAME# : StateMachineBehaviour
7+
{
8+
9+
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
10+
//public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
11+
//
12+
//}
13+
14+
// OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
15+
//public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
16+
//
17+
//}
18+
19+
// OnStateExit is called when a transition ends and the state machine finishes evaluating this state
20+
//public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
21+
//
22+
//}
23+
24+
// OnStateMove is called right after Animator.OnAnimatorMove(). Code that processes and affects root motion should be implemented here
25+
//public override void OnStateMove(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
26+
//
27+
//}
28+
29+
// OnStateIK is called right after Animator.OnAnimatorIK(). Code that sets up animation IK (inverse kinematics) should be implemented here.
30+
//public override void OnStateIK(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
31+
//
32+
//}
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
using UnityEngine;
2+
3+
using System.Collections;
4+
using System.Collections.Generic;
5+
6+
public class #SCRIPTNAME# : StateMachineBehaviour
7+
{
8+
9+
// OnStateEnter is called before OnStateEnter is called on any state inside this state machine
10+
//public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
11+
//
12+
//}
13+
14+
// OnStateUpdate is called before OnStateUpdate is called on any state inside this state machine
15+
//public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
16+
//
17+
//}
18+
19+
// OnStateExit is called before OnStateExit is called on any state inside this state machine
20+
//public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
21+
//
22+
//}
23+
24+
// OnStateMove is called before OnStateMove is called on any state inside this state machine
25+
//public override void OnStateMove(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
26+
//
27+
//}
28+
29+
// OnStateIK is called before OnStateIK is called on any state inside this state machine
30+
//public override void OnStateIK(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
31+
//
32+
//}
33+
34+
// OnStateMachineEnter is called when entering a statemachine via its Entry Node
35+
//public override void OnStateMachineEnter(Animator animator, int stateMachinePathHash){
36+
//
37+
//}
38+
39+
// OnStateMachineExit is called when exiting a statemachine via its Exit Node
40+
//public override void OnStateMachineExit(Animator animator, int stateMachinePathHash) {
41+
//
42+
//}
43+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Each #kernel tells which function to compile; you can have many kernels
2+
#pragma kernel CSMain
3+
4+
// Create a RenderTexture with enableRandomWrite flag and set it
5+
// with cs.SetTexture
6+
RWTexture2D<float4> Result;
7+
8+
[numthreads(8,8,1)]
9+
void CSMain (uint3 id : SV_DispatchThreadID)
10+
{
11+
// TODO: insert actual code here!
12+
13+
Result[id.xy] = float4(id.x & id.y, (id.x & 15)/15.0, (id.y & 15)/15.0, 0.0);
14+
}

0 commit comments

Comments
 (0)