Skip to content

Commit 6a75155

Browse files
committed
refactor property names
1 parent 513974e commit 6a75155

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

Assets/Demoscene/Projects/2018-07-12-Lava/Lava.mat

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ Material:
2323
m_Scale: {x: 1, y: 1}
2424
m_Offset: {x: 0, y: 0}
2525
m_Floats:
26+
- _CellularPower: 0.038
2627
- _FlowIntensity: 0.32
2728
- _FlowSpeed: 0.5
28-
- _Loop: 99.2
29+
- _FlowThreshold: 1.267
30+
- _Loop: 50
2931
- _MinDistance: 0.01
30-
- _Power: 0.038
3132
- _ShadowExtraBias: 0.802
3233
- _ShadowLoop: 10
3334
- _ShadowMinDistance: 0.01
34-
- _Threshold: 1.267
3535
m_Colors:
3636
- _Diffuse: {r: 0.9528302, g: 0.004494493, b: 0.004494493, a: 1}
3737
- _Emission: {r: 0, g: 0, b: 0, a: 0}
38-
- _Lava: {r: 1, g: 0.24644177, b: 0, a: 1}
38+
- _LavaEmmisiveHigh: {r: 1, g: 0.24644177, b: 0, a: 1}
3939
- _Specular: {r: 0, g: 0, b: 0, a: 0}

Assets/Demoscene/Projects/2018-07-12-Lava/Lava.shader

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ Properties
1616
_ShadowExtraBias("Shadow Extra Bias", Range(0.0, 1.0)) = 0.01
1717

1818
// @block Properties
19-
_Power("Power", Range(0.0, 1.0)) = 0.5
20-
[HDR] _Lava("Lava", Color) = (1.0, 0.0, 0.0, 1.0)
19+
_CellularPower("Cellular Power", Range(0.0, 1.0)) = 0.5
20+
[HDR] _LavaEmmisiveHigh("Lava Emmisive High", Color) = (1.0, 0.0, 0.0, 1.0)
2121
_Noise("Noise", 2D) = "gray" {}
22-
_Threshold("Threshold", Range(1.0, 2.0)) = 0.5
22+
_FlowThreshold("Flow Threshold", Range(1.0, 2.0)) = 0.5
2323
_FlowIntensity("Flow Intensity", Range(0.0, 1.0)) = 0.2
2424
_FlowSpeed("Flow Speed", Range(0.0, 5.0)) = 0.2
2525
// @endblock
@@ -51,28 +51,28 @@ CGINCLUDE
5151
#include "Assets/Demoscene/Shaders/Includes/Common.cginc"
5252
#include "Assets/Demoscene/Shaders/Includes/Noise.cginc"
5353

54-
float _Power;
54+
float _CellularPower;
5555

5656
inline float DistanceFunction(float3 pos)
5757
{
5858
float2 c = cellular(float2(pos.xz));
59-
float h = pow(c.y - c.x, _Power);
59+
float h = pow(c.y - c.x, _CellularPower);
6060

6161
float2 c2 = cellular(float2(3.0 * pos.xz));
62-
h += 0.5 * pow((c2.y - c2.x), _Power);
62+
h += 0.5 * pow((c2.y - c2.x), _CellularPower);
6363

6464
float2 c3 = cellular(float2(20.0 * pos.xz));
65-
h += 0.05 * pow((c3.y - c3.x), _Power);
65+
h += 0.05 * pow((c3.y - c3.x), _CellularPower);
6666

6767
h += 0.001 * snoise(50.0 * pos.xz);
6868
return pos.y - h;
6969
}
7070
// @endblock
7171

7272
// @block PostEffect
73-
float4 _Lava;
73+
float4 _LavaEmmisiveHigh;
7474
sampler2D _Noise;
75-
float _Threshold;
75+
float _FlowThreshold;
7676
float _FlowIntensity;
7777
float _FlowSpeed;
7878

@@ -130,8 +130,8 @@ float lavaFlow(in vec2 p)
130130

131131
inline void PostEffect(RaymarchInfo ray, inout PostEffectOutput o)
132132
{
133-
o.emission = step(ray.endPos.y, _Threshold + _FlowIntensity * lavaFlow(ray.endPos.xz)) * _Lava;
134-
// o.emission = lavaFlow(ray.endPos.xz) * _Lava;
133+
o.emission = step(ray.endPos.y, _FlowThreshold + _FlowIntensity * lavaFlow(ray.endPos.xz)) * _LavaEmmisiveHigh;
134+
// o.emission = lavaFlow(ray.endPos.xz) * _LavaEmmisiveHigh;
135135
}
136136
// @endblock
137137

0 commit comments

Comments
 (0)