@zendir/ui 0.3.0 → 0.3.1
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.
- package/dist/index.js +62 -62
- package/dist/react/3d/ZenSpace3D.js +3 -2
- package/dist/react/3d/ZenSpace3DShaders.js +478 -0
- package/dist/react/3d/ZenSpace3DShaders.js.map +1 -0
- package/dist/react/3d/capturePngAnalysis.js +42 -0
- package/dist/react/3d/capturePngAnalysis.js.map +1 -0
- package/dist/react/3d/index.js +57 -0
- package/dist/react/3d/index.js.map +1 -0
- package/dist/react/3d/threeLoader.js +4 -0
- package/dist/react/3d/threeLoader.js.map +1 -1
- package/dist/react/astro/ClassificationBanner.js +1 -1
- package/dist/react/astro/GlobalStatusBar.js +1 -1
- package/dist/react/astro/MissionClock.js +8 -5
- package/dist/react/astro/MissionClock.js.map +1 -1
- package/dist/react/astro/MonitoringIcon.js +1 -1
- package/dist/react/astro/Notification.js +1 -1
- package/dist/react/astro/Progress.js +1 -1
- package/dist/react/astro/SimulationControls.js +1 -1
- package/dist/react/astro/StatusIndicator.js +1 -1
- package/dist/react/astro/UnifiedTimeline.js +1 -1
- package/dist/react/astro/index.js +34 -0
- package/dist/react/astro/index.js.map +1 -0
- package/dist/react/cards/AccessCard.js +410 -0
- package/dist/react/cards/AccessCard.js.map +1 -0
- package/dist/react/cards/OrbitCard.js +372 -0
- package/dist/react/cards/OrbitCard.js.map +1 -0
- package/dist/react/cards/SpacecraftCard.js +941 -0
- package/dist/react/cards/SpacecraftCard.js.map +1 -0
- package/dist/react/cards/TelemetryCard.js +742 -0
- package/dist/react/cards/TelemetryCard.js.map +1 -0
- package/dist/react/cards/TelemetryStreamCard.js +309 -0
- package/dist/react/cards/TelemetryStreamCard.js.map +1 -0
- package/dist/react/cards/index.js +13 -0
- package/dist/react/cards/index.js.map +1 -0
- package/dist/react/charts/GroundTrackMap.js +1 -1
- package/dist/react/charts/GroundTrackMapLeaflet.js +1 -1
- package/dist/react/charts/index.js +104 -0
- package/dist/react/charts/index.js.map +1 -0
- package/dist/react/charts/unified/AstroChart.js +1 -1
- package/dist/react/charts/unified/PowerOverviewChart.js +488 -0
- package/dist/react/charts/unified/PowerOverviewChart.js.map +1 -0
- package/dist/react/charts/unified/domain.js +3168 -0
- package/dist/react/charts/unified/domain.js.map +1 -0
- package/dist/react/charts/unified/generators.js +518 -0
- package/dist/react/charts/unified/generators.js.map +1 -0
- package/dist/react/charts/unified/presets.js +1000 -0
- package/dist/react/charts/unified/presets.js.map +1 -0
- package/dist/react/charts/unified/sync.js +219 -0
- package/dist/react/charts/unified/sync.js.map +1 -0
- package/dist/react/charts/unified/theme.js +331 -4
- package/dist/react/charts/unified/theme.js.map +1 -1
- package/dist/react/charts/unified/useChartStream.js +226 -0
- package/dist/react/charts/unified/useChartStream.js.map +1 -0
- package/dist/react/chatgpt/index.js +163 -0
- package/dist/react/chatgpt/index.js.map +1 -0
- package/dist/react/core/data/DataTable.js +1 -1
- package/dist/react/core/data/DataValue.js +1 -1
- package/dist/react/core/display/AstroIcon.js +1 -1
- package/dist/react/core/display/Badge.js +1 -1
- package/dist/react/core/display/CardHeader.js +1 -1
- package/dist/react/core/display/Container.js +1 -1
- package/dist/react/core/display/GlassCard.js +1 -1
- package/dist/react/core/display/HeaderIconWithStatus.js +1 -1
- package/dist/react/core/feedback/Dialog.js +1 -1
- package/dist/react/core/feedback/Toast.js +1 -1
- package/dist/react/core/index.js +161 -0
- package/dist/react/core/index.js.map +1 -0
- package/dist/react/core/inputs/Button.js +1 -1
- package/dist/react/core/inputs/Checkbox.js +1 -1
- package/dist/react/core/inputs/Input.js +1 -1
- package/dist/react/core/inputs/NumberInput.js +1 -1
- package/dist/react/core/inputs/PinInput.js +1 -1
- package/dist/react/core/inputs/Select.js +1 -1
- package/dist/react/core/inputs/Toggle.js +1 -1
- package/dist/react/core/layout/Box.js +1 -1
- package/dist/react/core/layout/Flex.js +1 -1
- package/dist/react/core/layout/Grid.js +1 -1
- package/dist/react/core/layout/Stack.js +1 -1
- package/dist/react/core/navigation/AppBar.js +1 -1
- package/dist/react/core/navigation/Pagination.js +1 -1
- package/dist/react/core/navigation/SideNav.js +1 -1
- package/dist/react/core/navigation/Tabs.js +1 -1
- package/dist/react/core/overlays/SidePanel.js +1 -1
- package/dist/react/core/overlays/Tooltip.js +1 -1
- package/dist/react/core/widgets/Capture.js +1 -1
- package/dist/react/core/widgets/ChatPanel.js +1 -1
- package/dist/react/core/widgets/ColorPickerPanel.js +1 -1
- package/dist/react/core/widgets/ConnectionForm.js +1 -1
- package/dist/react/core/widgets/FileExplorer.js +1 -1
- package/dist/react/core/widgets/ImageGallery.js +1 -1
- package/dist/react/core/widgets/MessageStream.js +1 -1
- package/dist/react/core/widgets/MissionCalendar.js +1 -1
- package/dist/react/hooks/useCompactMode.js +1 -1
- package/dist/react/panels/index.js +8 -0
- package/dist/react/panels/index.js.map +1 -0
- package/dist/react/theme/config.js +30 -0
- package/dist/react/theme/config.js.map +1 -0
- package/dist/react/theme/index.js +19 -0
- package/dist/react/theme/index.js.map +1 -0
- package/dist/react/utils/index.js +8 -0
- package/dist/react/utils/index.js.map +1 -1
- package/dist/react.js +62 -62
- package/package.json +45 -37
package/dist/index.js
CHANGED
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Skeleton3D, SkeletonBox, SkeletonCard, SkeletonChart, SkeletonCircle, SkeletonText } from "./react/shared/Skeleton.js";
|
|
3
|
-
import { STATUS_COLORS, addAlpha, clamp, classNames, focusRingStyle, formatAltitude, formatCoordinate, formatCountdown, formatDataRate, formatDecibels, formatDegrees, formatDistance, formatDuration, formatFrequency, formatLatLon, formatNumber, formatPercentage, formatPower, formatTabular, formatTemperature, formatTime, formatUTC, formatVelocity, getStatusColor, getStatusFromValue, getStatusSeverity, getWorstStatus, isStatusLevel, isValidNumber, lerp, mapRange, normalizeStatus, safeAccentText, safeNumber, tabularNumsStyle, transitions, withNullSafety } from "./react/utils/index.js";
|
|
4
|
-
import { useCompactMode } from "./react/hooks/useCompactMode.js";
|
|
5
|
-
import { PLANETS, auToKm, estimateOrbitalPeriod, estimateOrbitalVelocity, getPlanet, normalizePlanetName } from "./react/types.js";
|
|
6
|
-
import { ActivityPlanner } from "./react/core/widgets/ActivityPlanner.js";
|
|
7
|
-
import { AppBar } from "./react/core/navigation/AppBar.js";
|
|
8
|
-
import { AstroChart } from "./react/charts/unified/AstroChart.js";
|
|
9
|
-
import { BREAKPOINTS, useBreakpoint } from "./react/core/layout/useBreakpoint.js";
|
|
10
|
-
import { Badge } from "./react/core/display/Badge.js";
|
|
11
|
-
import { Body1, Body2, Body3, Compact, DataText, Display1, Display2, FONT_FAMILY_MONO, FONT_FAMILY_PRIMARY, FONT_WEIGHTS, H1, H2, H3, H4, H5, H6, Label, Micro, Mono, Typography } from "./react/core/display/Typography.js";
|
|
12
|
-
import { Box } from "./react/core/layout/Box.js";
|
|
1
|
+
import { Icon, getIconNames, isValidIconName } from "./react/core/display/Icon.js";
|
|
13
2
|
import { Button } from "./react/core/inputs/Button.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { Capture, loadCapturePlaceholderImage, useCapture } from "./react/core/widgets/Capture.js";
|
|
18
|
-
import { CardHeader } from "./react/core/display/CardHeader.js";
|
|
19
|
-
import { CategoryPalette } from "./react/utils/categoryPalette.js";
|
|
20
|
-
import { CategoryProvider, useCategoryPalette, useCategoryPaletteRequired } from "./react/context/CategoryContext.js";
|
|
21
|
-
import { Center } from "./react/core/layout/Center.js";
|
|
3
|
+
import { Input } from "./react/core/inputs/Input.js";
|
|
4
|
+
import { Select } from "./react/core/inputs/Select.js";
|
|
5
|
+
import { Toggle } from "./react/core/inputs/Toggle.js";
|
|
22
6
|
import { Checkbox } from "./react/core/inputs/Checkbox.js";
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import { ConnectionForm } from "./react/core/widgets/ConnectionForm.js";
|
|
7
|
+
import { Tooltip } from "./react/core/overlays/Tooltip.js";
|
|
8
|
+
import { Dialog } from "./react/core/feedback/Dialog.js";
|
|
9
|
+
import { Badge } from "./react/core/display/Badge.js";
|
|
10
|
+
import { Tabs } from "./react/core/navigation/Tabs.js";
|
|
28
11
|
import { Container } from "./react/core/display/Container.js";
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
12
|
+
import { GLASS_COLOR_OVERLAYS, GlassCard } from "./react/core/display/GlassCard.js";
|
|
13
|
+
import { Pagination } from "./react/core/navigation/Pagination.js";
|
|
31
14
|
import { DataValue, DataValueGroup } from "./react/core/data/DataValue.js";
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
15
|
+
import { HeaderIconWithStatus } from "./react/core/display/HeaderIconWithStatus.js";
|
|
16
|
+
import { CardHeader } from "./react/core/display/CardHeader.js";
|
|
17
|
+
import { CATEGORY_ICONS, CATEGORY_LABELS, PROPERTY_PRESETS, createPropertyConfig, deriveBatteryStatus, deriveStatus, formatPropertyLabel, formatPropertyValue, getPropertiesByCategory, getPropertyConfig } from "./react/core/data/propertyConfig.js";
|
|
18
|
+
import { MessageStream } from "./react/core/widgets/MessageStream.js";
|
|
19
|
+
import { AppBar } from "./react/core/navigation/AppBar.js";
|
|
20
|
+
import { ColorPickerPanel } from "./react/core/widgets/ColorPickerPanel.js";
|
|
21
|
+
import { Body1, Body2, Body3, Compact, DataText, Display1, Display2, FONT_FAMILY_MONO, FONT_FAMILY_PRIMARY, FONT_WEIGHTS, H1, H2, H3, H4, H5, H6, Label, Micro, Mono, Typography } from "./react/core/display/Typography.js";
|
|
22
|
+
import { NumberInput } from "./react/core/inputs/NumberInput.js";
|
|
23
|
+
import { SIDENAV_HEADER_LOGO_SLOT_HEIGHT_PX, SideNav } from "./react/core/navigation/SideNav.js";
|
|
24
|
+
import { ToastProvider, useToast, useToastManager } from "./react/core/feedback/Toast.js";
|
|
25
|
+
import { Menu, Popover } from "./react/core/overlays/Popover.js";
|
|
26
|
+
import { Box } from "./react/core/layout/Box.js";
|
|
36
27
|
import { Flex } from "./react/core/layout/Flex.js";
|
|
37
|
-
import { GLASS_COLOR_OVERLAYS, GlassCard } from "./react/core/display/GlassCard.js";
|
|
38
|
-
import { GlobalStatusBar } from "./react/astro/GlobalStatusBar.js";
|
|
39
28
|
import { Grid } from "./react/core/layout/Grid.js";
|
|
40
|
-
import { GroundTrackMap } from "./react/charts/GroundTrackMap.js";
|
|
41
29
|
import { HStack, Stack, VStack } from "./react/core/layout/Stack.js";
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
30
|
+
import { Center } from "./react/core/layout/Center.js";
|
|
31
|
+
import { Spacer } from "./react/core/layout/Spacer.js";
|
|
32
|
+
import { Divider } from "./react/core/layout/Divider.js";
|
|
33
|
+
import { BREAKPOINTS, useBreakpoint } from "./react/core/layout/useBreakpoint.js";
|
|
34
|
+
import { resolveResponsive, resolveSpacing } from "./react/core/layout/responsive.js";
|
|
35
|
+
import { ConfirmDialog, ConfirmProvider, useConfirm } from "./react/core/feedback/ConfirmDialog.js";
|
|
36
|
+
import { PinInput } from "./react/core/inputs/PinInput.js";
|
|
37
|
+
import { CopyButton, useCopyToClipboard } from "./react/core/display/CopyButton.js";
|
|
38
|
+
import { DataTable, DataTableRowDetail } from "./react/core/data/DataTable.js";
|
|
45
39
|
import { ImageGallery } from "./react/core/widgets/ImageGallery.js";
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
40
|
+
import { CHAT_RESPONSE_JSON_PROMPT, CHAT_RESPONSE_MCP_TOOL, CHAT_RESPONSE_TOOL_SCHEMA, CHAT_RESPONSE_YAML_PROMPT, CHAT_STATUS_RULES_PROMPT, ChatPanel, createChatResponseParser, parseChatResponse, parseMcpToolResult } from "./react/core/widgets/ChatPanel.js";
|
|
41
|
+
import { ConnectionForm } from "./react/core/widgets/ConnectionForm.js";
|
|
42
|
+
import { SidePanel } from "./react/core/overlays/SidePanel.js";
|
|
43
|
+
import { HexViewer, REGION_BORDER_COLORS, REGION_COLORS } from "./react/core/widgets/HexViewer.js";
|
|
48
44
|
import { LimitsBar } from "./react/core/inputs/LimitsBar.js";
|
|
49
45
|
import { LogViewer } from "./react/core/widgets/LogViewer.js";
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
46
|
+
import { PacketViewer } from "./react/core/widgets/PacketViewer.js";
|
|
47
|
+
import { CommandBuilder } from "./react/core/widgets/CommandBuilder.js";
|
|
48
|
+
import { FileExplorer } from "./react/core/widgets/FileExplorer.js";
|
|
53
49
|
import { MissionCalendar } from "./react/core/widgets/MissionCalendar.js";
|
|
50
|
+
import { ActivityPlanner } from "./react/core/widgets/ActivityPlanner.js";
|
|
51
|
+
import { Capture, loadCapturePlaceholderImage, useCapture } from "./react/core/widgets/Capture.js";
|
|
52
|
+
import { ZenSpace3D } from "./react/3d/ZenSpace3D.js";
|
|
53
|
+
import { ecefEulerXyzToHpr, ecefMetersToSdkPosition } from "./react/3d/CesiumCaptureSource.js";
|
|
54
|
+
import { useSimulationScene } from "./react/hooks/useSimulationScene.js";
|
|
55
|
+
import { ThemeProvider, useScrollbarStyles, useTheme, useThemeTokens } from "./react/theme/ThemeProvider.js";
|
|
56
|
+
import { CARD_ACCENT_COLORS, CardAccentProvider, SPACE_SYSTEM_COLORS, getAccentColorOptions, getSystemAccentColor, useCardAccent } from "./react/theme/cardAccent.js";
|
|
57
|
+
import { ErrorBoundary, withErrorBoundary } from "./react/shared/ErrorBoundary.js";
|
|
58
|
+
import { Skeleton3D, SkeletonBox, SkeletonCard, SkeletonChart, SkeletonCircle, SkeletonText } from "./react/shared/Skeleton.js";
|
|
59
|
+
import { STATUS_COLORS, addAlpha, clamp, classNames, focusRingStyle, formatAltitude, formatCoordinate, formatCountdown, formatDataRate, formatDecibels, formatDegrees, formatDistance, formatDuration, formatFrequency, formatLatLon, formatNumber, formatPercentage, formatPower, formatTabular, formatTemperature, formatTime, formatUTC, formatVelocity, getStatusColor, getStatusFromValue, getStatusSeverity, getWorstStatus, isStatusLevel, isValidNumber, lerp, mapRange, normalizeStatus, safeAccentText, safeNumber, tabularNumsStyle, transitions, withNullSafety } from "./react/utils/index.js";
|
|
60
|
+
import { StatusIndicator } from "./react/astro/StatusIndicator.js";
|
|
61
|
+
import { ClassificationBanner } from "./react/astro/ClassificationBanner.js";
|
|
62
|
+
import { GlobalStatusBar } from "./react/astro/GlobalStatusBar.js";
|
|
54
63
|
import { MissionClock } from "./react/astro/MissionClock.js";
|
|
64
|
+
import { MiniSimulationControls, SimulationControls, SimulationControlsWithClock } from "./react/astro/SimulationControls.js";
|
|
55
65
|
import { MonitoringIcon } from "./react/astro/MonitoringIcon.js";
|
|
56
|
-
import { Notification } from "./react/astro/Notification.js";
|
|
57
|
-
import { NumberInput } from "./react/core/inputs/NumberInput.js";
|
|
58
|
-
import { ObjectInventoryPanel, recommendedFlyDistance } from "./react/panels/ObjectInventoryPanel.js";
|
|
59
|
-
import { PacketViewer } from "./react/core/widgets/PacketViewer.js";
|
|
60
|
-
import { Pagination } from "./react/core/navigation/Pagination.js";
|
|
61
|
-
import { PinInput } from "./react/core/inputs/PinInput.js";
|
|
62
66
|
import { Progress } from "./react/astro/Progress.js";
|
|
63
|
-
import {
|
|
64
|
-
import { Select } from "./react/core/inputs/Select.js";
|
|
65
|
-
import { SidePanel } from "./react/core/overlays/SidePanel.js";
|
|
66
|
-
import { Spacer } from "./react/core/layout/Spacer.js";
|
|
67
|
-
import { StatusIndicator } from "./react/astro/StatusIndicator.js";
|
|
68
|
-
import { Tabs } from "./react/core/navigation/Tabs.js";
|
|
69
|
-
import { ThemeProvider, useScrollbarStyles, useTheme, useThemeTokens } from "./react/theme/ThemeProvider.js";
|
|
67
|
+
import { Notification } from "./react/astro/Notification.js";
|
|
70
68
|
import { UnifiedTimeline } from "./react/astro/UnifiedTimeline.js";
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
69
|
+
import { GroundTrackMap } from "./react/charts/GroundTrackMap.js";
|
|
70
|
+
import { useCompactMode } from "./react/hooks/useCompactMode.js";
|
|
71
|
+
import { ObjectInventoryPanel, recommendedFlyDistance } from "./react/panels/ObjectInventoryPanel.js";
|
|
72
|
+
import { LayerControlPanel } from "./react/panels/LayerControlPanel.js";
|
|
73
|
+
import { PLANETS, auToKm, estimateOrbitalPeriod, estimateOrbitalVelocity, getPlanet, normalizePlanetName } from "./react/types.js";
|
|
74
|
+
import { AstroChart } from "./react/charts/unified/AstroChart.js";
|
|
75
|
+
import { CategoryPalette } from "./react/utils/categoryPalette.js";
|
|
76
|
+
import { CategoryProvider, useCategoryPalette, useCategoryPaletteRequired } from "./react/context/CategoryContext.js";
|
|
77
|
+
import { DisplaySettingsProvider, GLASS_TINTS, PRESET_COLORS, getEffectiveCompactMode, useDisplaySettings, useDisplaySettingsOptional } from "./react/context/DisplaySettingsContext.js";
|
|
78
78
|
export {
|
|
79
79
|
ActivityPlanner,
|
|
80
80
|
AppBar,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React, { forwardRef, useState, useEffect, useRef, useMemo, useCallback, useImperativeHandle } from "react";
|
|
3
|
+
import { useTheme } from "../theme/ThemeProvider.js";
|
|
3
4
|
import { AstroIcon } from "../core/display/AstroIcon.js";
|
|
4
5
|
import { SCENE_EARTH_RADIUS, latLonAltToCartesian, KM_TO_SCENE, easeOutCubic } from "./ZenSpace3DUtils.js";
|
|
5
6
|
import atmosphereVertexShader from "../../shaders/atmosphere.vert.js";
|
|
@@ -8,7 +9,6 @@ import starsVertexShader from "../../shaders/stars.vert.js";
|
|
|
8
9
|
import starsFragmentShader from "../../shaders/stars.frag.js";
|
|
9
10
|
import { loadThree } from "./threeLoader.js";
|
|
10
11
|
import { ZenSpace3DCesium } from "./ZenSpace3DCesium.js";
|
|
11
|
-
import { useTheme } from "../theme/ThemeProvider.js";
|
|
12
12
|
const DEFAULT_LAYERS = {
|
|
13
13
|
planets: true,
|
|
14
14
|
moons: true,
|
|
@@ -1248,6 +1248,7 @@ function ObjectLegend({ currentView, satellites, stations, groundStations, onObj
|
|
|
1248
1248
|
] });
|
|
1249
1249
|
}
|
|
1250
1250
|
export {
|
|
1251
|
-
ZenSpace3D
|
|
1251
|
+
ZenSpace3D,
|
|
1252
|
+
ZenSpace3D as default
|
|
1252
1253
|
};
|
|
1253
1254
|
//# sourceMappingURL=ZenSpace3D.js.map
|
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
const atmosphereVertexShader = `
|
|
2
|
+
varying vec3 vNormal;
|
|
3
|
+
varying vec3 vPosition;
|
|
4
|
+
varying float vIntensity;
|
|
5
|
+
|
|
6
|
+
void main() {
|
|
7
|
+
vNormal = normalize(normalMatrix * normal);
|
|
8
|
+
vPosition = position;
|
|
9
|
+
|
|
10
|
+
// Calculate intensity based on view angle
|
|
11
|
+
vec4 worldPosition = modelMatrix * vec4(position, 1.0);
|
|
12
|
+
vec3 viewDirection = normalize(cameraPosition - worldPosition.xyz);
|
|
13
|
+
vIntensity = pow(0.65 - dot(vNormal, viewDirection), 2.0);
|
|
14
|
+
|
|
15
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
const atmosphereFragmentShader = `
|
|
19
|
+
varying vec3 vNormal;
|
|
20
|
+
varying vec3 vPosition;
|
|
21
|
+
varying float vIntensity;
|
|
22
|
+
|
|
23
|
+
uniform vec3 glowColor;
|
|
24
|
+
uniform float glowIntensity;
|
|
25
|
+
|
|
26
|
+
void main() {
|
|
27
|
+
// Fresnel-based glow
|
|
28
|
+
float intensity = vIntensity * glowIntensity;
|
|
29
|
+
|
|
30
|
+
// Add subtle color variation
|
|
31
|
+
vec3 color = glowColor * intensity;
|
|
32
|
+
|
|
33
|
+
// Fade at edges for smoother blending
|
|
34
|
+
float alpha = intensity * 0.8;
|
|
35
|
+
|
|
36
|
+
gl_FragColor = vec4(color, alpha);
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
const starsVertexShader = `
|
|
40
|
+
attribute float opacity;
|
|
41
|
+
attribute float size;
|
|
42
|
+
attribute vec3 customColor;
|
|
43
|
+
|
|
44
|
+
varying float vOpacity;
|
|
45
|
+
varying vec3 vColor;
|
|
46
|
+
|
|
47
|
+
uniform float time;
|
|
48
|
+
uniform float pointSize;
|
|
49
|
+
|
|
50
|
+
void main() {
|
|
51
|
+
vOpacity = opacity;
|
|
52
|
+
vColor = customColor;
|
|
53
|
+
|
|
54
|
+
// Twinkle effect
|
|
55
|
+
float twinkle = sin(time * (0.5 + opacity * 2.0) + opacity * 100.0) * 0.5 + 0.5;
|
|
56
|
+
vOpacity = opacity * (0.6 + twinkle * 0.4);
|
|
57
|
+
|
|
58
|
+
vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);
|
|
59
|
+
|
|
60
|
+
// Size attenuation
|
|
61
|
+
float sizeMultiplier = size > 0.0 ? size : 1.0;
|
|
62
|
+
gl_PointSize = pointSize * sizeMultiplier * (300.0 / -mvPosition.z);
|
|
63
|
+
gl_PointSize = clamp(gl_PointSize, 0.5, 8.0);
|
|
64
|
+
|
|
65
|
+
gl_Position = projectionMatrix * mvPosition;
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
68
|
+
const starsFragmentShader = `
|
|
69
|
+
varying float vOpacity;
|
|
70
|
+
varying vec3 vColor;
|
|
71
|
+
|
|
72
|
+
void main() {
|
|
73
|
+
// Circular point with soft edge
|
|
74
|
+
vec2 center = gl_PointCoord - vec2(0.5);
|
|
75
|
+
float dist = length(center);
|
|
76
|
+
|
|
77
|
+
if (dist > 0.5) discard;
|
|
78
|
+
|
|
79
|
+
// Soft glow falloff
|
|
80
|
+
float alpha = smoothstep(0.5, 0.0, dist) * vOpacity;
|
|
81
|
+
|
|
82
|
+
// Apply color
|
|
83
|
+
vec3 color = vColor.r > 0.0 ? vColor : vec3(1.0, 1.0, 1.0);
|
|
84
|
+
|
|
85
|
+
gl_FragColor = vec4(color, alpha);
|
|
86
|
+
}
|
|
87
|
+
`;
|
|
88
|
+
const coverageVertexShader = `
|
|
89
|
+
varying vec2 vUv;
|
|
90
|
+
varying vec3 vNormal;
|
|
91
|
+
varying vec3 vPosition;
|
|
92
|
+
|
|
93
|
+
void main() {
|
|
94
|
+
vUv = uv;
|
|
95
|
+
vNormal = normalize(normalMatrix * normal);
|
|
96
|
+
vPosition = (modelMatrix * vec4(position, 1.0)).xyz;
|
|
97
|
+
|
|
98
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
99
|
+
}
|
|
100
|
+
`;
|
|
101
|
+
const coverageFragmentShader = `
|
|
102
|
+
uniform sampler2D coverageMap;
|
|
103
|
+
uniform vec3 lowColor;
|
|
104
|
+
uniform vec3 highColor;
|
|
105
|
+
uniform float opacity;
|
|
106
|
+
uniform float time;
|
|
107
|
+
|
|
108
|
+
varying vec2 vUv;
|
|
109
|
+
varying vec3 vNormal;
|
|
110
|
+
varying vec3 vPosition;
|
|
111
|
+
|
|
112
|
+
void main() {
|
|
113
|
+
// Sample coverage value
|
|
114
|
+
float coverage = texture2D(coverageMap, vUv).r;
|
|
115
|
+
|
|
116
|
+
// Animated pulse for active areas
|
|
117
|
+
float pulse = sin(time * 2.0) * 0.1 + 0.9;
|
|
118
|
+
coverage *= coverage > 0.5 ? pulse : 1.0;
|
|
119
|
+
|
|
120
|
+
// Color gradient
|
|
121
|
+
vec3 color = mix(lowColor, highColor, coverage);
|
|
122
|
+
|
|
123
|
+
// Fresnel edge highlight
|
|
124
|
+
vec3 viewDir = normalize(cameraPosition - vPosition);
|
|
125
|
+
float fresnel = pow(1.0 - dot(vNormal, viewDir), 2.0);
|
|
126
|
+
color += vec3(0.1, 0.3, 0.5) * fresnel * coverage;
|
|
127
|
+
|
|
128
|
+
// Hexagon pattern overlay (subtle)
|
|
129
|
+
float hexPattern = fract(vUv.x * 20.0 + vUv.y * 10.0);
|
|
130
|
+
color *= 0.95 + hexPattern * 0.05;
|
|
131
|
+
|
|
132
|
+
gl_FragColor = vec4(color, coverage * opacity);
|
|
133
|
+
}
|
|
134
|
+
`;
|
|
135
|
+
const visibilityConeVertexShader = `
|
|
136
|
+
varying vec3 vPosition;
|
|
137
|
+
varying vec3 vNormal;
|
|
138
|
+
varying float vDistFromApex;
|
|
139
|
+
|
|
140
|
+
uniform vec3 apexPosition;
|
|
141
|
+
|
|
142
|
+
void main() {
|
|
143
|
+
vPosition = (modelMatrix * vec4(position, 1.0)).xyz;
|
|
144
|
+
vNormal = normalize(normalMatrix * normal);
|
|
145
|
+
vDistFromApex = distance(position, apexPosition);
|
|
146
|
+
|
|
147
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
148
|
+
}
|
|
149
|
+
`;
|
|
150
|
+
const visibilityConeFragmentShader = `
|
|
151
|
+
uniform vec3 coneColor;
|
|
152
|
+
uniform float coneOpacity;
|
|
153
|
+
uniform float time;
|
|
154
|
+
|
|
155
|
+
varying vec3 vPosition;
|
|
156
|
+
varying vec3 vNormal;
|
|
157
|
+
varying float vDistFromApex;
|
|
158
|
+
|
|
159
|
+
void main() {
|
|
160
|
+
// Fresnel effect for edge visibility
|
|
161
|
+
vec3 viewDir = normalize(cameraPosition - vPosition);
|
|
162
|
+
float fresnel = pow(1.0 - abs(dot(vNormal, viewDir)), 2.0);
|
|
163
|
+
|
|
164
|
+
// Animated scan line effect
|
|
165
|
+
float scan = fract(vDistFromApex * 0.001 - time * 0.5);
|
|
166
|
+
scan = smoothstep(0.0, 0.1, scan) * smoothstep(0.2, 0.1, scan);
|
|
167
|
+
|
|
168
|
+
// Distance-based opacity (fade towards apex)
|
|
169
|
+
float distFade = smoothstep(0.0, 500.0, vDistFromApex);
|
|
170
|
+
|
|
171
|
+
// Combine effects
|
|
172
|
+
float alpha = (fresnel * 0.3 + 0.1 + scan * 0.2) * coneOpacity * distFade;
|
|
173
|
+
|
|
174
|
+
gl_FragColor = vec4(coneColor, alpha);
|
|
175
|
+
}
|
|
176
|
+
`;
|
|
177
|
+
const orbitLineVertexShader = `
|
|
178
|
+
attribute float lineDistance;
|
|
179
|
+
varying float vLineDistance;
|
|
180
|
+
varying float vOpacity;
|
|
181
|
+
|
|
182
|
+
uniform float totalLength;
|
|
183
|
+
uniform float time;
|
|
184
|
+
uniform float dashScale;
|
|
185
|
+
|
|
186
|
+
void main() {
|
|
187
|
+
vLineDistance = lineDistance;
|
|
188
|
+
|
|
189
|
+
// Animated dash effect
|
|
190
|
+
float animOffset = mod(time * 0.5, 1.0) * totalLength;
|
|
191
|
+
float dashPos = mod(lineDistance + animOffset, dashScale);
|
|
192
|
+
vOpacity = smoothstep(0.0, dashScale * 0.3, dashPos) *
|
|
193
|
+
smoothstep(dashScale, dashScale * 0.7, dashPos);
|
|
194
|
+
|
|
195
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
196
|
+
}
|
|
197
|
+
`;
|
|
198
|
+
const orbitLineFragmentShader = `
|
|
199
|
+
uniform vec3 lineColor;
|
|
200
|
+
uniform float lineOpacity;
|
|
201
|
+
|
|
202
|
+
varying float vLineDistance;
|
|
203
|
+
varying float vOpacity;
|
|
204
|
+
|
|
205
|
+
void main() {
|
|
206
|
+
gl_FragColor = vec4(lineColor, lineOpacity * vOpacity);
|
|
207
|
+
}
|
|
208
|
+
`;
|
|
209
|
+
const objectGlowVertexShader = `
|
|
210
|
+
varying vec3 vNormal;
|
|
211
|
+
varying vec3 vViewPosition;
|
|
212
|
+
|
|
213
|
+
void main() {
|
|
214
|
+
vNormal = normalize(normalMatrix * normal);
|
|
215
|
+
vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);
|
|
216
|
+
vViewPosition = -mvPosition.xyz;
|
|
217
|
+
|
|
218
|
+
gl_Position = projectionMatrix * mvPosition;
|
|
219
|
+
}
|
|
220
|
+
`;
|
|
221
|
+
const objectGlowFragmentShader = `
|
|
222
|
+
uniform vec3 glowColor;
|
|
223
|
+
uniform float glowIntensity;
|
|
224
|
+
uniform float glowPower;
|
|
225
|
+
|
|
226
|
+
varying vec3 vNormal;
|
|
227
|
+
varying vec3 vViewPosition;
|
|
228
|
+
|
|
229
|
+
void main() {
|
|
230
|
+
vec3 viewDir = normalize(vViewPosition);
|
|
231
|
+
float fresnel = pow(1.0 - abs(dot(vNormal, viewDir)), glowPower);
|
|
232
|
+
|
|
233
|
+
vec3 color = glowColor * glowIntensity * fresnel;
|
|
234
|
+
float alpha = fresnel * glowIntensity;
|
|
235
|
+
|
|
236
|
+
gl_FragColor = vec4(color, alpha);
|
|
237
|
+
}
|
|
238
|
+
`;
|
|
239
|
+
const selectionRingVertexShader = `
|
|
240
|
+
varying vec2 vUv;
|
|
241
|
+
|
|
242
|
+
void main() {
|
|
243
|
+
vUv = uv;
|
|
244
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
245
|
+
}
|
|
246
|
+
`;
|
|
247
|
+
const selectionRingFragmentShader = `
|
|
248
|
+
uniform vec3 ringColor;
|
|
249
|
+
uniform float time;
|
|
250
|
+
uniform float ringWidth;
|
|
251
|
+
uniform float ringRadius;
|
|
252
|
+
|
|
253
|
+
varying vec2 vUv;
|
|
254
|
+
|
|
255
|
+
void main() {
|
|
256
|
+
vec2 center = vUv - vec2(0.5);
|
|
257
|
+
float dist = length(center);
|
|
258
|
+
|
|
259
|
+
// Ring shape
|
|
260
|
+
float ring = smoothstep(ringRadius - ringWidth, ringRadius, dist) *
|
|
261
|
+
smoothstep(ringRadius + ringWidth, ringRadius, dist);
|
|
262
|
+
|
|
263
|
+
// Animated rotation
|
|
264
|
+
float angle = atan(center.y, center.x);
|
|
265
|
+
float rotatingDash = sin(angle * 8.0 - time * 3.0) * 0.5 + 0.5;
|
|
266
|
+
|
|
267
|
+
// Pulse effect
|
|
268
|
+
float pulse = sin(time * 2.0) * 0.2 + 0.8;
|
|
269
|
+
|
|
270
|
+
float alpha = ring * rotatingDash * pulse;
|
|
271
|
+
|
|
272
|
+
gl_FragColor = vec4(ringColor, alpha);
|
|
273
|
+
}
|
|
274
|
+
`;
|
|
275
|
+
const terminatorVertexShader = `
|
|
276
|
+
varying vec3 vWorldPosition;
|
|
277
|
+
varying vec3 vNormal;
|
|
278
|
+
|
|
279
|
+
void main() {
|
|
280
|
+
vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;
|
|
281
|
+
vNormal = normalize(normalMatrix * normal);
|
|
282
|
+
|
|
283
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
284
|
+
}
|
|
285
|
+
`;
|
|
286
|
+
const terminatorFragmentShader = `
|
|
287
|
+
uniform vec3 sunDirection;
|
|
288
|
+
uniform sampler2D dayTexture;
|
|
289
|
+
uniform sampler2D nightTexture;
|
|
290
|
+
|
|
291
|
+
varying vec3 vWorldPosition;
|
|
292
|
+
varying vec3 vNormal;
|
|
293
|
+
|
|
294
|
+
void main() {
|
|
295
|
+
// Calculate sun illumination
|
|
296
|
+
float sunDot = dot(vNormal, sunDirection);
|
|
297
|
+
|
|
298
|
+
// Smooth transition at terminator
|
|
299
|
+
float dayFactor = smoothstep(-0.1, 0.2, sunDot);
|
|
300
|
+
|
|
301
|
+
// Sample textures (simplified - using world position for UV)
|
|
302
|
+
vec2 uv = vec2(
|
|
303
|
+
atan(vWorldPosition.z, vWorldPosition.x) / (2.0 * 3.14159) + 0.5,
|
|
304
|
+
asin(vWorldPosition.y / length(vWorldPosition)) / 3.14159 + 0.5
|
|
305
|
+
);
|
|
306
|
+
|
|
307
|
+
vec4 dayColor = texture2D(dayTexture, uv);
|
|
308
|
+
vec4 nightColor = texture2D(nightTexture, uv);
|
|
309
|
+
|
|
310
|
+
// Blend day and night
|
|
311
|
+
vec4 color = mix(nightColor, dayColor, dayFactor);
|
|
312
|
+
|
|
313
|
+
// Add city lights glow on night side
|
|
314
|
+
float nightGlow = (1.0 - dayFactor) * nightColor.r * 0.5;
|
|
315
|
+
color.rgb += vec3(1.0, 0.9, 0.7) * nightGlow;
|
|
316
|
+
|
|
317
|
+
gl_FragColor = color;
|
|
318
|
+
}
|
|
319
|
+
`;
|
|
320
|
+
const gridVertexShader = `
|
|
321
|
+
varying vec3 vPosition;
|
|
322
|
+
|
|
323
|
+
void main() {
|
|
324
|
+
vPosition = position;
|
|
325
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
326
|
+
}
|
|
327
|
+
`;
|
|
328
|
+
const gridFragmentShader = `
|
|
329
|
+
uniform vec3 gridColor;
|
|
330
|
+
uniform float gridOpacity;
|
|
331
|
+
uniform float gridSpacing;
|
|
332
|
+
uniform float lineWidth;
|
|
333
|
+
|
|
334
|
+
varying vec3 vPosition;
|
|
335
|
+
|
|
336
|
+
void main() {
|
|
337
|
+
// Convert position to lat/lon
|
|
338
|
+
float lat = asin(vPosition.y / length(vPosition)) * 57.2958; // rad to deg
|
|
339
|
+
float lon = atan(vPosition.z, vPosition.x) * 57.2958;
|
|
340
|
+
|
|
341
|
+
// Create grid lines
|
|
342
|
+
float latLine = abs(mod(lat + 90.0, gridSpacing) - gridSpacing * 0.5);
|
|
343
|
+
float lonLine = abs(mod(lon + 180.0, gridSpacing) - gridSpacing * 0.5);
|
|
344
|
+
|
|
345
|
+
float line = min(latLine, lonLine);
|
|
346
|
+
float alpha = smoothstep(lineWidth, 0.0, line) * gridOpacity;
|
|
347
|
+
|
|
348
|
+
// Highlight equator and prime meridian
|
|
349
|
+
float equator = smoothstep(1.0, 0.0, abs(lat));
|
|
350
|
+
float primeMeridian = smoothstep(1.0, 0.0, abs(lon));
|
|
351
|
+
alpha += (equator + primeMeridian) * 0.3;
|
|
352
|
+
|
|
353
|
+
gl_FragColor = vec4(gridColor, alpha);
|
|
354
|
+
}
|
|
355
|
+
`;
|
|
356
|
+
const planetRingVertexShader = `
|
|
357
|
+
varying vec2 vUv;
|
|
358
|
+
varying vec3 vWorldPosition;
|
|
359
|
+
|
|
360
|
+
void main() {
|
|
361
|
+
vUv = uv;
|
|
362
|
+
vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;
|
|
363
|
+
|
|
364
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
365
|
+
}
|
|
366
|
+
`;
|
|
367
|
+
const planetRingFragmentShader = `
|
|
368
|
+
uniform vec3 ringColor;
|
|
369
|
+
uniform float innerRadius;
|
|
370
|
+
uniform float outerRadius;
|
|
371
|
+
uniform float ringOpacity;
|
|
372
|
+
uniform vec3 sunDirection;
|
|
373
|
+
|
|
374
|
+
varying vec2 vUv;
|
|
375
|
+
varying vec3 vWorldPosition;
|
|
376
|
+
|
|
377
|
+
void main() {
|
|
378
|
+
vec2 center = vUv - vec2(0.5);
|
|
379
|
+
float dist = length(center) * 2.0;
|
|
380
|
+
|
|
381
|
+
// Ring bands
|
|
382
|
+
float normalizedDist = (dist - innerRadius) / (outerRadius - innerRadius);
|
|
383
|
+
|
|
384
|
+
if (normalizedDist < 0.0 || normalizedDist > 1.0) discard;
|
|
385
|
+
|
|
386
|
+
// Create ring bands pattern
|
|
387
|
+
float bands = sin(normalizedDist * 50.0) * 0.3 + 0.7;
|
|
388
|
+
float gaps = step(0.3, fract(normalizedDist * 5.0));
|
|
389
|
+
|
|
390
|
+
// Simple shadow from planet
|
|
391
|
+
float shadow = smoothstep(0.3, 0.5, dist);
|
|
392
|
+
|
|
393
|
+
float alpha = bands * gaps * ringOpacity * shadow;
|
|
394
|
+
|
|
395
|
+
gl_FragColor = vec4(ringColor, alpha);
|
|
396
|
+
}
|
|
397
|
+
`;
|
|
398
|
+
const debrisVertexShader = `
|
|
399
|
+
attribute vec3 instancePosition;
|
|
400
|
+
attribute float instanceSize;
|
|
401
|
+
attribute vec3 instanceColor;
|
|
402
|
+
|
|
403
|
+
varying vec3 vColor;
|
|
404
|
+
varying float vSize;
|
|
405
|
+
|
|
406
|
+
uniform float time;
|
|
407
|
+
|
|
408
|
+
void main() {
|
|
409
|
+
vColor = instanceColor;
|
|
410
|
+
vSize = instanceSize;
|
|
411
|
+
|
|
412
|
+
// Apply instance transform
|
|
413
|
+
vec3 transformed = position * instanceSize + instancePosition;
|
|
414
|
+
|
|
415
|
+
// Slight rotation animation
|
|
416
|
+
float angle = time * 0.5 + instancePosition.x * 0.01;
|
|
417
|
+
mat2 rot = mat2(cos(angle), -sin(angle), sin(angle), cos(angle));
|
|
418
|
+
transformed.xz = rot * transformed.xz;
|
|
419
|
+
|
|
420
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(transformed, 1.0);
|
|
421
|
+
}
|
|
422
|
+
`;
|
|
423
|
+
const debrisFragmentShader = `
|
|
424
|
+
varying vec3 vColor;
|
|
425
|
+
varying float vSize;
|
|
426
|
+
|
|
427
|
+
void main() {
|
|
428
|
+
gl_FragColor = vec4(vColor, 1.0);
|
|
429
|
+
}
|
|
430
|
+
`;
|
|
431
|
+
function createAtmosphereUniforms(color = [0.3, 0.6, 1], intensity = 1.5) {
|
|
432
|
+
return {
|
|
433
|
+
glowColor: { value: color },
|
|
434
|
+
glowIntensity: { value: intensity }
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
function createStarsUniforms(pointSize = 2) {
|
|
438
|
+
return {
|
|
439
|
+
time: { value: 0 },
|
|
440
|
+
pointSize: { value: pointSize }
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
function createVisibilityConeUniforms(color = [0.2, 0.8, 0.9], opacity = 0.3) {
|
|
444
|
+
return {
|
|
445
|
+
coneColor: { value: color },
|
|
446
|
+
coneOpacity: { value: opacity },
|
|
447
|
+
time: { value: 0 },
|
|
448
|
+
apexPosition: { value: [0, 0, 0] }
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
export {
|
|
452
|
+
atmosphereFragmentShader,
|
|
453
|
+
atmosphereVertexShader,
|
|
454
|
+
coverageFragmentShader,
|
|
455
|
+
coverageVertexShader,
|
|
456
|
+
createAtmosphereUniforms,
|
|
457
|
+
createStarsUniforms,
|
|
458
|
+
createVisibilityConeUniforms,
|
|
459
|
+
debrisFragmentShader,
|
|
460
|
+
debrisVertexShader,
|
|
461
|
+
gridFragmentShader,
|
|
462
|
+
gridVertexShader,
|
|
463
|
+
objectGlowFragmentShader,
|
|
464
|
+
objectGlowVertexShader,
|
|
465
|
+
orbitLineFragmentShader,
|
|
466
|
+
orbitLineVertexShader,
|
|
467
|
+
planetRingFragmentShader,
|
|
468
|
+
planetRingVertexShader,
|
|
469
|
+
selectionRingFragmentShader,
|
|
470
|
+
selectionRingVertexShader,
|
|
471
|
+
starsFragmentShader,
|
|
472
|
+
starsVertexShader,
|
|
473
|
+
terminatorFragmentShader,
|
|
474
|
+
terminatorVertexShader,
|
|
475
|
+
visibilityConeFragmentShader,
|
|
476
|
+
visibilityConeVertexShader
|
|
477
|
+
};
|
|
478
|
+
//# sourceMappingURL=ZenSpace3DShaders.js.map
|