add weather and time

This commit is contained in:
XuGaoFeng
2026-05-09 09:10:52 +08:00
parent 48e0dea5e1
commit 0ca1b49fa7
639 changed files with 121558 additions and 102 deletions

View File

@@ -0,0 +1,256 @@
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
Shader "Hidden/EnviroCubemapBlur" {
Properties {
_MainTex ("Main", CUBE) = "" {}
_Texel ("Texel", Float) = 0.0078125
_Level ("Level", Float) = 0.
}
CGINCLUDE
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "HLSLSupport.cginc"
struct v2f {
half4 pos : SV_POSITION;
half4 uvw : TEXCOORD0;
};
v2f vert(appdata_base v)
{
v2f o;
o.pos = UnityObjectToClipPos(v.vertex);
o.uvw = v.texcoord;
return o;
}
UNITY_DECLARE_TEXCUBE(_MainTex);
half _Level; // Workaround for Metal driver bug: please keep this uniform aligned to 4 bytes (case 899153)
half _Texel;
#define zero half3(0., 0., 0.)
#define one half3(1., 1., 1.)
#define two half3(2., 2., 2.)
half3 fold(half3 st, half3 face)
{
half3 c = min(max(st, -one), one);
half3 f = abs(st - c);
half m = max(max(f.x, f.y), f.z);
return c - m*face;
}
half3 gauss(half d)
{
// compute coefficients for positions 0., 1.*d/.5 and 2.*d/.5
// this assumes a sigma of .5 for a density of 1.
half3 v = half3(0., 1.*d, 2.*d);
return exp(-v*v);
}
half4 frag(v2f i) : SV_Target
{
#if (SHADER_TARGET < 30)
return UNITY_SAMPLE_TEXCUBE_LOD(_MainTex, i.uvw.xyz, _Level);
#else
half3 st;
half3 face = abs(i.uvw.xyz)==one ? i.uvw.xyz : zero;
half3 u = face.zxy*_Texel;
half3 v = face.yzx*_Texel;
half4 s = float4(i.uvw.xyz*(one - abs(face)), 0.);
// modulate coefficients based on position (texel density on projected sphere)
half w = 1. / sqrt(1. + dot(s.xyz, s.xyz));
half3 C = gauss(w*w*w);
half4 s1, s2, s3;
half3 c;
s = 0.;
w = 0.;
// first row
c = C.xyz*C.zzz;
st = i.uvw.xyz - 2.*u - 2.*v;
st = fold(st, face);
s3 = UNITY_SAMPLE_TEXCUBE_LOD(_MainTex, st, _Level);
st = i.uvw.xyz - 1.*u - 2.*v;
st = fold(st, face);
s2 = UNITY_SAMPLE_TEXCUBE_LOD(_MainTex, st, _Level);
st = i.uvw.xyz - 2.*v;
st = fold(st, face);
s1 = UNITY_SAMPLE_TEXCUBE_LOD(_MainTex, st, _Level);
st = i.uvw.xyz + 1.*u - 2.*v;
st = fold(st, face);
s2 += UNITY_SAMPLE_TEXCUBE_LOD(_MainTex, st, _Level);
st = i.uvw.xyz + 2.*u - 2.*v;
st = fold(st, face);
s3 += UNITY_SAMPLE_TEXCUBE_LOD(_MainTex, st, _Level);
w += c.x + dot(c.yz, two.yz);
s1 = c.x*s1 + c.y*s2;
s += c.z*s3;
s += s1;
// second row
c = C.xyz*C.yyy;
st = i.uvw.xyz + 2.*u - 1.*v;
st = fold(st, face);
s3 = UNITY_SAMPLE_TEXCUBE_LOD(_MainTex, st, _Level);
st = i.uvw.xyz + 1.*u - 1.*v;
st = fold(st, face);
s2 = UNITY_SAMPLE_TEXCUBE_LOD(_MainTex, st, _Level);
st = i.uvw.xyz - 1.*v;
st = fold(st, face);
s1 = UNITY_SAMPLE_TEXCUBE_LOD(_MainTex, st, _Level);
st = i.uvw.xyz - 1.*u - 1.*v;
st = fold(st, face);
s2 += UNITY_SAMPLE_TEXCUBE_LOD(_MainTex, st, _Level);
st = i.uvw.xyz - 2.*u - 1.*v;
st = fold(st, face);
s3 += UNITY_SAMPLE_TEXCUBE_LOD(_MainTex, st, _Level);
w += c.x + dot(c.yz, two.yz);
s1 = c.x*s1 + c.y*s2;
s += c.z*s3;
s += s1;
// third row
c = C.xyz*C.xxx;
st = i.uvw.xyz - 2.*u;
st = fold(st, face);
s3 = UNITY_SAMPLE_TEXCUBE_LOD(_MainTex, st, _Level);
st = i.uvw.xyz - 1.*u;
st = fold(st, face);
s2 = UNITY_SAMPLE_TEXCUBE_LOD(_MainTex, st, _Level);
st = i.uvw.xyz;
s1 = UNITY_SAMPLE_TEXCUBE_LOD(_MainTex, st, _Level);
st = i.uvw.xyz + 1.*u;
s2 += UNITY_SAMPLE_TEXCUBE_LOD(_MainTex, st, _Level);
st = i.uvw.xyz + 2.*u;
st = fold(st, face);
s3 += UNITY_SAMPLE_TEXCUBE_LOD(_MainTex, st, _Level);
w += c.x + dot(c.yz, two.yz);
s1 = c.x*s1 + c.y*s2;
s += c.z*s3;
s += s1;
// fourth row
c = C.xyz*C.yyy;
st = i.uvw.xyz + 2.*u + 1.*v;
st = fold(st, face);
s3 = UNITY_SAMPLE_TEXCUBE_LOD(_MainTex, st, _Level);
st = i.uvw.xyz + 1.*u + 1.*v;
st = fold(st, face);
s2 = UNITY_SAMPLE_TEXCUBE_LOD(_MainTex, st, _Level);
st = i.uvw.xyz + 1.*v;
st = fold(st, face);
s1 = UNITY_SAMPLE_TEXCUBE_LOD(_MainTex, st, _Level);
st = i.uvw.xyz - 1.*u + 1.*v;
st = fold(st, face);
s2 += UNITY_SAMPLE_TEXCUBE_LOD(_MainTex, st, _Level);
st = i.uvw.xyz - 2.*u + 1.*v;
st = fold(st, face);
s3 += UNITY_SAMPLE_TEXCUBE_LOD(_MainTex, st, _Level);
w += c.x + dot(c.yz, two.yz);
s1 = c.x*s1 + c.y*s2;
s += c.z*s3;
s += s1;
// fifth row
c = C.xyz*C.zzz;
st = i.uvw.xyz - 2.*u + 2.*v;
st = fold(st, face);
s3 = UNITY_SAMPLE_TEXCUBE_LOD(_MainTex, st, _Level);
st = i.uvw.xyz - 1.*u + 2.*v;
st = fold(st, face);
s2 = UNITY_SAMPLE_TEXCUBE_LOD(_MainTex, st, _Level);
st = i.uvw.xyz + 2.*v;
st = fold(st, face);
s1 = UNITY_SAMPLE_TEXCUBE_LOD(_MainTex, st, _Level);
st = i.uvw.xyz + 1.*u + 2.*v;
st = fold(st, face);
s2 += UNITY_SAMPLE_TEXCUBE_LOD(_MainTex, st, _Level);
st = i.uvw.xyz + 2.*u + 2.*v;
st = fold(st, face);
s3 += UNITY_SAMPLE_TEXCUBE_LOD(_MainTex, st, _Level);
w += c.x + dot(c.yz, two.yz);
s1 = c.x*s1 + c.y*s2;
s += c.z*s3;
s += s1;
//return half4(C.zzz, 1.);
return s/w;
#endif
}
ENDCG
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
Pass {
ZTest Always
Blend Off
AlphaTest off
Cull Off
ZWrite Off
Fog { Mode off }
CGPROGRAM
#pragma target 3.0
ENDCG
}
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
Pass {
ZTest Always
Blend Off
AlphaTest off
Cull Off
ZWrite Off
Fog { Mode off }
CGPROGRAM
#pragma target 2.0
ENDCG
}
}
}

