Last active
October 22, 2024 12:19
-
Star
(118)
You must be signed in to star a gist -
Fork
(11)
You must be signed in to fork a gist
-
-
Save smkplus/2a5899bf415e2b6bf6a59726bb1ae2ec to your computer and use it in GitHub Desktop.
Revisions
-
smkplus renamed this gist
Sep 20, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
smkplus revised this gist
Dec 3, 2017 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -200,6 +200,7 @@ https://qiita.com/r-ngtm/items/7ec3e3a9dfcc752cd02c # Unity Material Property Drawer https://tedsieblog.wordpress.com/2017/03/02/unity-material-property-drawer/ https://qiita.com/r-ngtm/items/7ec3e3a9dfcc752cd02c # Shade More Efficiently -
smkplus revised this gist
Dec 3, 2017 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -203,4 +203,6 @@ https://tedsieblog.wordpress.com/2017/03/02/unity-material-property-drawer/ https://qiita.com/r-ngtm/items/7ec3e3a9dfcc752cd02c # Shade More Efficiently  http://www.martinpalko.com/muli-compile-unity/ -
smkplus revised this gist
Dec 3, 2017 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -200,4 +200,7 @@ https://qiita.com/r-ngtm/items/7ec3e3a9dfcc752cd02c # Unity Material Property Drawer https://tedsieblog.wordpress.com/2017/03/02/unity-material-property-drawer/ https://qiita.com/r-ngtm/items/7ec3e3a9dfcc752cd02c # Shade More Efficiently http://www.martinpalko.com/muli-compile-unity/ -
smkplus revised this gist
Dec 3, 2017 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -195,6 +195,7 @@ Fallback "Sprites/Default" ``` # multi_compile https://qiita.com/Es_Program/items/79edf9f8fca786b365aa https://qiita.com/r-ngtm/items/7ec3e3a9dfcc752cd02c # Unity Material Property Drawer -
smkplus revised this gist
Dec 3, 2017 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -66,6 +66,9 @@ _Vector("Vector", Vector) = (0,0,0,0) https://cmwdexint.com/2017/05/06/materialpropertydrawer-in-shader-gui-without-creating-shadergui/ # Controlling fixed function states from materials ``` Shader "Smkgames/Sprites" @@ -190,7 +193,9 @@ Fallback "Sprites/Default" // // Linear Dodge // Blend One One ``` # multi_compile https://qiita.com/Es_Program/items/79edf9f8fca786b365aa https://qiita.com/r-ngtm/items/7ec3e3a9dfcc752cd02c # Unity Material Property Drawer https://tedsieblog.wordpress.com/2017/03/02/unity-material-property-drawer/ -
smkplus revised this gist
Dec 2, 2017 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -193,4 +193,5 @@ Fallback "Sprites/Default" # Unity Material Property Drawer https://tedsieblog.wordpress.com/2017/03/02/unity-material-property-drawer/ https://qiita.com/r-ngtm/items/7ec3e3a9dfcc752cd02c -
smkplus revised this gist
Dec 2, 2017 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -189,4 +189,8 @@ Fallback "Sprites/Default" // // // Linear Dodge // Blend One One ``` # Unity Material Property Drawer https://tedsieblog.wordpress.com/2017/03/02/unity-material-property-drawer/ -
smkplus revised this gist
Dec 2, 2017 . 1 changed file with 68 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,71 @@  ``` Shader "MaterialPropertyDrawer" { Properties { _MainTex("Texture", 2D) = "white" {} [HideInInspector] _MainTex2("Hide Texture", 2D) = "white" {} [NoScaleOffset] _MainTex3("No Scale/Offset Texture", 2D) = "white" {} [PerRendererData] _MainTex4("PerRenderer Texture", 2D) = "white" {} [Normal] _MainTex5("Normal Texture", 2D) = "white" {} _Color("Color", Color) = (1,0,0,1) [HDR] _HDRColor("HDR Color", Color) = (1,0,0,1) _Vector("Vector", Vector) = (0,0,0,0) //Can't go below zero [Gamma] _GVector("Gamma Vector", Vector) = (0,0,0,0) // Header creates a header text before the shader property. [Header(A group of things)] // Will set "_INVERT_ON" shader keyword when set [Toggle] _Invert("Auto keyword toggle", Float) = 0 // Will set "ENABLE_FANCY" shader keyword when set. [Toggle(ENABLE_FANCY)] _Fancy("Keyword toggle", Float) = 0 // Will show when ENABLE_FANCY is true //Feature request //[ShowIf(ENABLE_FANCY)] _ShowIf("Show If", Float) = 0 // Blend mode values [Enum(UnityEngine.Rendering.BlendMode)] _Blend("Blend mode Enum", Float) = 1 // A subset of blend mode values, just "One" (value 1) and "SrcAlpha" (value 5). [Enum(One,1,SrcAlpha,5)] _Blend2("Blend mode subset", Float) = 1 // Each option will set _OVERLAY_NONE, _OVERLAY_ADD, _OVERLAY_MULTIPLY shader keywords. [KeywordEnum(None, Add, Multiply)] _Overlay("Keyword Enum", Float) = 0 // ...later on in CGPROGRAM code: //#pragma multi_compile _OVERLAY_NONE, _OVERLAY_ADD, _OVERLAY_MULTIPLY // ... // A slider with 3.0 response curve [PowerSlider(3.0)] _Shininess("Power Slider", Range(0.01, 1)) = 0.08 // An integer slider for specified range (0 to 255) [IntRange] _Alpha("Int Range", Range(0, 255)) = 100 // Default small amount of space. [Space] _Prop1("Small amount of space", Float) = 0 // Large amount of space. [Space(50)] _Prop2("Large amount of space", Float) = 0 } ``` https://cmwdexint.com/2017/05/06/materialpropertydrawer-in-shader-gui-without-creating-shadergui/ ``` Shader "Smkgames/Sprites" -
smkplus renamed this gist
Nov 23, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
smkplus revised this gist
Nov 23, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -29,7 +29,7 @@ Shader "Smkgames/Sprites" SubShader { Tags { "RenderType" = "Opaque" } LOD 100 Blend[_SrcBlend][_DstBlend] ZTest[_ZTest] -
smkplus revised this gist
Nov 23, 2017 . No changes.There are no files selected for viewing
-
smkplus revised this gist
Nov 23, 2017 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -89,6 +89,11 @@ ENDCG Fallback "Sprites/Default" } //Culling //https://gist.github.com/aras-p/b2a0952161cb0c2b2cc0#file-foo-md //Blending // // Normal // Blend SrcAlpha OneMinusSrcAlpha // -
smkplus revised this gist
Nov 23, 2017 . 1 changed file with 4 additions and 8 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ ``` Shader "Smkgames/Sprites" { @@ -89,19 +89,14 @@ ENDCG Fallback "Sprites/Default" } // // Normal // Blend SrcAlpha OneMinusSrcAlpha // // // Soft Additive // Blend OneMinusDstColor One // // // Multiply // Blend DstColor Zero // // // 2x Multiply // Blend DstColor SrcColor @@ -120,4 +115,5 @@ Fallback "Sprites/Default" // Blend One OneMinusSrcColor // // // Linear Dodge // Blend One One ``` -
smkplus revised this gist
Nov 23, 2017 . 1 changed file with 35 additions and 34 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,40 +1,41 @@ Shader "Smkgames/Sprites" { Properties { [Header(Main Color)] [Toggle] _UseColor("Enabled?", Float) = 1 _Color("Main Color", Color) = (1,1,1,1) [Space(5)] [Header(Base(RGB))] [Toggle] _UseMainTex("Enabled?", Float) = 1 _MainTex("Base (RGB)", 2D) = "white" {} //[NoScaleOffset] _MainTex("Base (RGB)", 2D) = "white" {} [Space(5)] [Header(Blend State)] [Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend("SrcBlend", Float) = 1 //"One" [Enum(UnityEngine.Rendering.BlendMode)] _DstBlend("DestBlend", Float) = 0 //"Zero" [Space(5)] [Header(Other)] [Enum(UnityEngine.Rendering.CullMode)] _Cull("Cull", Float) = 2 //"Back" [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest("ZTest", Float) = 4 //"LessEqual" [Enum(Off,0,On,1)] _ZWrite("ZWrite", Float) = 1.0 //"On" [Enum(UnityEngine.Rendering.ColorWriteMask)] _ColorWriteMask("ColorWriteMask", Float) = 15 //"All" } SubShader { Tags { "RenderType" = "Opaque" "PerformanceChecks" = "False" } LOD 100 Blend[_SrcBlend][_DstBlend] ZTest[_ZTest] ZWrite[_ZWrite] Cull[_Cull] ColorMask[_ColorWriteMask] Pass { -
smkplus revised this gist
Nov 23, 2017 . 1 changed file with 34 additions and 34 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,40 +1,40 @@ Shader "Smkgames/Sprite" { Properties { [Header(Main Color)] [Toggle] _UseColor("Enabled?", Float) = 1 _Color("Main Color", Color) = (1,1,1,1) [Space(5)] [Header(Base(RGB))] [Toggle] _UseMainTex("Enabled?", Float) = 1 _MainTex("Base (RGB)", 2D) = "white" {} //[NoScaleOffset] _MainTex("Base (RGB)", 2D) = "white" {} [Space(5)] [Header(Blend State)] [Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend("SrcBlend", Float) = 1 //"One" [Enum(UnityEngine.Rendering.BlendMode)] _DstBlend("DestBlend", Float) = 0 //"Zero" [Space(5)] [Header(Other)] [Enum(UnityEngine.Rendering.CullMode)] _Cull("Cull", Float) = 2 //"Back" [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest("ZTest", Float) = 4 //"LessEqual" [Enum(Off,0,On,1)] _ZWrite("ZWrite", Float) = 1.0 //"On" [Enum(UnityEngine.Rendering.ColorWriteMask)] _ColorWriteMask("ColorWriteMask", Float) = 15 //"All" } SubShader { Tags { "RenderType" = "Opaque" "PerformanceChecks" = "False" } LOD 100 Blend[_SrcBlend][_DstBlend] ZTest[_ZTest] ZWrite[_ZWrite] Cull[_Cull] ColorMask[_ColorWriteMask] Pass { -
smkplus renamed this gist
Nov 23, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
smkplus revised this gist
Nov 23, 2017 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -88,7 +88,8 @@ ENDCG Fallback "Sprites/Default" } //Culling //https://gist.github.com/TJHeuvel/c4f8d218a0d774682560a8f348a90dff#comments //Blending Description -
smkplus revised this gist
Nov 23, 2017 . 1 changed file with 33 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -86,4 +86,36 @@ ENDCG } } Fallback "Sprites/Default" } //[Culling](https://gist.github.com/TJHeuvel/c4f8d218a0d774682560a8f348a90dff#comments) //Blending Description // // Normal // Blend SrcAlpha OneMinusSrcAlpha // // // Soft Additive // Blend OneMinusDstColor One // // // Multiply Blend DstColor Zero // // // 2x Multiply // Blend DstColor SrcColor // // // Darken // BlendOp Min // Blend One One // When using Min operation, these factors are ignored // // // Lighten // BlendOp Max // Blend One One // When using Max operation, these factors are ignored // // // Screen // Blend OneMinusDstColor One // Or // Blend One OneMinusSrcColor // // // Linear Dodge // Blend One One -
smkplus revised this gist
Nov 23, 2017 . No changes.There are no files selected for viewing
-
smkplus created this gist
Nov 23, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,89 @@ Shader "Smkgames/Sprite" { Properties { [Header(Main Color)] [Toggle] _UseColor("Enabled?", Float) = 1 _Color("Main Color", Color) = (1,1,1,1) [Space(5)] [Header(Base(RGB))] [Toggle] _UseMainTex("Enabled?", Float) = 1 _MainTex("Base (RGB)", 2D) = "white" {} //[NoScaleOffset] _MainTex("Base (RGB)", 2D) = "white" {} [Space(5)] [Header(Blend State)] [Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend("SrcBlend", Float) = 1 //"One" [Enum(UnityEngine.Rendering.BlendMode)] _DstBlend("DestBlend", Float) = 0 //"Zero" [Space(5)] [Header(Other)] [Enum(UnityEngine.Rendering.CullMode)] _Cull("Cull", Float) = 2 //"Back" [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest("ZTest", Float) = 4 //"LessEqual" [Enum(Off,0,On,1)] _ZWrite("ZWrite", Float) = 1.0 //"On" [Enum(UnityEngine.Rendering.ColorWriteMask)] _ColorWriteMask("ColorWriteMask", Float) = 15 //"All" } SubShader { Tags { "RenderType" = "Opaque" "PerformanceChecks" = "False" } LOD 100 Blend[_SrcBlend][_DstBlend] ZTest[_ZTest] ZWrite[_ZWrite] Cull[_Cull] ColorMask[_ColorWriteMask] Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag #pragma fragmentoption ARB_precision_hint_fastest #include "UnityCG.cginc" struct appdata_t { float4 vertex : POSITION; float4 color : COLOR; float2 texcoord : TEXCOORD0; }; struct v2f { half2 texcoord : TEXCOORD0; float4 vertex : SV_POSITION; fixed4 color : COLOR; }; sampler2D _MainTex; fixed4 _Color; float _Speed; float _UseColor; float _UseMainTex; v2f vert(appdata_t IN) { v2f OUT; OUT.vertex = UnityObjectToClipPos(IN.vertex); OUT.texcoord = IN.texcoord; OUT.color = IN.color; return OUT; } float4 frag (v2f i) : COLOR { float2 uv = i.texcoord.xy; float4 tex = lerp(float4(1,1,1,1),tex2D(_MainTex, uv)*i.color,_UseMainTex); return lerp(tex,tex*_Color,_UseColor); } ENDCG } } Fallback "Sprites/Default" }