feat(dream): 完善梦境门与星空聚焦演出

This commit is contained in:
2026-07-16 17:52:34 +08:00
parent 0039beb5f9
commit ea95111f2a
18 changed files with 951 additions and 54 deletions
@@ -0,0 +1,43 @@
%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: DreamSeaMemory
m_Shader: {fileID: 4800000, guid: a8d86af0aff94e1794fa50e65ac676d5, 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:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _VideoTex:
m_Texture: {fileID: 8400000, guid: d873791053c443c1a79eedd22a687780, type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Contrast: 1
- _DitherStrength: 0.002
- _Levels: 10
- _UseVideo: 0
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _PixelGrid: {r: 360, g: 640, b: 0, a: 0}
m_BuildTextureStacks: []
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e04544198a7d4f88ba592bf1feebbca2
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,40 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!84 &8400000
RenderTexture:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: DreamSeaMemory
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
m_IsAlphaChannelOptional: 0
serializedVersion: 5
m_Width: 720
m_Height: 1280
m_AntiAliasing: 1
m_MipCount: -1
m_DepthStencilFormat: 0
m_ColorFormat: 4
m_MipMap: 0
m_GenerateMips: 0
m_SRGB: 1
m_UseDynamicScale: 0
m_BindMS: 0
m_EnableCompatibleFormat: 1
m_EnableRandomWrite: 0
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 0
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 2
m_VolumeDepth: 1
m_ShadowSamplingMode: 2
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d873791053c443c1a79eedd22a687780
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 8400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,120 @@
Shader "AibisDream/DreamSeaMemory"
{
Properties
{
[PerRendererData] _MainTex ("Poster Texture", 2D) = "white" {}
_VideoTex ("Video Texture", 2D) = "black" {}
_UseVideo ("Use Prepared Video", Range(0, 1)) = 0
_Color ("Tint", Color) = (1,1,1,1)
_PixelGrid ("Virtual Pixel Grid", Vector) = (240,426,0,0)
_Contrast ("Contrast", Range(0.5, 2)) = 1
_Levels ("Luminance Levels", Range(2, 16)) = 10
_DitherStrength ("Dither Strength", Range(0, 0.1)) = 0.002
}
SubShader
{
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
}
Cull Off
Lighting Off
ZWrite Off
Blend SrcAlpha OneMinusSrcAlpha
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 3.0
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 uv : TEXCOORD0;
};
struct v2f
{
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 uv : TEXCOORD0;
};
sampler2D _MainTex;
sampler2D _VideoTex;
fixed4 _Color;
float _UseVideo;
float4 _PixelGrid;
float _Contrast;
float _Levels;
float _DitherStrength;
v2f vert(appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
o.color = v.color * _Color;
return o;
}
float Bayer4x4(float2 pixel)
{
int x = ((int)pixel.x) & 3;
int y = ((int)pixel.y) & 3;
int index = x + y * 4;
if (index == 0) return 0.0 / 16.0;
if (index == 1) return 8.0 / 16.0;
if (index == 2) return 2.0 / 16.0;
if (index == 3) return 10.0 / 16.0;
if (index == 4) return 12.0 / 16.0;
if (index == 5) return 4.0 / 16.0;
if (index == 6) return 14.0 / 16.0;
if (index == 7) return 6.0 / 16.0;
if (index == 8) return 3.0 / 16.0;
if (index == 9) return 11.0 / 16.0;
if (index == 10) return 1.0 / 16.0;
if (index == 11) return 9.0 / 16.0;
if (index == 12) return 15.0 / 16.0;
if (index == 13) return 7.0 / 16.0;
if (index == 14) return 13.0 / 16.0;
return 5.0 / 16.0;
}
fixed4 frag(v2f i) : SV_Target
{
float2 grid = max(_PixelGrid.xy, float2(1.0, 1.0));
float2 pixel = floor(i.uv * grid);
float2 sampleUv = (pixel + 0.5) / grid;
fixed4 poster = tex2D(_MainTex, sampleUv);
fixed4 video = tex2D(_VideoTex, sampleUv);
float3 source = lerp(poster.rgb, video.rgb, saturate(_UseVideo));
float luminance = dot(source, float3(0.299, 0.587, 0.114));
luminance = saturate((luminance - 0.5) * _Contrast + 0.5);
luminance = saturate(luminance + (Bayer4x4(pixel) - 0.5) * _DitherStrength);
float levels = max(2.0, floor(_Levels + 0.5));
luminance = floor(luminance * (levels - 1.0) + 0.5) / (levels - 1.0);
return fixed4(luminance.xxx * i.color.rgb, poster.a * i.color.a);
}
ENDCG
}
}
Fallback "Sprites/Default"
}
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: a8d86af0aff94e1794fa50e65ac676d5
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant: