Skip to content

Commit 419c5d0

Browse files
authored
Merge pull request #7 from gam0022/cellular
Cellular
2 parents ae40c85 + 4454e96 commit 419c5d0

File tree

16 files changed

+764
-11
lines changed

16 files changed

+764
-11
lines changed

.editorconfig

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
[*]
2-
charset=utf-8
3-
end_of_line=lf
4-
trim_trailing_whitespace=false
5-
insert_final_newline=false
6-
indent_style=space
7-
indent_size=4
1+
# http://editorconfig.org/
2+
root = true
3+
4+
[*.{cs,shader,cginc}]
5+
charset = utf-8-bom
6+
indent_style = space
7+
indent_size = 4
8+
end_of_line = lf
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
811

912
[{.babelrc,.stylelintrc,jest.config,.eslintrc,*.bowerrc,*.jsb3,*.jsb2,*.json}]
1013
indent_style=space
1114
indent_size=2
12-

.idea/.idea.unity-demoscene/.idea/contentModel.xml

Lines changed: 11 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Demoscene/Projects/2018-07-10-Cellular.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!21 &2100000
4+
Material:
5+
serializedVersion: 6
6+
m_ObjectHideFlags: 0
7+
m_PrefabParentObject: {fileID: 0}
8+
m_PrefabInternal: {fileID: 0}
9+
m_Name: Cellular
10+
m_Shader: {fileID: 4800000, guid: 10f0c2c6f2f254cbc87ddcf5487f178b, type: 3}
11+
m_ShaderKeywords:
12+
m_LightmapFlags: 4
13+
m_EnableInstancingVariants: 0
14+
m_DoubleSidedGI: 0
15+
m_CustomRenderQueue: -1
16+
stringTagMap: {}
17+
disabledShaderPasses: []
18+
m_SavedProperties:
19+
serializedVersion: 3
20+
m_TexEnvs:
21+
- _BumpMap:
22+
m_Texture: {fileID: 0}
23+
m_Scale: {x: 1, y: 1}
24+
m_Offset: {x: 0, y: 0}
25+
- _DetailAlbedoMap:
26+
m_Texture: {fileID: 0}
27+
m_Scale: {x: 1, y: 1}
28+
m_Offset: {x: 0, y: 0}
29+
- _DetailMask:
30+
m_Texture: {fileID: 0}
31+
m_Scale: {x: 1, y: 1}
32+
m_Offset: {x: 0, y: 0}
33+
- _DetailNormalMap:
34+
m_Texture: {fileID: 0}
35+
m_Scale: {x: 1, y: 1}
36+
m_Offset: {x: 0, y: 0}
37+
- _EmissionMap:
38+
m_Texture: {fileID: 0}
39+
m_Scale: {x: 1, y: 1}
40+
m_Offset: {x: 0, y: 0}
41+
- _MainTex:
42+
m_Texture: {fileID: 0}
43+
m_Scale: {x: 1, y: 1}
44+
m_Offset: {x: 0, y: 0}
45+
- _MetallicGlossMap:
46+
m_Texture: {fileID: 0}
47+
m_Scale: {x: 1, y: 1}
48+
m_Offset: {x: 0, y: 0}
49+
- _OcclusionMap:
50+
m_Texture: {fileID: 0}
51+
m_Scale: {x: 1, y: 1}
52+
m_Offset: {x: 0, y: 0}
53+
- _ParallaxMap:
54+
m_Texture: {fileID: 0}
55+
m_Scale: {x: 1, y: 1}
56+
m_Offset: {x: 0, y: 0}
57+
m_Floats:
58+
- _BumpScale: 1
59+
- _Cutoff: 0.5
60+
- _DetailNormalMapScale: 1
61+
- _DstBlend: 0
62+
- _GlossMapScale: 1
63+
- _Glossiness: 0.5
64+
- _GlossyReflections: 1
65+
- _Metallic: 0
66+
- _Mode: 0
67+
- _OcclusionStrength: 1
68+
- _Parallax: 0.02
69+
- _SmoothnessTextureChannel: 0
70+
- _SpecularHighlights: 1
71+
- _SrcBlend: 1
72+
- _UVSec: 0
73+
- _ZWrite: 1
74+
m_Colors:
75+
- _Color: {r: 1, g: 1, b: 1, a: 1}
76+
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

Assets/Demoscene/Projects/2018-07-10-Cellular/Cellular.mat.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
Shader "Unlit/Cellular"
2+
{
3+
Properties
4+
{
5+
_MainTex ("Texture", 2D) = "white" {}
6+
}
7+
SubShader
8+
{
9+
Tags { "RenderType"="Opaque" }
10+
LOD 100
11+
12+
Pass
13+
{
14+
CGPROGRAM
15+
#pragma vertex vert
16+
#pragma fragment frag
17+
// make fog work
18+
#pragma multi_compile_fog
19+
20+
#include "UnityCG.cginc"
21+
#include "Assets/Demoscene/Shaders/Includes/PortingFromGLSL.cginc"
22+
#include "Assets/Demoscene/Shaders/Includes/Noise.cginc"
23+
24+
struct appdata
25+
{
26+
float4 vertex : POSITION;
27+
float2 uv : TEXCOORD0;
28+
};
29+
30+
struct v2f
31+
{
32+
float2 uv : TEXCOORD0;
33+
UNITY_FOG_COORDS(1)
34+
float4 vertex : SV_POSITION;
35+
};
36+
37+
sampler2D _MainTex;
38+
float4 _MainTex_ST;
39+
40+
v2f vert (appdata v)
41+
{
42+
v2f o;
43+
o.vertex = UnityObjectToClipPos(v.vertex);
44+
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
45+
UNITY_TRANSFER_FOG(o,o.vertex);
46+
return o;
47+
}
48+
49+
fixed4 frag (v2f i) : SV_Target
50+
{
51+
// sample the texture
52+
//fixed4 col = tex2D(_MainTex, i.uv);
53+
// apply fog
54+
//UNITY_APPLY_FOG(i.fogCoord, col);
55+
56+
float2 _st = i.uv;
57+
(_st *= 10.0);
58+
float2 _F = cellular(float3(_st, _Time.y));
59+
float _dots = smoothstep(0.050000001, 0.1, _F.x);
60+
float _n = (_F.y - _F.x);
61+
(_n *= _dots);
62+
63+
return fixed4(_n, _n, _n, 1.0);
64+
}
65+
ENDCG
66+
}
67+
}
68+
}

Assets/Demoscene/Projects/2018-07-10-Cellular/Cellular.shader.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)