diff options
Diffstat (limited to 'Assets/Test/04_Graphic')
-rw-r--r-- | Assets/Test/04_Graphic/04_Graphic_UIEffect.unity | 149 | ||||
-rw-r--r-- | Assets/Test/04_Graphic/UI04_MeshModifierTest.cs | 23 | ||||
-rw-r--r-- | Assets/Test/04_Graphic/UI04_Test.mat | 95 | ||||
-rw-r--r-- | Assets/Test/04_Graphic/UI04_Test.mat.meta | 10 | ||||
-rw-r--r-- | Assets/Test/04_Graphic/UI04_Test.shader | 95 | ||||
-rw-r--r-- | Assets/Test/04_Graphic/UI04_Test.shader.meta | 10 |
6 files changed, 348 insertions, 34 deletions
diff --git a/Assets/Test/04_Graphic/04_Graphic_UIEffect.unity b/Assets/Test/04_Graphic/04_Graphic_UIEffect.unity index 83bf7d5..15cc48e 100644 --- a/Assets/Test/04_Graphic/04_Graphic_UIEffect.unity +++ b/Assets/Test/04_Graphic/04_Graphic_UIEffect.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} + m_IndirectSpecularColor: {r: 0.4465782, g: 0.49641252, b: 0.5748167, a: 1} --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 @@ -88,7 +88,6 @@ LightmapSettings: m_PVRFilteringAtrousPositionSigmaDirect: 0.5 m_PVRFilteringAtrousPositionSigmaIndirect: 2 m_PVRFilteringAtrousPositionSigmaAO: 1 - m_ShowResolutionOverlay: 1 m_LightingDataAsset: {fileID: 0} m_UseShadowmask: 1 --- !u!196 &4 @@ -122,6 +121,7 @@ GameObject: m_Component: - component: {fileID: 647807671} - component: {fileID: 647807673} + - component: {fileID: 647807674} - component: {fileID: 647807672} m_Layer: 5 m_Name: "Image \u626D\u66F2 (1)" @@ -137,7 +137,7 @@ RectTransform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 647807670} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: -39.2, y: 2.5999985, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 1637784079} @@ -145,8 +145,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 340, y: -349} - m_SizeDelta: {x: 128.8, y: 100} + m_AnchoredPosition: {x: -39.2, y: 2.6} + m_SizeDelta: {x: 126.9, y: 114.67} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &647807672 MonoBehaviour: @@ -156,10 +156,27 @@ MonoBehaviour: m_GameObject: {fileID: 647807670} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 616df8ea32e94c2429a579cc2d4f956a, type: 3} + m_Script: {fileID: 11500000, guid: 19ed27a46ca366b439439e63862c762b, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 0} +--- !u!222 &647807673 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 647807670} +--- !u!114 &647807674 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 647807670} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cba8e295482e184f9f6a5a8f2b559c3, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: c9d794cf597301347a7703a912ffb229, type: 2} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 m_OnCullStateChanged: @@ -175,13 +192,6 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 0 - m_NormalMap: {fileID: 0} ---- !u!222 &647807673 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 647807670} --- !u!1 &667326415 GameObject: m_ObjectHideFlags: 0 @@ -349,7 +359,7 @@ Camera: m_GameObject: {fileID: 1478468332} m_Enabled: 1 serializedVersion: 2 - m_ClearFlags: 1 + m_ClearFlags: 2 m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} m_NormalizedViewPortRect: serializedVersion: 2 @@ -372,7 +382,6 @@ Camera: m_TargetEye: 3 m_HDR: 1 m_AllowMSAA: 1 - m_AllowDynamicResolution: 0 m_ForceIntoRT: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 @@ -390,6 +399,95 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1577534686 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1577534687} + - component: {fileID: 1577534690} + - component: {fileID: 1577534689} + - component: {fileID: 1577534688} + m_Layer: 5 + m_Name: "Image \u626D\u66F2 (2)" + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1577534687 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1577534686} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 11.299999, y: 123.8, z: 0} + m_LocalScale: {x: 1.0000267, y: 1.0000267, z: 1.0000267} + m_Children: [] + m_Father: {fileID: 1637784079} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 11.3, y: 123.8} + m_SizeDelta: {x: 126.9, y: 114.67} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1577534688 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1577534686} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5978620b88847af4a8835c7008c813b8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 1, g: 0, b: 0, a: 0.5} + m_EffectDistance: {x: 1.67, y: 1.99} + m_UseGraphicAlpha: 1 +--- !u!114 &1577534689 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1577534686} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 48696ad002dcb2146ab8d6ad72d455d7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, Assembly-CSharp, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 30 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 3 + m_MaxSize: 40 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: "\u6D4B\u8BD5" +--- !u!222 &1577534690 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1577534686} --- !u!1 &1637784075 GameObject: m_ObjectHideFlags: 0 @@ -398,9 +496,9 @@ GameObject: serializedVersion: 5 m_Component: - component: {fileID: 1637784079} - - component: {fileID: 1637784078} - component: {fileID: 1637784077} - component: {fileID: 1637784076} + - component: {fileID: 1637784078} m_Layer: 5 m_Name: Canvas m_TagString: Untagged @@ -453,15 +551,15 @@ Canvas: m_GameObject: {fileID: 1637784075} m_Enabled: 1 serializedVersion: 3 - m_RenderMode: 0 - m_Camera: {fileID: 0} - m_PlaneDistance: 100 + m_RenderMode: 1 + m_Camera: {fileID: 1478468335} + m_PlaneDistance: 68.38 m_PixelPerfect: 0 m_ReceivesEvents: 1 m_OverrideSorting: 0 m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 - m_AdditionalShaderChannelsFlag: 0 + m_AdditionalShaderChannelsFlag: -1 m_SortingLayerID: 0 m_SortingOrder: 0 m_TargetDisplay: 0 @@ -472,11 +570,12 @@ RectTransform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1637784075} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: 0, y: 1, z: 58.379997} + m_LocalScale: {x: 0.12880656, y: 0.12880656, z: 0.12880656} m_Children: - {fileID: 1804801471} - {fileID: 647807671} + - {fileID: 1577534687} m_Father: {fileID: 0} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -511,7 +610,7 @@ RectTransform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1804801470} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: 98.2, y: -47, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 1637784079} @@ -519,7 +618,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 132, y: -349} + m_AnchoredPosition: {x: 98.2, y: -47} m_SizeDelta: {x: 131.19, y: 100} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1804801472 diff --git a/Assets/Test/04_Graphic/UI04_MeshModifierTest.cs b/Assets/Test/04_Graphic/UI04_MeshModifierTest.cs index d1bad84..b679853 100644 --- a/Assets/Test/04_Graphic/UI04_MeshModifierTest.cs +++ b/Assets/Test/04_Graphic/UI04_MeshModifierTest.cs @@ -14,14 +14,19 @@ public class UI04_MeshModifierTest : UnityEngine.EventSystems.UIBehaviour, IMesh public void ModifyMesh(VertexHelper verts)
{
Debug.Log("ModifyMesh");
- vert.position = new Vector3(100, 100);
- vert.color = Color.white;
- verts.AddVert(vert);
- vert.position = new Vector3(120, 100);
- verts.AddVert(vert);
- vert.position = new Vector3(120, 110);
- verts.AddVert(vert);
- verts.AddTriangle(4, 5, 6);
- }
+ //vert.position = new Vector3(100, 100);
+ //vert.color = Color.white;
+ //verts.AddVert(vert);
+ //vert.position = new Vector3(120, 100);
+ //verts.AddVert(vert);
+ //vert.position = new Vector3(120, 110);
+ //verts.AddVert(vert);
+ //verts.AddTriangle(4, 5, 6);
+
+ verts.m_Colors[0] = Color.red;
+ verts.m_Colors[1] = Color.yellow;
+ verts.m_Colors[2] = Color.black;
+ verts.m_Colors[3] = Color.white;
+ }
} diff --git a/Assets/Test/04_Graphic/UI04_Test.mat b/Assets/Test/04_Graphic/UI04_Test.mat new file mode 100644 index 0000000..c4bc7df --- /dev/null +++ b/Assets/Test/04_Graphic/UI04_Test.mat @@ -0,0 +1,95 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: UI04_Test + m_Shader: {fileID: 4800000, guid: 632d9e0968a0a7c419bcb171d6ed6f49, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + 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: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex2: + m_Texture: {fileID: 0} + 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} + - _SubTex: + m_Texture: {fileID: 10300, guid: 0000000000000000f000000000000000, type: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SubTex2: + m_Texture: {fileID: 10300, guid: 0000000000000000f000000000000000, type: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _ColorMask: 15 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _Size: 0.1 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _Stencil: 0 + - _StencilComp: 8 + - _StencilOp: 0 + - _StencilReadMask: 255 + - _StencilWriteMask: 255 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/Test/04_Graphic/UI04_Test.mat.meta b/Assets/Test/04_Graphic/UI04_Test.mat.meta new file mode 100644 index 0000000..600fe05 --- /dev/null +++ b/Assets/Test/04_Graphic/UI04_Test.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c9d794cf597301347a7703a912ffb229 +timeCreated: 1618041498 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Test/04_Graphic/UI04_Test.shader b/Assets/Test/04_Graphic/UI04_Test.shader new file mode 100644 index 0000000..976cd42 --- /dev/null +++ b/Assets/Test/04_Graphic/UI04_Test.shader @@ -0,0 +1,95 @@ +Shader "Custom/UV1Sample" { + Properties + { + [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} + _SubTex("SubTexture", 2D) = "white"{} + _Size("Size", Float) = 0.1 + + _StencilComp ("Stencil Comparison", Float) = 8 + _Stencil ("Stencil ID", Float) = 0 + _StencilOp ("Stencil Operation", Float) = 0 + _StencilWriteMask ("Stencil Write Mask", Float) = 255 + _StencilReadMask ("Stencil Read Mask", Float) = 255 + + _ColorMask ("Color Mask", Float) = 15 + } + + SubShader + { + Tags + { + "Queue"="Transparent" + "IgnoreProjector"="True" + "RenderType"="Transparent" + "PreviewType"="Plane" + "CanUseSpriteAtlas"="True" + } + + Stencil + { + Ref [_Stencil] + Comp [_StencilComp] + Pass [_StencilOp] + ReadMask [_StencilReadMask] + WriteMask [_StencilWriteMask] + } + + Cull Off + Lighting Off + ZWrite Off + ZTest [unity_GUIZTestMode] + Fog { Mode Off } + Blend One Zero + ColorMask [_ColorMask] + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #include "UnityCG.cginc" + + struct appdata_t + { + float4 vertex : POSITION; + float4 color : COLOR; + float2 texcoord : TEXCOORD0; + half2 texcoord1 : TEXCOORD1; // new! + }; + + struct v2f + { + float4 vertex : SV_POSITION; + fixed4 color : COLOR; + half2 uv1 : TEXCOORD0; + half2 uv2 : TEXCOORD1; // new! + }; + + v2f vert(appdata_t IN) + { + v2f OUT; + OUT.vertex = UnityObjectToClipPos(IN.vertex); + OUT.uv1 = IN.texcoord; + OUT.uv2 = IN.texcoord1; // new! +#ifdef UNITY_HALF_TEXEL_OFFSET + OUT.vertex.xy -= (_ScreenParams.zw-1.0); +#endif + OUT.color = IN.color; + return OUT; + } + + sampler2D _MainTex; + sampler2D _SubTex; + float _Size; + + fixed4 frag(v2f IN) : SV_Target + { + half4 color = tex2D(_MainTex, IN.uv1) * IN.color; + color.a = tex2D(_SubTex, IN.uv2 * _Size).a; // new! + clip (color.a - 0.01); + return color; + } + ENDCG + } + } +}
\ No newline at end of file diff --git a/Assets/Test/04_Graphic/UI04_Test.shader.meta b/Assets/Test/04_Graphic/UI04_Test.shader.meta new file mode 100644 index 0000000..22e2cfe --- /dev/null +++ b/Assets/Test/04_Graphic/UI04_Test.shader.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 632d9e0968a0a7c419bcb171d6ed6f49 +timeCreated: 1618041462 +licenseType: Free +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: |