Commit 317a0dfe authored by xujr's avatar xujr

场景和UI更新

parent e7cde521
......@@ -7,7 +7,7 @@ TextureImporter:
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
......@@ -51,7 +51,7 @@ TextureImporter:
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureType: 1
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
......
fileFormatVersion: 2
guid: 61a2a54922e8f3c47bc29466c511d738
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
......@@ -8,11 +8,11 @@ Material:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Line
m_Shader: {fileID: 4800000, guid: 5ee5bcc5ce7778d44b7848c206e134d4, type: 3}
m_Shader: {fileID: 4800000, guid: 14d4c79e32412154c9ab93d11f664065, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_DoubleSidedGI: 1
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
......@@ -72,8 +72,9 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _AllPower: 1
- _AlphaPower: 4
- _AllPower: 5
- _AlphaPower: 7
- _AlphaScale: 1
- _BumpScale: 1
- _Cutoff: 0.5
- _DepthDistance: 0.5
......@@ -89,7 +90,7 @@ Material:
- _GlossMapScale: 1
- _Glossiness: 0
- _GlossyReflections: 1
- _InnerColorPower: 0.5
- _InnerColorPower: 1
- _IntersectionThreshold: 0.1
- _LightWidth: 1
- _Metallic: 0
......@@ -101,7 +102,7 @@ Material:
- _RimIntensity: 43
- _RimMax: 1
- _RimMin: 0.5
- _RimPower: 1.2
- _RimPower: 0
- _ScrollSpeedU: 2
- _ScrollSpeedV: 0
- _SmoothnessTextureChannel: 0
......@@ -120,15 +121,15 @@ Material:
- __dummy__: 0
m_Colors:
- _Color: {r: 0.0039215684, g: 1, b: 0.854803, a: 1}
- _ColorTint: {r: 1, g: 0, b: 1, a: 0.3}
- _ColorTint: {r: 1, g: 0.7653513, b: 0, a: 0.3}
- _DepthColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _FoamColor: {r: 0.9, g: 0.9, b: 0.9, a: 1}
- _FoamSpeed: {r: 2, g: 2, b: 2, a: 2}
- _HColor: {r: 0.6, g: 0.6, b: 0.6, a: 1}
- _InnerColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5}
- _InnerColor: {r: 1, g: 0.83137256, b: 0, a: 0.5}
- _MainColor: {r: 1, g: 0, b: 0.7330103, a: 1}
- _MoveLightColor: {r: 0, g: 1, b: 0.8245816, a: 1}
- _OutLineColor: {r: 0.990566, g: 0.032707386, b: 0.032707386, a: 1}
- _RimColor: {r: 0.990566, g: 0.032707386, b: 0.8717001, a: 1}
- _RimColor: {r: 1, g: 0.83183765, b: 0, a: 1}
- _SColor: {r: 0.3, g: 0.3, b: 0.3, a: 1}
......@@ -62,7 +62,7 @@ Material:
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _FillAmount: 0.41
- _FillAmount: -1
- _FoamLineWidth: 0.0051
- _GlossMapScale: 1
- _Glossiness: 0.5
......@@ -73,7 +73,7 @@ Material:
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _Rim: 0
- _Rim: 0.046
- _RimPower: 0.8
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
......
......@@ -74,5 +74,5 @@ Material:
- _UVSec: 0
- _ZWrite: 0
m_Colors:
- _Color: {r: 0.19241722, g: 0.77592915, b: 0.8679245, a: 0.77254903}
- _Color: {r: 0.19215685, g: 0.7258201, b: 0.8666667, a: 0.77254903}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
......@@ -74,5 +74,5 @@ Material:
- _UVSec: 0
- _ZWrite: 0
m_Colors:
- _Color: {r: 0.2569865, g: 0.8640126, b: 0.990566, a: 0.34117648}
- _Color: {r: 0.2569865, g: 0.8640126, b: 0.990566, a: 0.50980395}
- _EmissionColor: {r: 0.15908688, g: 0.52368385, b: 0.6132076, a: 1}
Shader "Custom/LightShader"
{
Properties {
_RimColor ("Rim Color", Color) = (1,1,1,0.5)
_InnerColor ("Inner Color", Color) = (1,1,1,0.5)
_InnerColorPower ("Inner Color Power", Range(0.0,1.0)) = 0.5
_RimPower ("Rim Power", Range(0.0,5.0)) = 2.5
_AlphaPower ("Alpha Rim Power", Range(0.0,8.0)) = 4.0
_AllPower ("All Power", Range(0.0, 10.0)) = 1.0
}
SubShader {
Tags { "Queue" = "Transparent" }
CGPROGRAM
#pragma surface surf Lambert alpha
struct Input {
float3 viewDir;
INTERNAL_DATA
};
float4 _RimColor;
float _RimPower;
float _AlphaPower;
//float _AlphaMin;
float _InnerColorPower;
float _AllPower;
float4 _InnerColor;
void surf (Input IN, inout SurfaceOutput o) {
half rim = 1.0 - saturate(dot (normalize(IN.viewDir), o.Normal));
o.Emission = _RimColor.rgb * pow (rim, _RimPower)*_AllPower+(_InnerColor.rgb*2*_InnerColorPower);
o.Alpha = (pow (rim, _AlphaPower))*_AllPower;
}
ENDCG
}
Fallback "VertexLit"
}
\ No newline at end of file
fileFormatVersion: 2
guid: faae91d1a31856b43b942777e9d8f899
PrefabImporter:
guid: 14d4c79e32412154c9ab93d11f664065
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
// Upgrade NOTE: replaced '_World2Object' with 'unity_WorldToObject'
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
// 星球Shader
// 两个Pass
// 1 做星球表面 Diff/Norm/Spec/Rim
// 2 做星球外发光环, Rim + Transparent
Shader "TAShaders/Planet"
{
Properties
{
_Color ("Color", Color) = (1, 1, 1, 1)
_MainTex ("Main Tex", 2D) = "grey" {}
// Specular
_Specular ("Specular", Color) = (1, 1, 1, 1)
_Gloss ("Gloss", Range(0.1, 256)) = 20
// Normal
_BumpMap ("Normal Map", 2D) = "bump" {}
//_BumpScale ("Bump Scale", Float) = 1.0
// Rim
_RimColor ("RimColor", Color) = (1, 1, 1, 1)
_RimPower ("RimPower", Range(0, 15)) = 10
_RimMulitpiler ("RimMultipiler", Range(0, 15)) = 10
// Extrusion
_Extrusion ("Extrusion", Range(0, 10)) = 1
// Panner
_PannerXSpeed ("PanX Speed", Float) = 0
}
SubShader
{
// 第1个Pass,做基本的Diff/Norm/Spec/ + Rim
Pass
{
Cull Back
Tags { "RenderType"="Opaque" "LightMode"="ForwardBase" }
CGPROGRAM
#pragma multi_compile_fwdbase
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "Lighting.cginc"
//#include "AutoLight.cginc"
// Fog
//#pragma multi_compile_fog
fixed4 _Color;
sampler2D _MainTex;
float4 _MainTex_ST;
// Specular
fixed4 _Specular;
float _Gloss;
// Normal
sampler2D _BumpMap;
// Rim
fixed4 _RimColor;
fixed _RimPower;
fixed _RimMulitpiler;
// Extrusion
float _Extrusion;
// UVAnimSpeed
float _PannerXSpeed;
struct appdata
{
float4 vertex : POSITION;
float3 normal : NORMAL;
float4 tangent : TANGENT;
float4 texcoord : TEXCOORD0;
};
struct v2f
{
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
// FogCoord
UNITY_FOG_COORDS(3)
// Normal
float3 lightDir: TEXCOORD1;
float3 viewDir : TEXCOORD2;
};
v2f vert(appdata v)
{
v2f o;
// 做UV动画?,也许另写脚本旋转球体比较理智,UV动画会像是一张皮在球体上滑动
v.texcoord.x += _Time * _PannerXSpeed;
// 投射空间的顶点位置
o.pos = UnityObjectToClipPos(v.vertex);
o.uv = v.texcoord.xy * _MainTex_ST.xy + _MainTex_ST.zw;
// Fog
//UNITY_TRANSFER_FOG(o,o.pos);
TANGENT_SPACE_ROTATION;
// 视图向量与灯光向量转到 切线空间
o.lightDir = mul(rotation, ObjSpaceLightDir(v.vertex)).xyz;
o.viewDir = mul(rotation, ObjSpaceViewDir(v.vertex)).xyz;
return o;
}
fixed4 frag(v2f i) : SV_Target
{
// 在切线空间计算法线
fixed3 tangentLightDir = normalize(i.lightDir);
fixed3 tangentViewDir = normalize(i.viewDir);
fixed4 packedNormal = tex2D(_BumpMap, i.uv);
fixed3 tangentNormal;
tangentNormal = UnpackNormal(packedNormal);
tangentNormal.z = sqrt(1.0 - saturate(dot(tangentNormal.xy, tangentNormal.xy))); // Diffuse贴图采样
fixed3 diff = tex2D(_MainTex, i.uv).rgb * _Color.rgb;
// Lambert
fixed LM_Lambert = saturate(dot(tangentNormal, tangentLightDir));
// Ambient颜色
fixed3 ambient = UNITY_LIGHTMODEL_AMBIENT.xyz;
// Rim
fixed rim = saturate(dot(tangentNormal, tangentViewDir));
fixed rimPow = (15 - _RimPower);
// 取了RimPower最大值反向
fixed rimMulti = _RimMulitpiler * 0.2;
//
fixed3 rimColor = pow((1- rim),rimPow) * _RimColor * rimMulti;
// Specular
fixed3 halfDir = normalize(tangentLightDir + tangentViewDir);
fixed3 specular = _LightColor0.rgb * _Specular.rgb * pow(saturate(dot(tangentNormal, halfDir)), _Gloss);
// Final颜色混合
fixed3 final = (_LightColor0.rgb * diff * LM_Lambert) + (diff * ambient) + specular + rimColor;
fixed4 finalColor = fixed4(final,1.0);
// Fog
//UNITY_APPLY_FOG(i.fogCoord, finalColor);
return fixed4(finalColor);
}
ENDCG
}
// 第2个Pass,用作外轮廓发光
pass
{
// 使用Transparent排序,不使用ZWrite,
Tags { "LightMode" = "Always" "Queue"="Transparent" "IgnoreProjector"="True"}
ZWrite Off
Lighting Off
// 剔除前面的面
Cull Front
// 使用 Soft Additive混合
Blend OneMinusDstColor One
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
fixed _Color;
fixed4 _RimColor;
fixed _RimPower;
fixed _RimMulitpiler;
fixed _Extrusion;
struct appdata
{
float4 vertex : POSITION;
float3 normal : NORMAL;
float4 texcoord : TEXCOORD0;
};
struct v2f
{
float4 pos : SV_POSITION;
float2 uvMatCap : TEXCOORD0;
float3 worldNormal : TEXCOORD1;
float3 worldPos : TEXCOORD2;
};
v2f vert (appdata v)
{
// 将顶点沿着法线方向向外推
v.vertex.xyz += v.normal * (_RimPower * 0.01) * _Extrusion;
v2f o;
o.pos = UnityObjectToClipPos (v.vertex);
o.worldNormal = mul(v.normal, (float3x3)unity_WorldToObject);
o.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
return o;
}
float4 frag (v2f i) : COLOR
{
// N 世界空间法线
fixed3 worldNormal = normalize(i.worldNormal);
// V 视图向量
fixed3 viewDir = normalize(_WorldSpaceCameraPos.xyz - i.worldPos.xyz);
// Rim
fixed rimMulti = _RimMulitpiler * 0.001f;
// 这里对Rim倍乘做了调整,否则Rim会显得非常亮
fixed fresnel = 1 - dot(worldNormal, viewDir);
fixed3 fresnelColor = pow(fresnel,_RimPower) * _RimColor.rgb * rimMulti;
// Final
fixed3 final = fresnelColor;
return fixed4(final,1.0);
}
ENDCG
}
}
FallBack "Specular"
}
\ No newline at end of file
fileFormatVersion: 2
guid: ec3049e09a22c774d869d6c191cd3e63
PrefabImporter:
guid: 41463d862a693074088a878fb80ab815
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment