File tree Expand file tree Collapse file tree
src/components/textures/shaders Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,8 +17,20 @@ uniform float cScale;
1717uniform vec2 latBounds;
1818uniform vec2 lonBounds;
1919uniform int maskValue;
20-
2120#define epsilon 0.0001
21+ #define PI 3.14159265
22+
23+ vec2 realCoords(vec2 uv){
24+ vec2 normalizedLon = lonBounds/ 2 ./PI+ 0.5 ;
25+ vec2 normalizedLat = latBounds/ PI+ 0.5 ;
26+ float lonScale = normalizedLon.y- normalizedLon.x;
27+ float latScale = normalizedLat.y- normalizedLat.x;
28+
29+ float u = uv.x * lonScale + normalizedLon.x;
30+ float v = uv.y * latScale + normalizedLat.x;
31+
32+ return vec2 (u, v);
33+ }
2234
2335float sample1(vec2 p, int index) { // Shader doesn't support dynamic indexing so we gotta use switching
2436 if (index == 0 ) return texture(map[0 ], p).r;
@@ -44,8 +56,8 @@ void main(){
4456 float mask = texture(maskTexture, maskUV).r;
4557 bool cond = maskValue == 1 ? mask< 0.5 : mask>= 0.5 ;
4658 if (cond){
47- Color = vec4 (nanColor, 1 .);
48- Color .a = nanAlpha;
59+ color = vec4 (nanColor, 1 .);
60+ color .a = nanAlpha;
4961 return ;
5062 }
5163 }
You can’t perform that action at this time.
0 commit comments