Skip to content

Commit ed94be0

Browse files
committed
Countour map from flow map
1 parent 25d57f2 commit ed94be0

File tree

10 files changed

+49
-50
lines changed

10 files changed

+49
-50
lines changed

Bento/Bento.vcxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<PropertyGroup Label="Globals">
2222
<ProjectGuid>{96545C22-E144-432C-A5D3-F8B684D35159}</ProjectGuid>
2323
<RootNamespace>Core</RootNamespace>
24-
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
24+
<WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
2525
</PropertyGroup>
2626
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2727
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">

GLEW/GLEW.vcxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<SccProjectName />
2323
<SccLocalPath />
2424
<ProjectGuid>{664E6F0D-6784-4760-9565-D54F8EB1EDF4}</ProjectGuid>
25-
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
25+
<WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
2626
<ProjectName>GLEW</ProjectName>
2727
</PropertyGroup>
2828
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

GLFW/GLFW.vcxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<PropertyGroup Label="Globals">
6161
<ProjectGuid>{6B3099E2-E607-46D3-BCF7-0138E456DE9B}</ProjectGuid>
6262
<RootNamespace>GLFW</RootNamespace>
63-
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
63+
<WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
6464
</PropertyGroup>
6565
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
6666
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">

GodBox/GodBox.vcxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
<ProjectGuid>{B7156BC7-BE9A-48A0-90A0-92B8003B402B}</ProjectGuid>
8181
<Keyword>Win32Proj</Keyword>
8282
<RootNamespace>GodBox</RootNamespace>
83-
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
83+
<WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
8484
<ProjectName>GodBox</ProjectName>
8585
</PropertyGroup>
8686
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

GodBox/src/processes/TerrainSimulationProcess.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ void TerrainSimulationProcess::AddUIElements()
129129
ImGui::SliderFloat("VelocityScalar##molten", &m_moltenVelocityScalar, 0.0f, 4.0f);
130130
ImGui::SliderFloat("TempChangeSpeed", &m_tempChangeSpeed, 0.0f, 0.01f, "%.5f");
131131
ImGui::SliderFloat("Melt/Condense Speed", &m_meltCondenseSpeed, 0.0f, 0.05f, "%.4f");
132-
ImGui::SliderFloat("SmudgeChangeRate", &m_smudgeChangeRate, 0.0f, 0.1f, "%.5f");
132+
ImGui::SliderFloat("SmudgeChangeRate", &m_smudgeChangeRate, 0.0f, 1.0f, "%.5f");
133133
ImGui::Spacing();
134134

135135
ImGui::Spacing();

IMGUI/IMGUI.vcxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<ProjectGuid>{74363F64-4422-455B-A5AC-71CBA6406779}</ProjectGuid>
3636
<Keyword>Win32Proj</Keyword>
3737
<RootNamespace>IMGUI</RootNamespace>
38-
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
38+
<WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
3939
</PropertyGroup>
4040
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
4141
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">

Resources/Resources.vcxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<PropertyGroup Label="Globals">
3434
<ProjectGuid>{C7F5A34E-8939-4DB1-BFCD-670C7F068A70}</ProjectGuid>
3535
<Keyword>MakeFileProj</Keyword>
36-
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
36+
<WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
3737
</PropertyGroup>
3838
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
3939
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">

Run/defaults.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
},
66
"Renderer": {
77
"m_bloomPower": 1.10500001907349,
8-
"m_bloomStrength": 52.7970008850098
8+
"m_bloomStrength": 0.0
99
},
1010
"SmokeParticleMaterial": {
1111
"baseColor": {
@@ -292,13 +292,13 @@
292292
"moltenViscosity": 1.0,
293293
"moltenViscosityMax": 0.5,
294294
"moltenViscosityMin": 0.352000027894974,
295-
"mouseHeatStrength": 0.0,
296-
"mouseRadius": 0.0970000028610229,
295+
"mouseHeatStrength": 0.829999983310699,
296+
"mouseRadius": 0.308000028133392,
297297
"mouseVolumeStrength": 0.0042200000025332,
298298
"rainRate": 9.99999974737875e-06,
299299
"rockDiffuseStrength": 0.00499999988824129,
300300
"rockMeltingPoint": 0.0,
301-
"smudgeChangeRate": 0.0731199979782104,
301+
"smudgeChangeRate": 0.0999999940395355,
302302
"tempChangeSpeed": 6.99999945936725e-05,
303303
"textureCycleSpeed": 0.0,
304304
"textureScrollSpeed": 0.13400000333786,

Run/shaders/Terrain.frag

+35
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ in Varying
1717
float in_shadowing;
1818
vec2 in_scaledUV;
1919
vec4 in_heightData;
20+
vec4 in_smudgeData;
2021
};
2122

2223
// Uniforms
@@ -307,4 +308,38 @@ void main(void)
307308
out_worldNormal = vec4(normal, 0.0);
308309
out_viewPosition = in_viewPosition;
309310
out_forward = vec4( outColor, max( max(moltenColor.r, moltenColor.g), moltenColor.b) * 100.0);
311+
312+
{
313+
vec2 smudgeRay = normalize( vec2(in_smudgeData.y, -in_smudgeData.x) * 10.0 );
314+
315+
vec2 E = in_uv;
316+
vec2 L = in_uv + smudgeRay * 40;
317+
vec2 C = vec2(0.5);
318+
float r = 20;
319+
320+
vec2 d = L-E;
321+
vec2 f = E-C;
322+
323+
float a = dot(d,d);
324+
float b = 2.0 * dot(f, d);
325+
float c = dot(f, f) - r*r;
326+
float discriminant = b*b-4*a*c;
327+
328+
discriminant = sqrt(discriminant);
329+
330+
float t1 = (-b - discriminant) / (2.0*a);
331+
float t2 = (-b + discriminant) / (2.0*a);
332+
333+
vec2 isect = E + t2 * d;
334+
335+
vec2 delta = isect - E;
336+
float deltaLength = length(delta);
337+
338+
float value = (sin(deltaLength*200.0) + 1.0) * 0.5;
339+
340+
out_forward.rgb *= value;
341+
342+
//out_forward = vec4( (in_smudgeData.xy * 10.0 + 1.0) * 0.5, 0.0, 1.0 );
343+
//out_forward = pow( vec4( (in_smudgeData.xy * 10.0 + 1.0) * 0.5, value, 1.0 ), vec4(2.2) );
344+
}
310345
}

