hyperstellar 1.5.6__py3-none-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. hyperstellar/__init__.py +299 -0
  2. hyperstellar/__init__.pyi +1019 -0
  3. hyperstellar/_native/linux-x64/shaders/axis.frag +8 -0
  4. hyperstellar/_native/linux-x64/shaders/axis.vert +13 -0
  5. hyperstellar/_native/linux-x64/shaders/fragShader.frag +27 -0
  6. hyperstellar/_native/linux-x64/shaders/geoShader.geom +69 -0
  7. hyperstellar/_native/linux-x64/shaders/math.comp +2177 -0
  8. hyperstellar/_native/linux-x64/shaders/paint.comp +1214 -0
  9. hyperstellar/_native/linux-x64/shaders/quad.frag +26 -0
  10. hyperstellar/_native/linux-x64/shaders/quad.geom +149 -0
  11. hyperstellar/_native/linux-x64/shaders/quad.vert +39 -0
  12. hyperstellar/_native/linux-x64/shaders/vertexShader.vert +13 -0
  13. hyperstellar/_native/linux-x64/stellar.so +0 -0
  14. hyperstellar/_native/windows-x64/shaders/axis.frag +8 -0
  15. hyperstellar/_native/windows-x64/shaders/axis.vert +13 -0
  16. hyperstellar/_native/windows-x64/shaders/fragShader.frag +27 -0
  17. hyperstellar/_native/windows-x64/shaders/geoShader.geom +69 -0
  18. hyperstellar/_native/windows-x64/shaders/math.comp +2177 -0
  19. hyperstellar/_native/windows-x64/shaders/paint.comp +1214 -0
  20. hyperstellar/_native/windows-x64/shaders/quad.frag +26 -0
  21. hyperstellar/_native/windows-x64/shaders/quad.geom +149 -0
  22. hyperstellar/_native/windows-x64/shaders/quad.vert +39 -0
  23. hyperstellar/_native/windows-x64/shaders/vertexShader.vert +13 -0
  24. hyperstellar/_native/windows-x64/stellar.pyd +0 -0
  25. hyperstellar/debug.py +169 -0
  26. hyperstellar/jit.py +2010 -0
  27. hyperstellar/jit_linter.py +3 -0
  28. hyperstellar/py.typed +0 -0
  29. hyperstellar/shader.py +1356 -0
  30. hyperstellar/typed.py +152 -0
  31. hyperstellar-1.5.6.dist-info/METADATA +470 -0
  32. hyperstellar-1.5.6.dist-info/RECORD +35 -0
  33. hyperstellar-1.5.6.dist-info/WHEEL +5 -0
  34. hyperstellar-1.5.6.dist-info/licenses/LICENSE +24 -0
  35. hyperstellar-1.5.6.dist-info/top_level.txt +1 -0
@@ -0,0 +1,8 @@
1
+ #version 430 core
2
+ in vec3 color;
3
+
4
+ out vec4 FragColor;
5
+
6
+ void main() {
7
+ FragColor = vec4(color, 1.0); // Using the vertex color directly, smart
8
+ }
@@ -0,0 +1,13 @@
1
+ #version 430 core
2
+ layout (location = 0) in vec2 aPos;
3
+ layout (location = 1) in vec3 aColor;
4
+ layout (location = 2) in float aWidth;
5
+
6
+ uniform mat4 uProjView;
7
+
8
+ out vec3 color;
9
+
10
+ void main() {
11
+ gl_Position = uProjView * vec4(aPos, 0.0, 1.0);
12
+ color = aColor; // Pass color to fragment shader
13
+ }
@@ -0,0 +1,27 @@
1
+ #version 430 core
2
+
3
+ in float magnitude;
4
+ in float chargeInfluence;
5
+
6
+ out vec4 FragColor;
7
+
8
+ void main() {
9
+ vec3 lowMagnitudeColor = vec3(0.0, 0.5, 1.0); // A vibrant blue
10
+ vec3 midMagnitudeColor = vec3(1.0, 1.0, 0.0); // A pure green
11
+ vec3 highMagnitudeColor = vec3(1.0, 0.5, 0.0); // An intense orange
12
+
13
+ float normalizedMagnitude = clamp(pow(magnitude, .9) * .1, 0.0, 1.0);
14
+
15
+ vec3 finalColor;
16
+
17
+ if (normalizedMagnitude <= 0.5) {
18
+ float t = normalizedMagnitude * 2.0;
19
+ finalColor = mix(lowMagnitudeColor, midMagnitudeColor, t);
20
+ }
21
+ else {
22
+ float t = (normalizedMagnitude - 0.5) * 2.0;
23
+ finalColor = mix(midMagnitudeColor, highMagnitudeColor, t);
24
+ }
25
+
26
+ FragColor = vec4(finalColor, 1.0);
27
+ }
@@ -0,0 +1,69 @@
1
+ #version 430 core
2
+
3
+ layout (points) in;
4
+ layout (line_strip, max_vertices = 5) out;
5
+
6
+ in vec2 v_basePos[]; // from vertex shader
7
+ uniform mat4 projection;
8
+
9
+ // Object data from C++
10
+ uniform int numCharges;
11
+ uniform vec2 objectPositions[200];
12
+ uniform float objectCharges[200];
13
+
14
+ out float magnitude;
15
+ out float chargeInfluence;
16
+
17
+ void main() {
18
+ vec2 basePos = v_basePos[0];
19
+
20
+ // Compute superposed electric field vector and charge influence
21
+ vec2 totalField = vec2(0.0);
22
+ chargeInfluence = 0.0;
23
+
24
+ for (int i = 0; i < numCharges; i++) {
25
+ vec2 r = basePos - objectPositions[i];
26
+ float d = length(r) + 1e-4; // Avoid division by zero
27
+ float inverseSquare = 1.0 / (d * d);
28
+
29
+ // Apply negative charge to flip the direction
30
+ totalField += -objectCharges[i] * normalize(r) * inverseSquare;
31
+ chargeInfluence += objectCharges[i] * inverseSquare;
32
+ }
33
+
34
+ magnitude = length(totalField);
35
+ vec2 dir = (magnitude > 0.0) ? normalize(totalField) : vec2(0.0, 0.0);
36
+
37
+ // Scale arrow based on magnitude
38
+ float arrowLength = clamp(magnitude * 0.2, 0.001, 0.09);
39
+ vec2 tip = basePos + dir * arrowLength;
40
+
41
+ // Perpendicular for arrowhead
42
+ vec2 perp = vec2(-dir.y, dir.x);
43
+ float headLength = arrowLength / 3.0;
44
+ float headWidth = arrowLength / 6.0;
45
+
46
+ vec2 left = tip - dir * headLength + perp * headWidth;
47
+ vec2 right = tip - dir * headLength - perp * headWidth;
48
+
49
+ // Emit geometry (shaft + arrowhead)
50
+ magnitude = length(totalField);
51
+ chargeInfluence = chargeInfluence;
52
+
53
+ gl_Position = projection * vec4(basePos, 0.0, 1.0);
54
+ EmitVertex();
55
+
56
+ gl_Position = projection * vec4(tip, 0.0, 1.0);
57
+ EmitVertex();
58
+
59
+ gl_Position = projection * vec4(left, 0.0, 1.0);
60
+ EmitVertex();
61
+
62
+ gl_Position = projection * vec4(tip, 0.0, 1.0);
63
+ EmitVertex();
64
+
65
+ gl_Position = projection * vec4(right, 0.0, 1.0);
66
+ EmitVertex();
67
+
68
+ EndPrimitive();
69
+ }