-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hide surface parameters from charts of floating weather stations Use texture for temperature and air quality color scales
- Loading branch information
Showing
5 changed files
with
168 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#version 300 es | ||
precision highp float; | ||
precision highp isampler2D; | ||
|
||
in vec2 texCoord; | ||
in vec2 fragCoord; | ||
|
||
uniform sampler2D baseTex; | ||
uniform sampler2D waterTex; | ||
uniform isampler2D wallTex; | ||
uniform sampler2D colorScalesTex; | ||
|
||
uniform vec2 resolution; | ||
uniform vec2 texelSize; | ||
|
||
uniform float dryLapse; | ||
|
||
uniform float displayVectorField; | ||
|
||
uniform vec3 view; // Xpos Ypos Zoom | ||
uniform vec4 cursor; // xpos Ypos Size type | ||
|
||
out vec4 fragmentColor; | ||
|
||
#include "common.glsl" | ||
#include "commonDisplay.glsl" | ||
|
||
|
||
void main() | ||
{ | ||
vec4 base = bilerpWall(baseTex, wallTex, fragCoord); | ||
vec4 water = bilerpWall(waterTex, wallTex, fragCoord); | ||
ivec2 wall = texture(wallTex, texCoord).xy; | ||
|
||
if (wall[1] == 0) { // is wall | ||
switch (wall[0]) { // wall type | ||
case 0: | ||
fragmentColor = vec4(0, 0, 0, 1); | ||
break; | ||
case 1: // land wall | ||
fragmentColor = vec4(vec3(0.10), 1.0); | ||
break; | ||
case 2: // water wall | ||
// fragmentColor = vec4(0, 0.5, 0.99, 1); | ||
int palletteIndex = int(map_range(KtoC(base[3]), -26. - 2., 30., 0., 29.)); | ||
palletteIndex = clamp(palletteIndex, 0, 29); | ||
fragmentColor = vec4(tempColorPalette[palletteIndex], 1.0); | ||
break; | ||
case 3: // Fire wall | ||
fragmentColor = vec4(1.0, 0.5, 0.0, 1); | ||
break; | ||
} | ||
} else { // fluid | ||
|
||
float smokeDensity = water[SMOKE]; | ||
|
||
int palletteIndex = int(map_range(smokeDensity, 0.0, 1.0, 0., 26.)); | ||
palletteIndex = clamp(palletteIndex, 0, 26); | ||
fragmentColor = texelFetch(colorScalesTex, ivec2(1, palletteIndex), 0); | ||
|
||
drawVectorField(base.xy, displayVectorField); | ||
} | ||
|
||
drawCursor(cursor, view); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.