Run/shaders/Terrain.vert

+3-39
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ out Varying
6767
float out_shadowing;
6868
vec2 out_scaledUV;
6969
vec4 out_heightData;
70+
vec4 out_smudgeData;
7071
};
7172

7273
////////////////////////////////////////////////////////////////
@@ -105,51 +106,14 @@ void main(void)
105106
float steamStrength = smudgeDataC.z;
106107

107108
{
108-
vec2 outScaledUV = vec2(0.0);;
109+
vec2 outScaledUV = vec2(0.0);
110+
out_smudgeData = texture(s_smudgeData, in_uv);
109111
vec2 smudgeVec = textureLod( s_smudgeData, in_uv, u_smudgeSampleMip ).xy;
110112
vec2 smudgeDir = normalize(smudgeVec);
111113

112114
vec2 uvOffset = smudgeVec * u_smudgeSampleOffset;
113-
//vec2 smudgeSampleVec = textureLod( s_smudgeData, in_uv + uvOffset, u_smudgeSampleMip ).xy;
114-
//vec2 smudgeSampleDir = normalize( smudgeSampleVec );
115-
//float dp = dot( smudgeSampleDir, smudgeDir );
116-
117115
outScaledUV -= uvOffset;
118116

119-
//outScaledUV -= in_uv + uvOffset;
120-
//outScaledUV *= 1.0 + u_smudgeUVStrength * dp;
121-
//outScaledUV += in_uv + uvOffset;
122-
123-
/*
124-
float mipLevel = u_smudgeSampleMip + 1.0;
125-
float offset = u_smudgeSampleOffset;
126-
float strength = u_smudgeUVStrength;
127-
for ( int i = 0; i < 4; i++ )
128-
{
129-
vec2 offsetH = vec2(offset, 0.0);
130-
vec2 offsetV = vec2(0.0, offset);
131-
132-
vec2 sumdgeSampleVecL = textureLod( s_smudgeData, in_uv - offsetH, mipLevel ).xy;
133-
vec2 sumdgeSampleVecR = textureLod( s_smudgeData, in_uv + offsetH, mipLevel ).xy;
134-
vec2 sumdgeSampleVecU = textureLod( s_smudgeData, in_uv - offsetV, mipLevel ).xy;
135-
vec2 sumdgeSampleVecD = textureLod( s_smudgeData, in_uv + offsetV, mipLevel ).xy;
136-
137-
float dpL = 1.0 - abs( dot( normalize(sumdgeSampleVecL), smudgeDir ) );
138-
float dpR = 1.0 - abs( dot( normalize(sumdgeSampleVecR), smudgeDir ) );
139-
float dpU = 1.0 - abs( dot( normalize(sumdgeSampleVecU), smudgeDir ) );
140-
float dpD = 1.0 - abs( dot( normalize(sumdgeSampleVecD), smudgeDir ) );
141-
142-
outScaledUV.x += strength * dpL;
143-
outScaledUV.x -= strength * dpR;
144-
outScaledUV.y += strength * dpU;
145-
outScaledUV.y -= strength * dpD;
146-
147-
mipLevel += 1.0;
148-
offset *= 2.0;
149-
strength *= 4.0;
150-
}
151-
*/
152-
153117
outScaledUV += in_uv;
154118
out_scaledUV = outScaledUV * u_uvRepeat;
155119
}

0 commit comments

Comments
 (0)