-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: PrefsGUI.RosetatUI supports "Enum(UnityEngine.Rendering.BlendMo…
…de)" property attribute
- Loading branch information
Showing
11 changed files
with
604 additions
and
60 deletions.
There are no files selected for viewing
This file contains 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
63 changes: 63 additions & 0 deletions
63
Assets/Examples/PrefsMaterialPropertyExample/PrefsMaterialPropertyUnlit.shader
This file contains 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 file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
Shader "Unlit/PrefsMaterialPropertyUnlit" | ||
{ | ||
Properties | ||
{ | ||
_MainTex("Texture", 2D) = "white" {} | ||
_Alpha("Alpha", Range(0, 1)) = 1 | ||
[Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend("Source Blend", Float) = 5 | ||
[Enum(UnityEngine.Rendering.BlendMode)] _DstBlend("Destination Blend", Float) = 10 | ||
[Enum(Off, 0, On, 1)] _ZWrite("ZWrite", Float) = 0 | ||
} | ||
SubShader | ||
{ | ||
Tags { "RenderType"="Opaque" } | ||
LOD 100 | ||
|
||
Pass | ||
{ | ||
Blend [_SrcBlend][_DstBlend] // soft additive | ||
ZWrite [_ZWrite] | ||
|
||
CGPROGRAM | ||
#pragma vertex vert | ||
#pragma fragment frag | ||
// make fog work | ||
#pragma multi_compile_fog | ||
|
||
#include "UnityCG.cginc" | ||
|
||
struct appdata | ||
{ | ||
float4 vertex : POSITION; | ||
float2 uv : TEXCOORD0; | ||
}; | ||
|
||
struct v2f | ||
{ | ||
float2 uv : TEXCOORD0; | ||
UNITY_FOG_COORDS(1) | ||
float4 vertex : SV_POSITION; | ||
}; | ||
|
||
sampler2D _MainTex; | ||
float4 _MainTex_ST; | ||
float _Alpha; | ||
|
||
v2f vert (appdata v) | ||
{ | ||
v2f o; | ||
o.vertex = UnityObjectToClipPos(v.vertex); | ||
o.uv = TRANSFORM_TEX(v.uv, _MainTex); | ||
return o; | ||
} | ||
|
||
fixed4 frag (v2f i) : SV_Target | ||
{ | ||
fixed4 col = tex2D(_MainTex, i.uv); | ||
col.a *= _Alpha; | ||
return col; | ||
} | ||
ENDCG | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
Assets/Examples/PrefsMaterialPropertyExample/PrefsMaterialPropertyUnlit.shader.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
File renamed without changes.
85 changes: 85 additions & 0 deletions
85
Assets/Examples/PrefsMaterialPropertyExample/UnlitMaterial.mat
This file contains 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 file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!21 &2100000 | ||
Material: | ||
serializedVersion: 8 | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_Name: UnlitMaterial | ||
m_Shader: {fileID: 4800000, guid: ccbc9691055a2ce4887639a3cc0e0c21, type: 3} | ||
m_Parent: {fileID: 0} | ||
m_ModifiedSerializedProperties: 0 | ||
m_ValidKeywords: [] | ||
m_InvalidKeywords: [] | ||
m_LightmapFlags: 4 | ||
m_EnableInstancingVariants: 0 | ||
m_DoubleSidedGI: 0 | ||
m_CustomRenderQueue: -1 | ||
stringTagMap: {} | ||
disabledShaderPasses: [] | ||
m_LockedProperties: | ||
m_SavedProperties: | ||
serializedVersion: 3 | ||
m_TexEnvs: | ||
- _BumpMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _DetailAlbedoMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _DetailMask: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _DetailNormalMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _EmissionMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _MainTex: | ||
m_Texture: {fileID: 2800000, guid: 683f78241a0a6244db2fbd66c23c8876, type: 3} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _MetallicGlossMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _OcclusionMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _ParallaxMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
m_Ints: [] | ||
m_Floats: | ||
- _Alpha: 1 | ||
- _BumpScale: 1 | ||
- _Cutoff: 0.5 | ||
- _DetailNormalMapScale: 1 | ||
- _DstBlend: 0 | ||
- _GlossMapScale: 1 | ||
- _Glossiness: 0.5 | ||
- _GlossyReflections: 1 | ||
- _Metallic: 0 | ||
- _Mode: 0 | ||
- _OcclusionStrength: 1 | ||
- _Parallax: 0.02 | ||
- _SmoothnessTextureChannel: 0 | ||
- _SpecularHighlights: 1 | ||
- _SrcBlend: 1 | ||
- _UVSec: 0 | ||
- _UseTexture: 0 | ||
- _ZWrite: 1 | ||
m_Colors: | ||
- _Color: {r: 1, g: 1, b: 1, a: 1} | ||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1} | ||
m_BuildTextureStacks: [] |
8 changes: 8 additions & 0 deletions
8
Assets/Examples/PrefsMaterialPropertyExample/UnlitMaterial.mat.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.