From dd27a4a7955657ef64053ca6b0c1e0996bee7a3d Mon Sep 17 00:00:00 2001 From: raccoon Date: Fri, 16 May 2025 15:54:39 +0500 Subject: [PATCH] Added new clouds shader --- .../materials/environment/CloudsShader.shader | 61 ++++++++++ .../environment/CloudsShader.shader.meta | 9 ++ .../materials/environment/clouds.mat | 105 ++++++++++++++++++ .../materials/environment/clouds.mat.meta | 8 ++ .../dbl-world/textures/environment/clouds.png | 4 +- 5 files changed, 185 insertions(+), 2 deletions(-) create mode 100644 Assets/dbl-world/materials/environment/CloudsShader.shader create mode 100644 Assets/dbl-world/materials/environment/CloudsShader.shader.meta create mode 100644 Assets/dbl-world/materials/environment/clouds.mat create mode 100644 Assets/dbl-world/materials/environment/clouds.mat.meta diff --git a/Assets/dbl-world/materials/environment/CloudsShader.shader b/Assets/dbl-world/materials/environment/CloudsShader.shader new file mode 100644 index 0000000..ba1751d --- /dev/null +++ b/Assets/dbl-world/materials/environment/CloudsShader.shader @@ -0,0 +1,61 @@ +Shader "Custom/CloudsShader" +{ + Properties + { + _MainTex("Texture", 2D) = "white" {} + _ScrollSpeed("Scroll Speed", Vector) = (0.1, 0.1, 0, 0) + _Color("Tint Color", Color) = (1,1,1,1) + } + + SubShader + { + Tags { "Queue"="Transparent" "RenderType"="Transparent" } + Blend One One // Additive blending + ZWrite Off + Cull Off + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + + sampler2D _MainTex; + float4 _MainTex_ST; + float4 _ScrollSpeed; + float4 _Color; + + struct appdata + { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + }; + + struct v2f + { + float2 uv : TEXCOORD0; + float4 vertex : SV_POSITION; + }; + + v2f vert(appdata v) + { + v2f o; + o.vertex = UnityObjectToClipPos(v.vertex); + + // Scroll UVs over time + float2 scroll = _ScrollSpeed.xy * _Time.y; + o.uv = v.uv + scroll; + + return o; + } + + fixed4 frag(v2f i) : SV_Target + { + fixed4 tex = tex2D(_MainTex, i.uv) * _Color; + return tex; + } + ENDCG + } + } + FallBack "Unlit/Transparent" +} diff --git a/Assets/dbl-world/materials/environment/CloudsShader.shader.meta b/Assets/dbl-world/materials/environment/CloudsShader.shader.meta new file mode 100644 index 0000000..cce2dc8 --- /dev/null +++ b/Assets/dbl-world/materials/environment/CloudsShader.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 5c4398565e9602f42b6421608eb1043b +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/dbl-world/materials/environment/clouds.mat b/Assets/dbl-world/materials/environment/clouds.mat new file mode 100644 index 0000000..711f265 --- /dev/null +++ b/Assets/dbl-world/materials/environment/clouds.mat @@ -0,0 +1,105 @@ +%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: clouds + m_Shader: {fileID: 211, guid: 0000000000000000f000000000000000, type: 0} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _ALPHABLEND_ON + m_InvalidKeywords: [] + m_LightmapFlags: 0 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: + - GRABPASS + 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: 3378b1dfb97786e418b5c14a9676a359, 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: + - _BlendOp: 0 + - _BumpScale: 1 + - _CameraFadingEnabled: 0 + - _CameraFarFadeDistance: 2 + - _CameraNearFadeDistance: 1 + - _ColorMode: 0 + - _Cull: 2 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DistortionBlend: 1 + - _DistortionEnabled: 0 + - _DistortionStrength: 1 + - _DistortionStrengthScaled: 0.1 + - _DstBlend: 1 + - _EmissionEnabled: 0 + - _FlipbookMode: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _LightingEnabled: 0 + - _Metallic: 0 + - _Mode: 4 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SoftParticlesEnabled: 0 + - _SoftParticlesFarFadeDistance: 1 + - _SoftParticlesNearFadeDistance: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 5 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0} + - _Color: {r: 0.0995, g: 0.0995, b: 0.199, a: 0.101960786} + - _ColorAddSubDiff: {r: -1, g: 1, b: 0, a: 0} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0} + m_BuildTextureStacks: [] diff --git a/Assets/dbl-world/materials/environment/clouds.mat.meta b/Assets/dbl-world/materials/environment/clouds.mat.meta new file mode 100644 index 0000000..acba8cb --- /dev/null +++ b/Assets/dbl-world/materials/environment/clouds.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2e5a3e3567de44e439b68b9ae8ffd6fc +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/dbl-world/textures/environment/clouds.png b/Assets/dbl-world/textures/environment/clouds.png index 29f6ec0..fa965fc 100644 --- a/Assets/dbl-world/textures/environment/clouds.png +++ b/Assets/dbl-world/textures/environment/clouds.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:282165fd974b7c9589965dba57afeef0d483c553e19225548e99bca36e6d4e47 -size 165121 +oid sha256:076e84435c721b15ee8c54b7f60fecbc31c5816cb514962121e97dcab9dd317a +size 181151