diff options
author | Jakob Stendahl <jakob.stendahl@outlook.com> | 2017-09-27 20:02:58 +0200 |
---|---|---|
committer | Jakob Stendahl <jakob.stendahl@outlook.com> | 2017-09-27 20:02:58 +0200 |
commit | b9fc71a8460e4d7511421af34b5d9a9fc931c2c5 (patch) | |
tree | e967f40415de97f8396aec5f0cade99556ecf748 | |
parent | aba7a9b0f8765730f3778fb0ce5aad6d98f3bd04 (diff) | |
download | TD-b9fc71a8460e4d7511421af34b5d9a9fc931c2c5.tar.gz TD-b9fc71a8460e4d7511421af34b5d9a9fc931c2c5.zip |
Enda et mislykka forsøk på vatn
4 files changed, 105 insertions, 2 deletions
diff --git a/exampleProject/New Unity Project/Assets/Materials/water.mat b/exampleProject/New Unity Project/Assets/Materials/water.mat index 799161c..5c1c558 100644 --- a/exampleProject/New Unity Project/Assets/Materials/water.mat +++ b/exampleProject/New Unity Project/Assets/Materials/water.mat @@ -83,9 +83,13 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Floats: + - _Amount: 0 + - _Amplitude: 1 - _BumpScale: 1 - _Cutoff: 0.672 + - _CutoutThresh: 0.2 - _DetailNormalMapScale: 1 + - _Distance: 1 - _DstBlend: 10 - _FresnelScale: 0.75 - _GerstnerIntensity: 1 @@ -97,14 +101,21 @@ Material: - _Mode: 3 - _OcclusionStrength: 1 - _Parallax: 0.02 + - _RandomHeight: 0.5 + - _RandomSpeed: 0.5 - _ReflDistort: 0.44 - _RefrDistort: 0.4 - - _Shininess: 0.078125 + - _Shininess: 0.026 - _SmoothnessTextureChannel: 1 - _SpecularHighlights: 1 + - _Speed: 1 - _SrcBlend: 1 + - _Transparency: 0.25 - _UVSec: 0 + - _WaveHeight: 0.5 + - _WaveLength: 0.5 - _WaveScale: 0.0235 + - _WaveSpeed: 1 - _ZWrite: 0 m_Colors: - WaveSpeed: {r: 19, g: 9, b: -16, a: -7} @@ -127,7 +138,8 @@ Material: - _InvFadeParemeter: {r: 0.15, g: 0.15, b: 0.5, a: 1} - _ReflectionColor: {r: 0.54, g: 0.95, b: 0.99, a: 0.5} - _RefrColor: {r: 0.34, g: 0.85, b: 0.92, a: 1} - - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + - _SpecColor: {r: 0, g: 0.7931032, b: 1, a: 1} - _SpecularColor: {r: 0.72, g: 0.72, b: 0.72, a: 1} + - _TintColor: {r: 1, g: 1, b: 1, a: 1} - _WorldLightDir: {r: 0, g: 0.1, b: -0.5, a: 0} - _horizonColor: {r: 0.172, g: 0.463, b: 0.435, a: 0} diff --git a/exampleProject/New Unity Project/Assets/Shaders.meta b/exampleProject/New Unity Project/Assets/Shaders.meta new file mode 100644 index 0000000..b46520b --- /dev/null +++ b/exampleProject/New Unity Project/Assets/Shaders.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: debfdc4e2b1524c709bf58103834bdf7 +folderAsset: yes +timeCreated: 1506534557 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/exampleProject/New Unity Project/Assets/Shaders/WaterShader.shader b/exampleProject/New Unity Project/Assets/Shaders/WaterShader.shader new file mode 100644 index 0000000..31779b2 --- /dev/null +++ b/exampleProject/New Unity Project/Assets/Shaders/WaterShader.shader @@ -0,0 +1,73 @@ +Shader "Unlit/SpecialFX/Cool Hologram" +{ + Properties + { + _MainTex ("Albedo Texture", 2D) = "white" {} + _TintColor("Tint Color", Color) = (1,1,1,1) + _Transparency("Transparency", Range(0.0,0.5)) = 0.25 + _CutoutThresh("Cutout Threshold", Range(0.0,1.0)) = 0.2 + _Distance("Distance", Float) = 1 + _Amplitude("Amplitude", Float) = 1 + _Speed ("Speed", Float) = 1 + _Amount("Amount", Range(0.0,1.0)) = 1 + } + + SubShader + { + Tags {"Queue"="Transparent" "RenderType"="Transparent" } + LOD 100 + + ZWrite Off + Blend SrcAlpha OneMinusSrcAlpha + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + + #include "UnityCG.cginc" + + struct appdata + { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + }; + + struct v2f + { + float2 uv : TEXCOORD0; + float4 vertex : SV_POSITION; + }; + + sampler2D _MainTex; + float4 _MainTex_ST; + float4 _TintColor; + float _Transparency; + float _CutoutThresh; + float _Distance; + float _Amplitude; + float _Speed; + float _Amount; + + v2f vert (appdata v) + { + v2f o; + v.vertex.x += sin(_Time.y * _Speed + v.vertex.y * _Amplitude) * _Distance * _Amount; + o.vertex = UnityObjectToClipPos(v.vertex); + o.uv = TRANSFORM_TEX(v.uv, _MainTex); + return o; + } + + fixed4 frag (v2f i) : SV_Target + { + // sample the texture + fixed4 col = tex2D(_MainTex, i.uv) + _TintColor; + col.a = _Transparency; + clip(col.r - _CutoutThresh); + return col; + } + ENDCG + } + } +}
\ No newline at end of file diff --git a/exampleProject/New Unity Project/Assets/Shaders/WaterShader.shader.meta b/exampleProject/New Unity Project/Assets/Shaders/WaterShader.shader.meta new file mode 100644 index 0000000..bc197cc --- /dev/null +++ b/exampleProject/New Unity Project/Assets/Shaders/WaterShader.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 33d85013378394e68adece6c531226e3 +timeCreated: 1506534575 +licenseType: Free +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: |