View File

@@ -0,0 +1,16 @@
fileFormatVersion: 2
guid: a8dc759a3008f9e4d93036801febc85b
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 236601
packageName: Enviro 3 - Sky and Weather
packageVersion: 3.1.2
assetPath: Assets/Enviro 3 - Sky and Weather/Resources/Shader/ReflectionProbe/EnviroCubemapBlur.shader
uploadId: 660896

View File

@@ -0,0 +1,55 @@
Shader "Hidden/Enviro/ReflectionProbe"
{
Properties
{
_MainTex("Base (RGB)", 2D) = "white" {}
}
SubShader
{
Pass
{
ZTest Always
Cull Off
ZWrite Off
Blend Off
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
uniform sampler2D _MainTex;
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 pos : SV_POSITION;
};
v2f vert(appdata v)
{
v2f o;
o.pos = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
o.uv.x = 1 - o.uv.x;
return o;
}
float4 frag(v2f IN) : COLOR
{
return tex2D(_MainTex, IN.uv);
}
ENDCG
}
}
}

View File

@@ -0,0 +1,17 @@
fileFormatVersion: 2
guid: 707d8faf84657f04a9c425ceb1e54b2e
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 236601
packageName: Enviro 3 - Sky and Weather
packageVersion: 3.1.2
assetPath: Assets/Enviro 3 - Sky and Weather/Resources/Shader/ReflectionProbe/EnviroReflectionProbe.shader
uploadId: 660896