Merge remote-tracking branch 'origin/master' into issue/2029

This commit is contained in:
Ylva Selling
2022-10-06 15:13:01 -04:00
160 changed files with 3337 additions and 1229 deletions

2
.gitmodules vendored
View File

@@ -9,7 +9,7 @@
url = https://github.com/OpenSpace/Spice.git
[submodule "modules/touch/ext/libTUIO11"]
path = modules/touch/ext/libTUIO11
url = https://github.com/mkalten/TUIO11_CPP
url = https://github.com/OpenSpace/TUIO11_CPP.git
[submodule "apps/OpenSpace-MinVR/ext/minvr"]
path = apps/OpenSpace-MinVR/ext/minvr
url = https://github.com/OpenSpace/minvr

View File

@@ -37,7 +37,6 @@ set(OPENSPACE_CMAKE_EXT_DIR "${OPENSPACE_BASE_DIR}/support/cmake")
set(GHOUL_BASE_DIR "${OPENSPACE_BASE_DIR}/ext/ghoul")
include(${OPENSPACE_CMAKE_EXT_DIR}/module_common.cmake)
include(${OPENSPACE_CMAKE_EXT_DIR}/global_variables.cmake)
include(${GHOUL_BASE_DIR}/support/cmake/copy_shared_libraries.cmake)
include(${GHOUL_BASE_DIR}/support/cmake/handle_external_library.cmake)
include(${GHOUL_BASE_DIR}/support/cmake/message_macros.cmake)
@@ -164,7 +163,6 @@ if (UNIX)
endif ()
add_subdirectory(ext)
add_subdirectory(src)
add_subdirectory(support/coding/codegen)

View File

@@ -50,7 +50,7 @@ target_include_directories(OpenSpace-MinVR PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/ex
target_include_directories(OpenSpace-MinVR PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/ext/minvr/external/GLFW/src/include)
target_link_libraries(OpenSpace-MinVR openspace-core MinVR)
target_link_libraries(OpenSpace-MinVR PUBLIC openspace-core MinVR)
# Web Browser and Web gui
# Why not put these in the module's path? Because they do not have access to the
@@ -71,16 +71,7 @@ elseif (OPENSPACE_MODULE_WEBBROWSER)
message(WARNING "Web configured to be included, but no CEF_ROOT was found, please try configuring CMake again.")
endif ()
if (OPENSPACE_MODULE_WEBGUI AND WEBGUI_MODULE_PATH)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${WEBGUI_MODULE_PATH}/cmake")
include(webgui_helpers)
build_webgui_source(OpenSpace-MinVR)
elseif (OPENSPACE_MODULE_WEBGUI)
message(WARNING "WebGui is configured to be included, but the web source could not be found. Try configuring CMake again.")
endif ()
# End Web Browser and Web gui
if (MSVC)
# This library is used for being able to output the callstack if an exception escapes
target_link_libraries(OpenSpace-MinVR Dbghelp.lib)
target_link_libraries(OpenSpace-MinVR PUBLIC Dbghelp.lib)
endif ()

View File

@@ -25,7 +25,6 @@
include(${GHOUL_BASE_DIR}/support/cmake/copy_shared_libraries.cmake)
include(${GHOUL_BASE_DIR}/support/cmake/message_macros.cmake)
include(${OPENSPACE_CMAKE_EXT_DIR}/application_definition.cmake)
include(${OPENSPACE_CMAKE_EXT_DIR}/global_variables.cmake)
# We are getting all_enabled_modules from the handle_applications.cmake file which gets
# it from the main CMakeLists file
@@ -141,6 +140,18 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/ext/launcher)
target_link_libraries(OpenSpace PRIVATE openspace-ui-launcher)
end_header("Dependency: Profile Editor")
if (WIN32)
# Find the windeployqt application
get_target_property(_qmake_executable Qt6::qmake IMPORTED_LOCATION)
get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${_qt_bin_dir}")
add_custom_command(
TARGET OpenSpace POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E env PATH="${_qt_bin_dir}" "${WINDEPLOYQT_EXECUTABLE}" --verbose 0 --no-compiler-runtime \"$<TARGET_FILE:OpenSpace>\"
COMMENT "Deploying Qt libraries"
)
endif ()
# Web Browser and Web gui
# Why not put these in the module's path? Because they do not have access to the
@@ -161,7 +172,7 @@ if (OPENSPACE_MODULE_WEBBROWSER AND CEF_ROOT)
set_cef_targets("${CEF_ROOT}" OpenSpace)
run_cef_platform_config("${CEF_ROOT}" "${CEF_TARGET}" "${WEBBROWSER_MODULE_PATH}")
elseif ()
message(WARNING "Web configured to be included, but no CEF_ROOT was found, please try configuring CMake again.")
message(WARNING "Web configured to be included, but no CEF_ROOT was found, please try configuring CMake again")
endif ()
if (MSVC)
@@ -174,3 +185,10 @@ endif ()
if (OPENSPACE_NVTOOLS_ENABLED)
target_link_libraries(OpenSpace PRIVATE "${OPENSPACE_NVTOOLS_PATH}/lib/x64/nvToolsExt64_1.lib")
endif ()
if (WIN32)
add_custom_command(TARGET OpenSpace POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:OpenSpace> $<TARGET_FILE_DIR:OpenSpace>
COMMAND_EXPAND_LISTS
)
endif ()

View File

@@ -127,11 +127,24 @@ target_link_libraries(
Qt${QT_VERSION_MAJOR}::Network
)
if (MSVC)
set(MSVC_WARNINGS
"/wd4619" # #pragma warning: there is no warning number (raised by Qt headers)
"/wd4946" # reinterpret_cast used between related classes:
target_precompile_headers(openspace-ui-launcher PRIVATE
<openspace/scene/profile.h>
<ghoul/glm.h>
<QAbstractItemDelegate>
<QAbstractItemModel>
<QDialog>
<QLineEdit>
<QObject>
<QStyleOption>
<QTextCursor>
<QWidget>
<filesystem>
)
target_compile_options(openspace-ui-launcher INTERFACE ${MSVC_WARNINGS})
if (MSVC)
set(MSVC_WARNINGS
"/wd4619" # #pragma warning: there is no warning number (raised by Qt headers)
"/wd4946" # reinterpret_cast used between related classes:
)
target_compile_options(openspace-ui-launcher INTERFACE ${MSVC_WARNINGS})
endif ()

View File

@@ -28,21 +28,15 @@
#include <openspace/engine/openspaceengine.h>
#include <openspace/engine/windowdelegate.h>
#include <openspace/interaction/joystickinputstate.h>
#include <openspace/scripting/scriptengine.h>
#include <openspace/util/keys.h>
#include <openspace/openspace.h>
#include <ghoul/ghoul.h>
#include <ghoul/filesystem/filesystem.h>
#include <ghoul/fmt.h>
#include <ghoul/glm.h>
#include <ghoul/cmdparser/commandlineparser.h>
#include <ghoul/cmdparser/singlecommand.h>
#include <ghoul/filesystem/file.h>
#include <ghoul/filesystem/filesystem.h>
#include <ghoul/logging/consolelog.h>
#include <ghoul/logging/logmanager.h>
#include <ghoul/logging/visualstudiooutputlog.h>
#include <ghoul/lua/ghoul_lua.h>
#include <ghoul/misc/assert.h>
#include <ghoul/misc/boolean.h>
#include <ghoul/opengl/ghoul_gl.h>
#include <ghoul/misc/stacktrace.h>
#ifdef WIN32
#define GLFW_EXPOSE_NATIVE_WIN32
#endif
@@ -54,25 +48,17 @@
#include <sgct/log.h>
#include <sgct/projection/fisheye.h>
#include <sgct/projection/nonlinearprojection.h>
#include <sgct/screencapture.h>
#include <sgct/settings.h>
#include <sgct/user.h>
#include <sgct/viewport.h>
#include <sgct/window.h>
#include <stb_image.h>
#include <Tracy.hpp>
#include <chrono>
#include <ctime>
#include <filesystem>
#include <memory>
#include <iostream>
#include <string_view>
#ifdef WIN32
#include <openspace/openspace.h>
#include <ghoul/misc/stacktrace.h>
#include <ghoul/fmt.h>
#include <Windows.h>
#include <dbghelp.h>
#include <shellapi.h>
#include <shlobj.h>
#endif // WIN32
#ifdef OPENVR_SUPPORT

View File

@@ -113,7 +113,7 @@ int main(int argc, char** argv) {
// Register the base path as the directory where the configuration file lives
std::filesystem::path base = configFile.parent_path();
constexpr std::string_view BasePathToken = "${BASE}";
FileSys.registerPathToken(BasePathToken, base);
FileSys.registerPathToken(BasePathToken.data(), base);
// Using same configuration for size as in apps/OpenSpace/main.cpp
glm::ivec2 size = glm::ivec2(1920, 1080);

View File

@@ -2,76 +2,77 @@ local earthAsset = asset.require('scene/solarsystem/planets/earth/earth')
local sunAsset = asset.require('scene/solarsystem/sun/sun')
local modelFolder = asset.syncedResource({
Name = "Eiffel Tower Model",
Type = "HttpSynchronization",
Identifier = "eiffel_tower_model",
Version = 1
Name = "Eiffel Tower Model",
Type = "HttpSynchronization",
Identifier = "eiffel_tower_model",
Version = 1
})
local eiffelTower = {
Identifier = "eiffelTower",
Parent = earthAsset.Earth.Identifier,
--Note: Lat/Lon/Scale values comes from alignment with Esri World Imagery 2D layer
Transform = {
Translation = {
Type = "GlobeTranslation",
Globe = earthAsset.Earth.Identifier,
Longitude = 2.29448,
Latitude = 48.85824,
Altitude = 0.0,
UseHeightmap = true
},
Rotation = {
Type = "GlobeRotation",
Globe = earthAsset.Earth.Identifier,
Longitude = 2.29448,
Latitude = 48.85824,
UseHeightmap = false
},
Scale = {
Type = "StaticScale",
Scale = 4.38
}
},
Renderable = {
Type = "RenderableModel",
GeometryFile = modelFolder .. "eiffeltower.osmodel",
ModelScale = "Centimeter",
RotationVector = { 0.0, 45.0, 0.0 },
LightSources = { sunAsset.LightSource }
},
GUI = {
Name = "Eiffel Tower",
Path = "/Scale Objects"
}
Identifier = "eiffelTower",
Parent = earthAsset.Earth.Identifier,
--Note: Lat/Lon/Scale values comes from alignment with Esri World Imagery 2D layer
Transform = {
Translation = {
Type = "GlobeTranslation",
Globe = earthAsset.Earth.Identifier,
Longitude = 2.29448,
Latitude = 48.85824,
Altitude = 0.0,
UseHeightmap = true
},
Rotation = {
Type = "GlobeRotation",
Globe = earthAsset.Earth.Identifier,
Longitude = 2.29448,
Latitude = 48.85824,
UseHeightmap = false
},
Scale = {
Type = "StaticScale",
Scale = 4.38
}
},
Renderable = {
Type = "RenderableModel",
GeometryFile = modelFolder .. "eiffeltower.osmodel",
ModelScale = "Centimeter",
RotationVector = { 0.0, 45.0, 0.0 },
LightSources = { sunAsset.LightSource }
},
GUI = {
Name = "Eiffel Tower",
Path = "/Scale Objects"
}
}
local updatePositionAction = {
Identifier = "os.drop_eiffel_tower",
Name = "Drop Eiffel Tower under camera",
Command = [[local lat, lon, alt = openspace.globebrowsing.getGeoPositionForCamera();
local camera = openspace.navigation.getNavigationState();
openspace.setParent('eiffelTower', camera.Anchor)
openspace.setPropertyValueSingle('Scene.eiffelTower.Translation.Globe', camera.Anchor);
openspace.setPropertyValueSingle('Scene.eiffelTower.Translation.Latitude', lat);
openspace.setPropertyValueSingle('Scene.eiffelTower.Translation.Longitude', lon);
openspace.setPropertyValueSingle('Scene.eiffelTower.Rotation.Globe', camera.Anchor);
openspace.setPropertyValueSingle('Scene.eiffelTower.Rotation.Latitude', lat);
openspace.setPropertyValueSingle('Scene.eiffelTower.Rotation.Longitude', lon);
]],
Documentation = "Updates the Eiffel Tower position based on the globe location of the camera",
GuiPath = "/Scale Objects",
IsLocal = false
Identifier = "os.drop_eiffel_tower",
Name = "Drop Eiffel Tower under camera",
Command = [[
local lat, lon, alt = openspace.globebrowsing.getGeoPositionForCamera();
local camera = openspace.navigation.getNavigationState();
openspace.setParent('eiffelTower', camera.Anchor)
openspace.setPropertyValueSingle('Scene.eiffelTower.Translation.Globe', camera.Anchor);
openspace.setPropertyValueSingle('Scene.eiffelTower.Translation.Latitude', lat);
openspace.setPropertyValueSingle('Scene.eiffelTower.Translation.Longitude', lon);
openspace.setPropertyValueSingle('Scene.eiffelTower.Rotation.Globe', camera.Anchor);
openspace.setPropertyValueSingle('Scene.eiffelTower.Rotation.Latitude', lat);
openspace.setPropertyValueSingle('Scene.eiffelTower.Rotation.Longitude', lon);
]],
Documentation = "Updates the Eiffel Tower position based on the globe location of the camera",
GuiPath = "/Scale Objects",
IsLocal = false
}
asset.onInitialize(function()
openspace.addSceneGraphNode(eiffelTower)
openspace.action.registerAction(updatePositionAction)
openspace.addSceneGraphNode(eiffelTower)
openspace.action.registerAction(updatePositionAction)
end)
asset.onDeinitialize(function()
openspace.action.removeAction(updatePositionAction)
openspace.removeSceneGraphNode(eiffelTower)
openspace.action.removeAction(updatePositionAction)
openspace.removeSceneGraphNode(eiffelTower)
end)
asset.export(eiffelTower)

View File

@@ -36,9 +36,12 @@ local planarGrid = {
Type = "RenderableGrid",
Color = { 0.0, 1.0, 0.8 },
LineWidth = 2.0,
Segments = { 5, 10 },
Segments = { 6, 10 },
Size = { 1, 2 },
Enabled = false
Enabled = false,
HighlightColor = {1.0, 0.8, 0.0 },
HighlightLineWidth = 3.2,
HighlightRate = { 3, 3 }
},
GUI = {
Name = "Example Grid",

View File

@@ -17,16 +17,20 @@ local object = {
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Labels = {
File = speck .. "abell.label",
Opacity = 1.0,
Color = { 0.0, 0.8, 0.0 },
Size = 22,
MinMaxSize = { 10, 12 },
Unit = "Mpc"
},
Color = { 1.0, 0.4, 0.2 },
Opacity = 1.0,
--ColorMap = speck .. "abell.cmap",
File = speck .. "abell.speck",
Texture = textures .. "point3A.png",
LabelFile = speck .. "abell.label",
Unit = "Mpc",
TextColor = { 0.0, 0.8, 0.0 },
TextSize = 22,
TextMinMaxSize = { 10, 12 },
TransformationMatrix = {
-0.7357425748, 0.67726129641, 0.0, 0.0,
-0.074553778365, -0.080991471307, 0.9939225904, 0.0,

View File

@@ -10,14 +10,17 @@ local object = {
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Labels = {
File = speck .. "stars-altlbl.label",
Color = { 0.4, 0.4, 0.4 },
Size = 14.7,
MinMaxSize = { 6, 20 },
Unit = "pc"
},
Color = { 1.0, 1.0, 1.0 },
Opacity = 0.65,
LabelFile = speck .. "stars-altlbl.label",
Unit = "pc",
TextColor = { 0.4, 0.4, 0.4 },
DrawLabels = true,
TextSize = 14.7,
TextMinMaxSize = { 6, 20 }
DrawLabels = true
},
GUI = {
Name = "Stars Labels - Alternate",
@@ -28,7 +31,7 @@ local object = {
attempts over thousands of years to name all the visible stars have led to two
main catalogs: Johann Bayer's Catalog from 1603 and John Flamsteed's Catalog
published in 1725. (Description from URL) <br><br> Data Reference: Various
sources]],
sources]]
}
}
@@ -36,11 +39,11 @@ local object = {
asset.onInitialize(function()
openspace.addSceneGraphNode(object)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(object)
end)
asset.export(object)

View File

@@ -10,14 +10,17 @@ local object = {
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Labels = {
File = speck .. "galclust.label",
Color = { 1.0, 0.44, 0.0 },
Size = 22,
MinMaxSize = { 8, 20 },
Unit = "Mpc"
},
Color = { 1.0, 1.0, 1.0 },
Opacity = 0.65,
LabelFile = speck .. "galclust.label",
Unit = "Mpc",
TextColor = { 1.0, 0.44, 0.0 },
DrawLabels = true,
TextSize = 22,
TextMinMaxSize = { 8, 20 },
TransformationMatrix = {
-0.7357425748, 0.67726129641, 0.0, 0.0,
-0.074553778365, -0.080991471307, 0.9939225904, 0.0,
@@ -39,11 +42,11 @@ local object = {
asset.onInitialize(function()
openspace.addSceneGraphNode(object)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(object)
end)
asset.export(object)

View File

@@ -1,7 +1,7 @@
local data = asset.syncedResource({
Name = "Constellation Bounds Data",
Name = "Constellation Files",
Type = "HttpSynchronization",
Identifier = "digitaluniverse_constellationbounds_data",
Identifier = "digitaluniverse_constellations_data",
Version = 1
})
@@ -16,8 +16,8 @@ local object = {
Type = "RenderableConstellationBounds",
Enabled = false,
File = data .. "bound_20.dat",
ConstellationFile = data .. "constellations.dat"
-- ConstellationSelection = zodiacs
NamesFile = data .. "constellations.dat",
-- Selection = zodiacs
},
Transform = {
Rotation = {
@@ -41,18 +41,18 @@ local object = {
asset.onInitialize(function()
openspace.addSceneGraphNode(object)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(object)
end)
asset.export(object)
asset.meta = {
Name = "Constellation Bounds",
Version = "1.1",
Version = "1.2",
Description = [[DU asset providing a Spherical mesh dividing the sky into regions that
fit the constellations]],
Author = "Brian Abbott (AMNH)",

View File

@@ -1,24 +1,34 @@
local speck = asset.syncedResource({
Name = "Constellation Speck Files",
Name = "Constellation Files",
Type = "HttpSynchronization",
Identifier = "digitaluniverse_constellations_speck",
Version = 2
Identifier = "digitaluniverse_constellations_data",
Version = 1
})
local zodiacs = {
"Cancer", "Taurus", "Pisces", "Aries", "Libra", "Aquarius", "Capricornus", "Scorpius",
"Virgo", "Sagittarius", "Gemini", "Leo"
}
local constellationsExtragalactic = {
Identifier = "ConstellationsExtragalactic",
Renderable = {
Type = "RenderableDUMeshes",
Type = "RenderableConstellationLines",
Enabled = false,
Labels = {
File = speck .. "constellationsEXGAL.label",
Opacity = 0.4,
Color = { 0.8, 0.8, 0.8 },
Size = 20.0,
MinMaxSize = { 20, 30 },
Unit = "Mpc",
},
Opacity = 0.4,
File = speck .. "constellationsEXGAL.speck",
LabelFile = speck .. "constellationsEXGAL.label",
TextColor = { 0.8, 0.8, 0.8 },
TextOpacity = 0.4,
TextSize = 20.0,
TextMinMaxSize = { 20, 30 },
MeshColor = { { 0.6, 0.4, 0.4 }, { 0.8, 0.0, 0.0 }, { 0.0, 0.3, 0.8 } },
Unit = "Mpc"
NamesFile = speck .. "constellations.dat",
Colors = { { 0.6, 0.4, 0.4 }, { 0.8, 0.0, 0.0 }, { 0.0, 0.3, 0.8 } },
Unit = "Mpc",
-- Selection = zodiacs
},
GUI = {
Name = "Constellations (Extragalactic)",
@@ -29,20 +39,25 @@ local constellationsExtragalactic = {
local constellations = {
Identifier = "Constellations",
Renderable = {
Type = "RenderableDUMeshes",
Type = "RenderableConstellationLines",
Enabled = false,
Labels = {
File = speck .. "constellations.label",
Opacity = 0.3,
Color = { 0.8, 0.8, 0.8 },
Size = 14.5,
MinMaxSize = { 8, 170 },
Unit = "pc",
},
Opacity = 0.3,
File = speck .. "constellations.speck",
LabelFile = speck .. "constellations.label",
TextColor = { 0.8, 0.8, 0.8 },
TextOpacity = 0.3,
TextSize = 14.5,
TextMinMaxSize = { 8, 170 },
MeshColor = { { 0.6, 0.4, 0.4 }, { 0.8, 0.0, 0.0 }, { 0.0, 0.3, 0.8 } },
Unit = "pc"
NamesFile = speck .. "constellations.dat",
Colors = { { 0.6, 0.4, 0.4 }, { 0.8, 0.0, 0.0 }, { 0.0, 0.3, 0.8 } },
Unit = "pc",
-- Selection = zodiacs
},
GUI = {
Name = "Constellations",
Name = "Constellations",
Path = "/Milky Way/Constellations",
Description = [[Census 88 constellations and labels. DU Version 2.3. <br> These
modern constellations are largely based on those of the Babylonians and
@@ -60,12 +75,12 @@ asset.onInitialize(function()
openspace.addSceneGraphNode(constellationsExtragalactic)
openspace.addSceneGraphNode(constellations)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(constellations)
openspace.removeSceneGraphNode(constellationsExtragalactic)
end)
asset.export(constellationsExtragalactic)
asset.export(constellations)
@@ -73,7 +88,7 @@ asset.export(constellations)
asset.meta = {
Name = "Constellations",
Version = "1.1",
Version = "1.2",
Description = "Digital Universe asset for constellation lines",
Author = "Brian Abbott (AMNH)",
URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe",

View File

@@ -17,6 +17,13 @@ local deepSkyPoints = {
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Labels = {
File = speck .. "dso.label",
Color = { 0.1, 0.4, 0.6 },
Size = 20.50,
MinMaxSize = { 16, 20 },
Unit = "pc"
},
Color = { 1.0, 1.0, 0.0 },
Opacity = 0.99,
ScaleFactor = 500.0,
@@ -27,11 +34,7 @@ local deepSkyPoints = {
--ColorOption = { "proximity" },
--ColorOption = { "prox5Mpc" },
--ColorRange = { { 1.0, 30.0 } },
LabelFile = speck .. "dso.label",
Unit = "pc",
TextColor = { 0.1, 0.4, 0.6 },
TextSize = 20.50,
TextMinMaxSize = { 16, 20 },
--FadeInDistances = { 0.05, 1.0 }, -- Fade in value in the same unit as "Unit"
BillboardMinMaxSize = { 0.0, 8.22 }, -- in pixels
--CorrectionSizeEndDistance = 22.0,
@@ -94,12 +97,12 @@ asset.onInitialize(function()
openspace.addSceneGraphNode(deepSkyPoints)
openspace.addSceneGraphNode(deepSkyImages)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(deepSkyImages)
openspace.removeSceneGraphNode(deepSkyPoints)
end)
asset.export(deepSkyPoints)
asset.export(deepSkyImages)

View File

@@ -17,18 +17,21 @@ local object = {
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Labels = {
File = speck .. "dwarfs.label",
Color = { 0.5, 0.1, 0.2 },
Size = 14.6,
MinMaxSize = { 10, 20 },
Unit = "pc"
},
Color = { 0.4, 0.0, 0.1 },
Opacity = 1.0,
File = speck .. "dwarfs.speck",
Texture = textures .. "point3.png",
LabelFile = speck .. "dwarfs.label",
Unit = "pc",
ColorMap = speck .. "dwarfs.cmap",
ColorOption = { "typeindex" },
--ColorRange = { { 1.0, 4.0} },
TextColor = { 0.5, 0.1, 0.2 },
TextSize = 14.6,
TextMinMaxSize = { 10, 20 },
ScaleFactor = 372.1,
--CorrectionSizeEndDistance = 16.1,
--CorrectionSizeFactor = 7.75,
@@ -61,11 +64,11 @@ local object = {
asset.onInitialize(function()
openspace.addSceneGraphNode(object)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(object)
end)
asset.export(object)

View File

@@ -17,17 +17,20 @@ local object = {
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Labels = {
File = speck .. "expl.label",
Color = { 0.3, 0.3, 0.8 },
Size = 14.8,
MinMaxSize = { 10, 100 },
Unit = "pc"
},
Color = { 1.0, 1.0, 1.0 },
Opacity = 1.0,
ScaleFactor = 10.0,
Texture = textures .. "target-blue.png",
File = speck .. "expl.speck",
LabelFile = speck .. "expl.label",
Unit = "pc",
ScaleFactor = 388.67923,
TextColor = { 0.3, 0.3, 0.8 },
TextSize = 14.8,
TextMinMaxSize = { 10, 100 },
CorrectionSizeEndDistance = 15.23,
CorrectionSizeFactor = 13.3,
BillboardMinMaxSize = { 0.0, 75.0 },
@@ -49,11 +52,11 @@ local object = {
asset.onInitialize(function()
openspace.addSceneGraphNode(object)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(object)
end)
asset.export(object)

View File

@@ -17,19 +17,22 @@ local object = {
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Labels = {
File = speck .. "gc.label",
Color = { 0.5, 0.5, 0.0 },
Size = 16.7,
MinMaxSize = { 4, 20 },
Unit = "pc"
},
Color = { 0.8, 0.8, 0.0 },
Opacity = 0.4,
File = speck .. "gc.speck",
Texture = textures .. "point4.png",
PolygonSides = 5,
LabelFile = speck .. "gc.label",
Unit = "pc",
TextColor = { 0.5, 0.5, 0.0 },
ScaleFactor = 431.0,
TextSize = 16.7,
TextMinMaxSize = { 4, 20 },
BillboardMinMaxSize = { 0.0, 500.0 },
EnablePixelSizeControl = true,
EnablePixelSizeControl = true
},
GUI = {
Name = "Globular Clusters",
@@ -53,11 +56,11 @@ local object = {
asset.onInitialize(function()
openspace.addSceneGraphNode(object)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(object)
end)
asset.export(object)

View File

@@ -20,6 +20,10 @@ local speck = asset.syncedResource({
Version = 2
})
local lightDay = 2.59020684E13
local lightMonth = 7.771E14
local lightYear = 9.4605284E15
local radio = {
Identifier = "RadioSphere",
Parent = earth_transforms.EarthBarycenter.Identifier,
@@ -106,14 +110,17 @@ local eclipticLabels = {
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Labels = {
File = speck .. "eclip.label",
Color = { 0.5, 0.5, 0.5 },
Size = 14.75,
MinMaxSize = { 1, 50 },
Unit = "pc"
},
Color = { 1.0, 1.0, 1.0 },
Opacity = 0.65,
LabelFile = speck .. "eclip.label",
Unit = "pc",
DrawLabels = true,
TextColor = { 0.5, 0.5, 0.5 },
TextSize = 14.75,
TextMinMaxSize = { 1, 50 },
TransformationMatrix = {
-0.05487554, 0.4941095, -0.8676661, 0.0,
-0.9938214 , -0.1109906, -0.0003515167, 0.0,
@@ -159,14 +166,17 @@ local equatorialLabels = {
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Labels = {
File = speck .. "radec.label",
Color = { 0.5, 0.5, 0.5 },
Size = 14.5,
MinMaxSize = { 2, 70 },
Unit = "pc"
},
Color = { 1.0, 1.0, 1.0 },
Opacity = 0.65,
LabelFile = speck .. "radec.label",
Unit = "pc",
DrawLabels = true,
TextColor = { 0.5, 0.5, 0.5 },
TextSize = 14.5,
TextMinMaxSize = { 2, 70 },
TransformationMatrix = {
-0.05487554, 0.4941095, -0.8676661, 0.0,
-0.8734371 , -0.4448296, -0.1980764, 0.0,
@@ -208,14 +218,17 @@ local galacticLabels = {
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Labels = {
File = speck .. "galac.label",
Color = { 0.5, 0.5, 0.5 },
Size = 15.8,
MinMaxSize = { 1, 100 },
Unit = "pc"
},
Color = { 1.0, 1.0, 1.0 },
Opacity = 0.65,
LabelFile = speck .. "galac.label",
Unit = "pc",
DrawLabels = true,
TextColor = { 0.5, 0.5, 0.5 },
TextSize = 15.8,
TextMinMaxSize = { 1, 100 }
DrawLabels = true
},
GUI = {
Name = "Galactic Sphere Labels",
@@ -233,16 +246,20 @@ local plane1ld = {
}
},
Renderable = {
Type = "RenderableDUMeshes",
Type = "RenderableGrid",
Enabled = false,
Labels = {
File = speck .. "1ld.label",
Color = { 0.0, 0.2, 0.5 },
Size = 10.3,
MinMaxSize = { 0, 30 },
Unit = "Km"
},
Opacity = 0.4,
File = speck .. "1ld.speck",
MeshColor = {{ 0.1, 0.5, 0.6 }},
LabelFile = speck .. "1ld.label",
TextColor = { 0.0, 0.2, 0.5 },
TextSize = 10.3,
TextMinMaxSize = { 0, 30 },
Unit = "Km"
Color = { 0.1, 0.5, 0.6 },
LineWidth = 2.0,
Segments = { 20, 20 },
Size = { 2*lightDay, 2*lightDay }
},
GUI = {
Name = "1ld Grid",
@@ -260,16 +277,20 @@ local plane1lm = {
}
},
Renderable = {
Type = "RenderableDUMeshes",
Type = "RenderableGrid",
Enabled = false,
Labels = {
File = speck .. "1lm.label",
Color = { 0.0, 0.2, 0.5 },
Size = 11.8,
MinMaxSize = { 0, 30 },
Unit = "pc"
},
Opacity = 0.4,
File = speck .. "1lm.speck",
MeshColor = {{ 0.1, 0.5, 0.6 }},
LabelFile = speck .. "1lm.label",
TextColor = { 0.0, 0.2, 0.5 },
TextSize = 11.8,
TextMinMaxSize = { 0, 30 },
Unit = "pc"
Color = { 0.1, 0.5, 0.6 },
LineWidth = 2.0,
Segments = { 20, 20 },
Size = { 2*lightMonth, 2*lightMonth }
},
GUI = {
Name = "1lm Grid",
@@ -287,16 +308,20 @@ local plane1ly = {
}
},
Renderable = {
Type = "RenderableDUMeshes",
Type = "RenderableGrid",
Enabled = false,
Labels = {
File = speck .. "1ly.label",
Color = { 0.0, 0.2, 0.5 },
Size = 13.0,
MinMaxSize = { 0, 30 },
Unit = "pc"
},
Opacity = 0.4,
File = speck .. "1ly.speck",
MeshColor = {{ 0.1, 0.5, 0.6 }},
LabelFile = speck .. "1ly.label",
TextColor = { 0.0, 0.2, 0.5 },
TextSize = 13.0,
TextMinMaxSize = { 0, 30 },
Unit = "pc"
Color = { 0.1, 0.5, 0.6 },
LineWidth = 2.0,
Segments = { 20, 20 },
Size = { 2*lightYear, 2*lightYear }
},
GUI = {
Name = "1ly Grid",
@@ -314,16 +339,20 @@ local plane10ly = {
}
},
Renderable = {
Type = "RenderableDUMeshes",
Type = "RenderableGrid",
Enabled = false,
Labels = {
File = speck .. "10ly.label",
Color = { 0.0, 0.2, 0.5 },
Size = 14.17,
MinMaxSize = { 0, 30 },
Unit = "pc"
},
Opacity = 0.4,
File = speck .. "10ly.speck",
MeshColor = {{ 0.1, 0.5, 0.6 }},
LabelFile = speck .. "10ly.label",
TextColor = { 0.0, 0.2, 0.5 },
TextSize = 14.17,
TextMinMaxSize = { 0, 30 },
Unit = "pc"
Color = { 0.1, 0.5, 0.6 },
LineWidth = 2.0,
Segments = { 20, 20 },
Size = { 10*2*lightYear, 10*2*lightYear }
},
GUI = {
Name = "10ly Grid",
@@ -341,16 +370,20 @@ local plane100ly = {
}
},
Renderable = {
Type = "RenderableDUMeshes",
Type = "RenderableGrid",
Enabled = false,
Labels = {
File = speck .. "100ly.label",
Color = { 0.0, 0.2, 0.5 },
Size = 15.0,
MinMaxSize = { 0, 30 },
Unit = "pc"
},
Opacity = 0.4,
File = speck .. "100ly.speck",
MeshColor = {{ 0.1, 0.5, 0.6 }},
LabelFile = speck .. "100ly.label",
TextColor = { 0.0, 0.2, 0.5 },
TextSize = 15.0,
TextMinMaxSize = { 0, 30 },
Unit = "pc"
Color = { 0.1, 0.5, 0.6 },
LineWidth = 2.0,
Segments = { 20, 20 },
Size = { 100*2*lightYear, 100*2*lightYear }
},
GUI = {
Name = "100ly Grid",
@@ -368,16 +401,20 @@ local plane1kly = {
}
},
Renderable = {
Type = "RenderableDUMeshes",
Type = "RenderableGrid",
Enabled = false,
Labels = {
File = speck .. "1kly.label",
Color = { 0.0, 0.2, 0.5 },
Size = 16.0,
MinMaxSize = { 0, 30 },
Unit = "pc"
},
Opacity = 0.4,
File = speck .. "1kly.speck",
MeshColor = {{ 0.1, 0.5, 0.6 }},
LabelFile = speck .. "1kly.label",
TextColor = { 0.0, 0.2, 0.5 },
TextSize = 16.0,
TextMinMaxSize = { 0, 30 },
Unit = "pc"
Color = { 0.1, 0.5, 0.6 },
LineWidth = 2.0,
Segments = { 20, 20 },
Size = { 1E3*2*lightYear, 1E3*2*lightYear }
},
GUI = {
Name = "1kly Grid",
@@ -395,16 +432,20 @@ local plane10kly = {
}
},
Renderable = {
Type = "RenderableDUMeshes",
Type = "RenderableGrid",
Enabled = false,
Labels = {
File = speck .. "10kly.label",
Color = { 0.0, 0.2, 0.5 },
Size = 17.25,
MinMaxSize = { 0, 30 },
Unit = "pc"
},
Opacity = 0.4,
File = speck .. "10kly.speck",
MeshColor = {{ 0.1, 0.5, 0.6 }},
LabelFile = speck .. "10kly.label",
TextColor = { 0.0, 0.2, 0.5 },
TextSize = 17.25,
TextMinMaxSize = { 0, 30 },
Unit = "pc"
Color = { 0.1, 0.5, 0.6 },
LineWidth = 2.0,
Segments = { 20, 20 },
Size = { 10E3*2*lightYear, 10E3*2*lightYear }
},
GUI = {
Name = "10kly Grid",
@@ -415,16 +456,22 @@ local plane10kly = {
local plane100kly = {
Identifier = "100klyGrid",
Renderable = {
Type = "RenderableDUMeshes",
Type = "RenderableGrid",
Enabled = false,
Labels = {
File = speck .. "100kly.label",
Color = { 0.0, 0.2, 0.5 },
Size = 18.6,
MinMaxSize = { 0, 30 },
Unit = "Mpc"
},
Opacity = 0.4,
File = speck .. "100kly.speck",
MeshColor = {{ 0.1, 0.5, 0.6 }},
LabelFile = speck .. "100kly.label",
TextColor = { 0.0, 0.2, 0.5 },
TextSize = 18.6,
TextMinMaxSize = { 0, 30 },
Unit = "Mpc"
Color = { 0.1, 0.5, 0.6 },
HighlightColor = { 0.3, 0.7, 0.8 },
LineWidth = 2.0,
Segments = { 20, 20 },
HighlightRate = { 5, 5 },
Size = { 100E3*2*lightYear, 100E3*2*lightYear }
},
GUI = {
Name = "100kly Grid",
@@ -435,16 +482,22 @@ local plane100kly = {
local plane1Mly = {
Identifier = "1MlyGrid",
Renderable = {
Type = "RenderableDUMeshes",
Type = "RenderableGrid",
Enabled = false,
Labels = {
File = speck .. "1Mly.label",
Color = { 0.0, 0.2, 0.5 },
Size = 19.6,
MinMaxSize = { 0, 30 },
Unit = "Mpc"
},
Opacity = 0.4,
File = speck .. "1Mly.speck",
MeshColor = {{ 0.1, 0.5, 0.6 }},
LabelFile = speck .. "1Mly.label",
TextColor = { 0.0, 0.2, 0.5 },
TextSize = 19.6,
TextMinMaxSize = { 0, 30 },
Unit = "Mpc"
Color = { 0.1, 0.5, 0.6 },
HighlightColor = { 0.3, 0.7, 0.8 },
LineWidth = 2.0,
Segments = { 20, 20 },
HighlightRate = { 5, 5 },
Size = { 1E6*2*lightYear, 1E6*2*lightYear }
},
GUI = {
Name = "1Mly Grid",
@@ -455,16 +508,22 @@ local plane1Mly = {
local plane10Mly = {
Identifier = "10MlyGrid",
Renderable = {
Type = "RenderableDUMeshes",
Type = "RenderableGrid",
Enabled = false,
Labels = {
File = speck .. "10Mly.label",
Color = { 0.0, 0.2, 0.5 },
Size = 20.6,
MinMaxSize = { 0, 30 },
Unit = "Mpc"
},
Opacity = 0.4,
File = speck .. "10Mly.speck",
MeshColor = {{ 0.1, 0.5, 0.6 }},
LabelFile = speck .. "10Mly.label",
TextColor = { 0.0, 0.2, 0.5 },
TextSize = 20.6,
TextMinMaxSize = { 0, 30 },
Unit = "Mpc"
Color = { 0.1, 0.5, 0.6 },
HighlightColor = { 0.3, 0.7, 0.8 },
LineWidth = 2.0,
Segments = { 20, 20 },
HighlightRate = { 5, 5 },
Size = { 10E6*2*lightYear, 10E6*2*lightYear }
},
GUI = {
Name = "10Mly Grid",
@@ -475,16 +534,22 @@ local plane10Mly = {
local plane100Mly = {
Identifier = "100MlyGrid",
Renderable = {
Type = "RenderableDUMeshes",
Type = "RenderableGrid",
Enabled = false,
Labels = {
File = speck .. "100Mly.label",
Color = { 0.0, 0.2, 0.5 },
Size = 21.6,
MinMaxSize = { 0, 30 },
Unit = "Mpc"
},
Opacity = 0.4,
File = speck .. "100Mly.speck",
MeshColor = {{ 0.1, 0.5, 0.6 }},
LabelFile = speck .. "100Mly.label",
TextColor = { 0.0, 0.2, 0.5 },
TextSize = 21.6,
TextMinMaxSize = { 0, 30 },
Unit = "Mpc"
Color = { 0.1, 0.5, 0.6 },
HighlightColor = { 0.3, 0.7, 0.8 },
LineWidth = 2.0,
Segments = { 20, 20 },
HighlightRate = { 5, 5 },
Size = { 100E6*2*lightYear, 100E6*2*lightYear }
},
GUI = {
Name = "100Mly Grid",
@@ -495,16 +560,22 @@ local plane100Mly = {
local plane20Gly = {
Identifier = "20GlyGrid",
Renderable = {
Type = "RenderableDUMeshes",
Type = "RenderableGrid",
Enabled = false,
Labels = {
File = speck .. "20Gly.label",
Color = { 0.0, 0.2, 0.5 },
Size = 23.6,
MinMaxSize = { 0, 30 },
Unit = "Mpc"
},
Opacity = 0.4,
File = speck .. "20Gly.speck",
MeshColor = {{ 0.1, 0.5, 0.6 }},
LabelFile = speck .. "20Gly.label",
TextColor = { 0.0, 0.2, 0.5 },
TextSize = 23.6,
TextMinMaxSize = { 0, 30 },
Unit = "Mpc"
Color = { 0.1, 0.5, 0.6 },
HighlightColor = { 0.3, 0.7, 0.8 },
LineWidth = 2.0,
Segments = { 40, 40 },
HighlightRate = { 5, 5 },
Size = { 20E9*2*lightYear, 20E9*2*lightYear }
},
GUI = {
Name = "20Gly Grid",
@@ -524,7 +595,7 @@ asset.onInitialize(function()
openspace.addSceneGraphNode(node)
end
end)
asset.onDeinitialize(function()
for i = #nodes, 1, -1 do
local node = nodes[i]

View File

@@ -10,14 +10,17 @@ local object = {
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Labels = {
File = speck .. "groups.label",
Color = { 0.1, 0.6, 0.2 },
Size = 21.5,
MinMaxSize = { 8, 20 },
Unit = "Mpc"
},
Color = { 1.0, 1.0, 1.0 },
Opacity = 0.65,
--ScaleFactor = 10.0,
LabelFile = speck .. "groups.label",
Unit = "Mpc",
TextColor = { 0.1, 0.6, 0.2 },
TextSize = 21.5,
TextMinMaxSize = { 8, 20 },
DrawLabels = true,
TransformationMatrix = {
-0.7357425748, 0.67726129641, 0.0, 0.0,
@@ -39,11 +42,11 @@ local object = {
asset.onInitialize(function()
openspace.addSceneGraphNode(object)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(object)
end)
asset.export(object)

View File

@@ -17,17 +17,20 @@ local object = {
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Labels = {
File = speck .. "h2.label",
Color = { 0.5, 0.5, 0.5 },
Size = 16.24,
MinMaxSize = { 4, 20 },
Unit = "pc"
},
Color = { 0.0, 0.5, 1.0 },
Opacity = 0.70,
File = speck .. "h2.speck",
Texture = textures .. "point4.png",
PolygonSides = 6,
LabelFile = speck .. "h2.label",
Unit = "pc",
TextColor = { 0.5, 0.5, 0.5 },
ScaleFactor = 420,
TextSize = 16.24,
TextMinMaxSize = { 4, 20 },
BillboardMinMaxSize = { 0.0, 300.0 },
EnablePixelSizeControl = false
},
@@ -44,18 +47,18 @@ local object = {
Because of this, they are great tracers of the spiral arms of the Galaxy, and
were instrumental in our understanding of the Galaxy's overall structure
(Description from URL) <br><br> Data Reference: The WISE catalog of Galactic
HII Regions (Anderson+, 2014)]],
HII Regions (Anderson+, 2014)]]
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(object)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(object)
end)
asset.export(object)

View File

@@ -17,6 +17,13 @@ local object = {
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Labels = {
File = speck .. "localgroup.label",
Color = { 0.3, 0.3, 1.0 },
Size = 18.3,
MinMaxSize = { 7, 20 },
Unit = "Mpc"
},
Color = { 0.5, 1.0, 0.2 },
ColorMap = speck .. "localgroup.cmap",
ColorOption = { "association" },
@@ -24,12 +31,8 @@ local object = {
File = speck .. "localgroup.speck",
Texture = textures .. "point4.png",
PolygonSides = 12,
LabelFile = speck .. "localgroup.label",
Unit = "Mpc",
TextColor = { 0.3, 0.3, 1.0 },
ScaleFactor = 465,
TextSize = 18.3,
TextMinMaxSize = { 7, 20 },
BillboardMinMaxSize = { 0.0, 20.0 },
EnablePixelSizeControl = true
},
@@ -46,18 +49,18 @@ local object = {
bevy of dwarf galaxies-smaller, often irregular galaxies, that contain
hundreds of millions to a few billion stars. (Description from URL) <br><br>
Data Reference: Properties of dwarf galaxies in the Local Group
(McConnachie+, 2012)]],
(McConnachie+, 2012)]]
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(object)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(object)
end)
asset.export(object)

View File

@@ -10,15 +10,18 @@ local homeLabel = {
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Labels = {
File = homespeck .. "home.label",
Color = { 0.8, 0.8, 0.8 },
Size = 20.50,
MinMaxSize = { 16, 20 },
Unit = "Mpc"
},
Color = { 1.0, 0.4, 0.2 },
Opacity = 0.99,
ScaleFactor = 500.0,
DrawLabels = true,
LabelFile = homespeck .. "home.label",
Unit = "Mpc",
TextColor = { 0.8, 0.8, 0.8 },
TextSize = 20.50,
TextMinMaxSize = { 16, 20 },
TransformationMatrix = {
-0.7357425748, 0.67726129641, 0.0, 0.0,
-0.074553778365, -0.080991471307, 0.9939225904, 0.0,
@@ -32,18 +35,18 @@ local homeLabel = {
GUI = {
Name = "Home Label",
Path = "/Universe/Galaxies",
Description = "Label for the Milky Way titled 'Home', sided for the galactic level",
Description = "Label for the Milky Way titled 'Home', sided for the galactic level"
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(homeLabel)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(homeLabel)
end)
asset.export(homeLabel)

View File

@@ -17,6 +17,13 @@ local object = {
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Labels = {
File = speck .. "ob.label",
Color = { 0.4, 0.5, 1.0 },
Size = 16.24,
MinMaxSize = { 4, 25 },
Unit = "pc"
},
Color = { 1.0, 1.0, 1.0 },
ColorMap = speck .. "ob.cmap",
ColorOption = { "arm" },
@@ -27,11 +34,7 @@ local object = {
Unit = "pc",
Texture = textures .. "point4.png",
PolygonSides = 7,
LabelFile = speck .. "ob.label",
TextColor = { 0.4, 0.5, 1.0 },
ScaleFactor = 390.0,
TextSize = 16.24,
TextMinMaxSize = { 4, 25 },
BillboardMinMaxSize = { 0.0, 450.0 },
EnablePixelSizeControl = true
},
@@ -48,18 +51,18 @@ local object = {
coded by their spiral arm membership. Blue associations trace the Sagittarius
Arm. Purple associations are in the local Orion Spur. Orange associations are
in the Perseus Arm (Description from URL) <br><br> Data Reference: New List of
OB Associations (Melnik+)]],
OB Associations (Melnik+)]]
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(object)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(object)
end)
asset.export(object)

View File

@@ -17,17 +17,20 @@ local object = {
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Labels = {
File = speck .. "oc.label",
Color = { 0.05, 0.4, 0.2 },
Size = 15.5,
MinMaxSize = { 4, 30 },
Unit = "pc"
},
Color = { 0.1, 0.8, 0.4 },
Opacity = 0.5,
File = speck .. "oc.speck",
Unit = "pc",
Texture = textures .. "point4.png",
PolygonSides = 12,
TextColor = { 0.05, 0.4, 0.2 },
LabelFile = speck .. "oc.label",
ScaleFactor = 405.75,
TextSize = 15.5,
TextMinMaxSize = { 4, 30 },
BillboardMinMaxSize = { 0.0, 604.0 },
EnablePixelSizeControl = true
},
@@ -48,18 +51,18 @@ local object = {
as Galactic clusters, but this term fell out of favor once astronomers
began to understand that the Galaxy includes objects beyond the
Milky Way's disk. <br><br> Data Reference: Optically
visible open clusters and Candidates (Dias+ 2002-2015)]],
visible open clusters and Candidates (Dias+ 2002-2015)]]
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(object)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(object)
end)
asset.export(object)

View File

@@ -17,17 +17,20 @@ local object = {
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Labels = {
File = speck .. "pn.label",
Color = { 0.25, 0.25, 0.65 },
Size = 16.24,
MinMaxSize = { 4, 25 },
Unit = "pc"
},
Color = { 0.4, 0.4, 0.9 },
Opacity = 0.65,
File = speck .. "pn.speck",
Texture = textures .. "point4.png",
PolygonSides = 3,
LabelFile = speck .. "pn.label",
Unit = "pc",
TextColor = { 0.25, 0.25, 0.65 },
ScaleFactor = 425.0,
TextSize = 16.24,
TextMinMaxSize = { 4, 25 },
BillboardMinMaxSize = { 0.0, 500.0 },
EnablePixelSizeControl = true
},
@@ -41,18 +44,18 @@ local object = {
way are they related to planets, rather, they are products of dying stars.
(Description from URL) <br><br> Data Reference: Planetary Nebulae distances
in Gaia DR2 (Kimeswenger+, 2018), Strasbourg-ESO Catalog of Planetary Nebulae
(Acker+ 1992)]],
(Acker+ 1992)]]
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(object)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(object)
end)
asset.export(object)

View File

@@ -17,17 +17,20 @@ local object = {
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Labels = {
File = speck .. "pulsar.label",
Color = { 0.7, 0.2, 0.2 },
Size = 15.77,
MinMaxSize = { 4, 20 },
Unit = "pc"
},
Color = { 0.7, 0.0, 0.0 },
Opacity = 1.0,
File = speck .. "pulsar.speck",
Texture = textures .. "point4.png",
PolygonSides = 4,
LabelFile = speck .. "pulsar.label",
Unit = "pc",
TextColor = { 0.7, 0.2, 0.2 },
ScaleFactor = 424,
TextSize = 15.77,
TextMinMaxSize = { 4, 20 },
BillboardMinMaxSize = { 0.0, 500.0 },
EnablePixelSizeControl = false
},
@@ -45,18 +48,18 @@ local object = {
cannot be packed any tighter. At this point, the star has a radius of about
10-15 kilometers. The density of this material is so high that a teaspoonful
would weigh about 100 million tons on Earth. (Description from URL) <br><br>
Data Reference: ATNF Pulsar Catalogue, (Manchester+, 2005)]],
Data Reference: ATNF Pulsar Catalogue, (Manchester+, 2005)]]
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(object)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(object)
end)
asset.export(object)

View File

@@ -10,30 +10,33 @@ local object = {
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Labels = {
File = speck .. "stars.label",
Color = { 0.4, 0.4, 0.4 },
Size = 14.7,
MinMaxSize = { 6, 50 },
Unit = "pc"
},
Color = { 1.0, 1.0, 1.0 },
Opacity = 0.65,
LabelFile = speck .. "stars.label",
Unit = "pc",
TextColor = { 0.4, 0.4, 0.4 },
DrawLabels = true,
TextSize = 14.7,
TextMinMaxSize = { 6, 50 }
DrawLabels = true
},
GUI = {
Name = "Stars Labels",
Path = "/Milky Way/Stars",
Description = "Labels for stars in the Milky Way. See 'Stars' for more info",
Description = "Labels for stars in the Milky Way. See 'Stars' for more info"
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(object)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(object)
end)
asset.export(object)

View File

@@ -17,19 +17,22 @@ local object = {
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Labels = {
File = speck .. "superclust.label",
Color = { 0.9, 0.9, 0.9 },
Size = 22.44,
MinMaxSize = { 8, 20 },
Unit = "Mpc"
},
DrawElements = false,
Color = { 1.0, 1.0, 1.0 },
Opacity = 0.65,
File = speck .. "superclust.speck",
Texture = textures .. "point3A.png",
LabelFile = speck .. "superclust.label",
Unit = "Mpc",
TextColor = { 0.9, 0.9, 0.9 },
ScaleFactor = 531.0,
TextSize = 22.44,
TextMinMaxSize = { 8, 20 },
DrawLabels = true,
--BillboardMinMaxSize = { 0.0, 7.2 },
-- BillboardMinMaxSize = { 0.0, 7.2 },
EnablePixelSizeControl = true
},
GUI = {
@@ -47,11 +50,11 @@ local object = {
asset.onInitialize(function()
openspace.addSceneGraphNode(object)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(object)
end)
asset.export(object)

View File

@@ -17,17 +17,20 @@ local object = {
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Labels = {
File = speck .. "snr.label",
Color = { 0.6, 0.46, 0.0 },
Size = 16.44,
MinMaxSize = { 4, 100 },
Unit = "pc"
},
Color = { 1.0, 0.5, 0.0 },
Opacity = 0.32,
File = speck .. "snr.speck",
Texture = textures .. "point4.png",
PolygonSides = 7,
LabelFile = speck .. "snr.label",
Unit = "pc",
TextColor = { 0.6, 0.46, 0.0 },
ScaleFactor = 424,
TextSize = 16.44,
TextMinMaxSize = { 4, 100 },
--CorrectionSizeEndDistance = 17.5,
--CorrectionSizeFactor = 13.96,
BillboardMinMaxSize = { 0.0, 500.0 },
@@ -40,18 +43,18 @@ local object = {
remnant is the ejected gas that results from a supernova. It glows for a
cosmically short period of time before mixing with the interstellar medium.
(Description from URL) <br><br> Data Reference: The First Fermi LAT SNR
Catalog (Acero+, 2016)]],
Catalog (Acero+, 2016)]]
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(object)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(object)
end)
asset.export(object)

View File

@@ -17,6 +17,13 @@ local tullyPoints = {
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = true,
Labels = {
File = speck .. "tully.label",
Color = { 0.7, 0.7, 0.7 },
Size = 19.36,
MinMaxSize = { 8, 20 },
Unit = "Mpc"
},
Color = { 1.0, 0.4, 0.2 },
Opacity = 0.99,
ScaleFactor = 504.0,
@@ -27,12 +34,8 @@ local tullyPoints = {
--ColorOption = { "proximity" },
ColorOption = { "prox5Mpc" },
ColorRange = { { 1.0, 30.0 } },
LabelFile = speck .. "tully.label",
DrawLabels = false,
Unit = "Mpc",
TextColor = { 0.7, 0.7, 0.7 },
TextSize = 19.36,
TextMinMaxSize = { 8, 20 },
TransformationMatrix = {
-0.7357425748, 0.67726129641, 0.0, 0.0,
-0.074553778365, -0.080991471307, 0.9939225904, 0.0,
@@ -110,12 +113,12 @@ asset.onInitialize(function()
openspace.addSceneGraphNode(tullyPoints)
openspace.addSceneGraphNode(tullyImages)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(tullyImages)
openspace.removeSceneGraphNode(tullyPoints)
end)
asset.export(tullyPoints)
asset.export(tullyImages)

View File

@@ -10,15 +10,18 @@ local object = {
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Labels = {
File = speck .. "voids.label",
Color = { 0.296, 0.629, 1.0 },
Size = 20.9,
MinMaxSize = { 8, 20 },
Unit = "Mpc"
},
DrawElements = false,
DrawLabels = true,
Color = { 1.0, 1.0, 1.0 },
Opacity = 0.65,
LabelFile = speck .. "voids.label",
Unit = "Mpc",
TextColor = { 0.296, 0.629, 1.0 },
TextSize = 20.9,
TextMinMaxSize = { 8, 20 }
Unit = "Mpc"
},
GUI = {
Name = "Voids",
@@ -39,11 +42,11 @@ local object = {
asset.onInitialize(function()
openspace.addSceneGraphNode(object)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(object)
end)
asset.export(object)

View File

@@ -2,12 +2,48 @@ local constellationsCSV = asset.localResource("constellation_data.csv")
local transforms = asset.require("scene/solarsystem/sun/transforms")
local images = asset.syncedResource({
Name = "Constellation Images",
Type = "HttpSynchronization",
Identifier = "constellation_images",
Version = 4
Name = "Constellation Images",
Type = "HttpSynchronization",
Identifier = "constellation_images",
Version = 4
})
local data = asset.syncedResource({
Name = "Constellation Files",
Type = "HttpSynchronization",
Identifier = "digitaluniverse_constellations_data",
Version = 1
})
-- Function that returns the full name of a constellation given its abbreviation
-- The function uses the constellations.dat file to find the name
-- If the file does not exist or if a match could not be found, it returns nil
local findFullName = function(abbreviation)
local namesFile = data .. "constellations.dat"
local file = io.open(namesFile, "r")
if file ~= nil then
io.close(file)
for line in io.lines(namesFile) do
local index, length = string.find(line, abbreviation)
if index ~= nil and index < 4 then
return string.sub(line, length + 1)
end
local fullLine = line
local lowerLine = string.lower(line)
index, length = string.find(lowerLine, string.lower(abbreviation))
if index ~= nil and index < 4 then
return string.sub(fullLine, length + 1)
end
end
end
return nil
end
--function that reads the file
local createConstellations = function (baseIdentifier, guiPath, constellationfile)
local genConstellations = {};
@@ -30,6 +66,13 @@ local createConstellations = function (baseIdentifier, guiPath, constellationfil
local normy = y/magVec
local normz = z/magVec
-- Use the full name in the data constellations.dat if possible
-- Otherwise, use the given name in the constellation_data.csv file
local foundName = findFullName(abbreviation)
if foundName ~= nil then
name = foundName
end
group = (group == "" and globe or group)
local aconstellation = {
@@ -172,7 +215,7 @@ end
asset.meta = {
Name = "Constellation Images",
Version = "1.1",
Version = "1.2",
Description = "Artistic images depicting the constellations",
Author = "James Hedberg",
URL = "http://jameshedberg.com",

View File

@@ -54,7 +54,7 @@ local PlutoLabel = {
Parent = Pluto.Identifier,
Renderable = {
Enabled = false,
Type = "RenderableLabels",
Type = "RenderableLabel",
Text = "Pluto",
FontSize = 70.0,
Size = 9.05,

View File

@@ -131,7 +131,7 @@ local JWSTLabel = {
End = endTime
},
Renderable = {
Type = "RenderableLabels",
Type = "RenderableLabel",
Text = "JWST",
FontSize = 50,
Size = 6.5,

View File

@@ -50,13 +50,15 @@ local function createForwardTimelapse()
-- array complete
openspace.scriptScheduler.loadScheduledScript("]] ..
advance(launchTime, 0, 0, 30, 42) .. [[",
"openspace.time.interpolateDeltaTime(7200)" ..
"openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 2 hours/second\")"
"openspace.time.interpolateDeltaTime(2400)" ..
"openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 40 minutes/second\")"
)
-- Make night layer more visible, at around 14:00
openspace.scriptScheduler.loadScheduledScript("]] ..
advance(detachTime, 0, 1, 10, 0) .. [[",
"openspace.time.interpolateDeltaTime(7200)" ..
"openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 2 hours/second\")" ..
"openspace.setPropertyValueSingle(\"Scene.Earth.Renderable.Layers.NightLayers.Earth_at_Night_2012.Settings.Gamma\", 0.7)" ..
"openspace.setPropertyValueSingle(\"Scene.EarthAtmosphere.Renderable.Enabled\", false)"
)
@@ -280,8 +282,10 @@ local function createBackwardTimelapse()
-- Reset night layer, at around 14:00
openspace.scriptScheduler.loadScheduledScript("]] ..
advance(detachTime, 0, 1, 10, 0) .. [[",
advance(detachTime, 0, 1 + 1, 10, 0) .. [[", -- 1h pre delay so time to interpolate
"",
"openspace.time.interpolateDeltaTime(-2400)" ..
"openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -40 minutes/second\")" ..
"openspace.setPropertyValueSingle(\"Scene.Earth.Renderable.Layers.NightLayers.Earth_at_Night_2012.Settings.Gamma\", 1.0)" ..
"openspace.setPropertyValueSingle(\"Scene.EarthAtmosphere.Renderable.Enabled\", true)"
)
@@ -520,6 +524,8 @@ local function createActions()
openspace.scriptScheduler.clear(0)
openspace.time.setDeltaTime(1)
openspace.setPropertyValueSingle("Dashboard.JWSTStateText.Text", "")
openspace.setPropertyValueSingle("Scene.Earth.Renderable.Layers.NightLayers.Earth_at_Night_2012.Settings.Gamma", 1.0)
openspace.setPropertyValueSingle("Scene.EarthAtmosphere.Renderable.Enabled", true)
openspace.time.setTime("]] .. detachTime .. [[")
]] .. createForwardTimelapse() .. [[
openspace.time.setDeltaTime(1)

View File

@@ -16,7 +16,7 @@ local toggle_trail = {
local launchTrail = "JWSTTrailLaunch"
local cruiseTrail = "JWSTTrailCruise"
local orbitTrail = "JWSTTrailOrbit"
local coRevOrbitTrail = "JWSTTrailCoRevOrbit"
local visibility
if is_declared("args") then
@@ -31,7 +31,7 @@ local toggle_trail = {
visibility = not (
openspace.getPropertyValue("Scene." .. launchTrail .. ".Renderable.Enabled") or
openspace.getPropertyValue("Scene." .. cruiseTrail .. ".Renderable.Enabled") or
openspace.getPropertyValue("Scene." .. orbitTrail .. ".Renderable.Enabled")
openspace.getPropertyValue("Scene." .. coRevOrbitTrail .. ".Renderable.Enabled")
)
end
@@ -44,7 +44,7 @@ local toggle_trail = {
visibility
)
openspace.setPropertyValueSingle(
"Scene." .. orbitTrail .. ".Renderable.Enabled",
"Scene." .. coRevOrbitTrail .. ".Renderable.Enabled",
visibility
)
]],

View File

@@ -28,12 +28,12 @@ local JWSTTrailLaunch = {
Renderable = {
Type = "RenderableTrailTrajectory",
Translation = {
Type = 'SpiceTranslation',
Target = 170, -- JWST
Observer = 'EARTH',
Frame = 'IAU_EARTH',
Kernels = { kernels .. "webb.bsp" }
},
Type = 'SpiceTranslation',
Target = 170, -- JWST
Observer = 'EARTH',
Frame = 'IAU_EARTH',
Kernels = { kernels .. "webb.bsp" }
},
Color = { 0.9, 0.9, 0.0 },
StartTime = launchTime,
EndTime = detachTime,
@@ -61,12 +61,12 @@ local JWSTTrailCruise = {
Renderable = {
Type = "RenderableTrailTrajectory",
Translation = {
Type = 'SpiceTranslation',
Target = 170, -- JWST
Observer = 'EARTH',
Frame = 'GALACTIC',
Kernels = { kernels .. "webb.bsp" }
},
Type = 'SpiceTranslation',
Target = 170, -- JWST
Observer = 'EARTH',
Frame = 'GALACTIC',
Kernels = { kernels .. "webb.bsp" }
},
Color = { 0.9, 0.9, 0.0 },
StartTime = detachTime,
EndTime = L2orbitInsertionTime,
@@ -83,9 +83,10 @@ local JWSTTrailCruise = {
-- Trail of JWST relative to L2 after first month to reach L2
-- Gives a better trail history of the orbit around L2 than if it was relative to Earth
-- This does NOT co-rotate with L2 and gives a saddle look of the trail
local JWSTTrailOrbit = {
Identifier = "JWSTTrailOrbit",
Parent = transforms.L2.Identifier,
Parent = transforms.L2Position.Identifier,
TimeFrame = {
Type = "TimeFrameInterval",
Start = L2orbitInsertionTime,
@@ -94,13 +95,13 @@ local JWSTTrailOrbit = {
Renderable = {
Type = "RenderableTrailOrbit",
Translation = {
Type = 'SpiceTranslation',
Target = 170, -- JWST
Observer = 392, -- L2
Frame = 'GALACTIC',
Kernels = { kernels .. "webb.bsp" }
},
Color = { 0.9, 0.9, 0.0 },
Type = 'SpiceTranslation',
Target = 170, -- JWST
Observer = 392, -- L2
Frame = 'GALACTIC',
Kernels = { kernels .. "webb.bsp" }
},
Color = { 0.863, 0.0, 0.902 },
Period = 182.621099, -- About 6 months
Resolution = 183 -- About a sample rate of once per day
},
@@ -113,6 +114,38 @@ local JWSTTrailOrbit = {
}
}
-- Trail of JWST in orbit around L2 that co-revolves with L2 around the Sun
-- This gives the trail a look of a wheel going along L2 around the Sun
local JWSTTrailCoRevOrbit = {
Identifier = "JWSTTrailCoRevOrbit",
Parent = transforms.L2CoRevFrame.Identifier,
TimeFrame = {
Type = "TimeFrameInterval",
Start = L2orbitInsertionTime,
End = endTime
},
Renderable = {
Type = "RenderableTrailOrbit",
Translation = {
Type = 'SpiceTranslation',
Target = 170, -- JWST
Observer = 392, -- L2
Frame = 'L2_COREV',
Kernels = { kernels .. "webb.bsp" }
},
Color = { 1.0, 0.663, 0.157 },
Period = 365.242198, -- About a year, 2 orbits. 1 orbit would be 182.621099 (6 months)
Resolution = 365 -- About a sample rate of once per day
},
GUI = {
Name = "JWST L2 Co-revolving Orbit Trail",
Path = "/Solar System/Missions/JWST/Trails",
Description = [[
James Webb Space Telescope Orbit Trail that Co-revolves with L2.
]],
}
}
local JWSTSunTrail = {
Identifier = "JWSTSunTrail",
Parent = sunTransforms.SolarSystemBarycenter.Identifier,
@@ -124,12 +157,12 @@ local JWSTSunTrail = {
Renderable = {
Type = "RenderableTrailOrbit",
Translation = {
Type = 'SpiceTranslation',
Target = 170, -- JWST
Observer = 'SSB',
Frame = 'GALACTIC',
Kernels = { kernels .. "webb.bsp" }
},
Type = 'SpiceTranslation',
Target = 170, -- JWST
Observer = 'SSB',
Frame = 'GALACTIC',
Kernels = { kernels .. "webb.bsp" }
},
Color = { 0.0, 0.9, 0.9 },
Period = 365.242,
Resolution = 365 -- About a sample rate of once per day
@@ -147,11 +180,13 @@ asset.onInitialize(function()
openspace.addSceneGraphNode(JWSTTrailLaunch)
openspace.addSceneGraphNode(JWSTTrailCruise)
openspace.addSceneGraphNode(JWSTTrailOrbit)
openspace.addSceneGraphNode(JWSTTrailCoRevOrbit)
openspace.addSceneGraphNode(JWSTSunTrail)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(JWSTSunTrail)
openspace.removeSceneGraphNode(JWSTTrailCoRevOrbit)
openspace.removeSceneGraphNode(JWSTTrailOrbit)
openspace.removeSceneGraphNode(JWSTTrailCruise)
openspace.removeSceneGraphNode(JWSTTrailLaunch)
@@ -160,6 +195,7 @@ end)
asset.export(JWSTTrailLaunch)
asset.export(JWSTTrailCruise)
asset.export(JWSTTrailOrbit)
asset.export(JWSTTrailCoRevOrbit)
asset.export(JWSTSunTrail)

View File

@@ -53,7 +53,7 @@ local EarthLabel = {
Parent = Earth.Identifier,
Renderable = {
Enabled = false,
Type = "RenderableLabels",
Type = "RenderableLabel",
Text = "Earth",
FontSize = 70.0,
Size = 8.77,

View File

@@ -56,7 +56,7 @@ local L1Label = {
Identifier = "L1Label",
Parent = L1Position.Identifier,
Renderable = {
Type = "RenderableLabels",
Type = "RenderableLabel",
Text = "L1",
FontSize = 50,
Size = 7.5,

View File

@@ -12,7 +12,7 @@ local kernels = asset.syncedResource({
Name = "Lagrange Kernels",
Type = "HttpSynchronization",
Identifier = "earth_lagrange_kernels",
Version = 1
Version = 2
})
local L2Position = {
@@ -34,6 +34,30 @@ local L2Position = {
}
}
-- This ref. frame co-revolves with L2 and is needed for a more intuitive trail of JWST in
-- relation to L2
local L2CoRevFrame = {
Identifier = "L2CoRevFrame",
Parent = L2Position.Identifier,
Transform = {
Rotation = {
Type = "SpiceRotation",
SourceFrame = "L2_COREV",
DestinationFrame = 'GALACTIC',
Kernels = {
kernels .. "L2_de431.bsp",
kernels .. "L2_corev.tf"
}
}
},
Tag = { "lagrange_points_earth", "lagrange_points_earth_l2" },
GUI = {
Name = "L2 Co-revolving Reference Frame",
Path = "/Solar System/Planets/Earth/Lagrange points",
Hidden = true
}
}
local L2Small = {
Identifier = "L2Small",
Parent = L2Position.Identifier,
@@ -74,7 +98,7 @@ local L2SmallLabel = {
Identifier = "L2SmallLabel",
Parent = L2Position.Identifier,
Renderable = {
Type = "RenderableLabels",
Type = "RenderableLabel",
Text = "L2",
FontSize = 50.0,
Size = 6.0,
@@ -95,7 +119,7 @@ local L2Label = {
Identifier = "L2Label",
Parent = L2Position.Identifier,
Renderable = {
Type = "RenderableLabels",
Type = "RenderableLabel",
Text = "L2",
FontSize = 50,
Size = 7.5,
@@ -131,6 +155,7 @@ local L2SunLine = {
local nodes = {
L2Position,
L2CoRevFrame,
L2Small,
L2,
L2SunLine,

View File

@@ -56,7 +56,7 @@ local L4Label = {
Identifier = "L4Label",
Parent = L4Position.Identifier,
Renderable = {
Type = "RenderableLabels",
Type = "RenderableLabel",
Text = "L4",
FontSize = 50,
Size = 8.5,

View File

@@ -56,7 +56,7 @@ local L5Label = {
Identifier = "L5Label",
Parent = L5Position.Identifier,
Renderable = {
Type = "RenderableLabels",
Type = "RenderableLabel",
Text = "L5",
FontSize = 50,
Size = 8.5,

View File

@@ -99,7 +99,7 @@ local IssLabel = {
Parent = iss.Identifier,
Renderable = {
Enabled = false,
Type = "RenderableLabels",
Type = "RenderableLabel",
Text = "ISS",
FontSize = 70.0,
Size = 3.4,

View File

@@ -63,7 +63,7 @@ local AquaLabel = {
Parent = Aqua.Identifier,
Renderable = {
Enabled = false,
Type = "RenderableLabels",
Type = "RenderableLabel",
Text = "Aqua",
FontSize = 70.0,
Size = 4.0,

View File

@@ -61,7 +61,7 @@ local SNPPLabel = {
Parent = SNPP.Identifier,
Renderable = {
Enabled = false,
Type = "RenderableLabels",
Type = "RenderableLabel",
Text = "SNPP",
FontSize = 70.0,
Size = 4.0,

View File

@@ -64,7 +64,7 @@ local TerraLabel = {
Parent = Terra.Identifier,
Renderable = {
Enabled = false,
Type = "RenderableLabels",
Type = "RenderableLabel",
Text = "Terra",
FontSize = 70.0,
Size = 4.0,

View File

@@ -45,7 +45,7 @@ local JupiterLabel = {
Parent = Jupiter.Identifier,
Renderable = {
Enabled = false,
Type = "RenderableLabels",
Type = "RenderableLabel",
Text = "Jupiter",
FontSize = 70.0,
Size = 8.77,

View File

@@ -58,7 +58,7 @@ local MarsLabel = {
Parent = Mars.Identifier,
Renderable = {
Enabled = false,
Type = "RenderableLabels",
Type = "RenderableLabel",
Text = "Mars",
FontSize = 70.0,
Size = 8.66,

View File

@@ -56,7 +56,7 @@ local MercuryLabel = {
Parent = Mercury.Identifier,
Renderable = {
Enabled = false,
Type = "RenderableLabels",
Type = "RenderableLabel",
Text = "Mercury",
FontSize = 70.0,
Size = 8.46,

View File

@@ -36,7 +36,7 @@ local NeptuneLabel = {
Parent = Neptune.Identifier,
Renderable = {
Enabled = false,
Type = "RenderableLabels",
Type = "RenderableLabel",
Text = "Neptune",
FontSize = 70.0,
Size = 8.96,

View File

@@ -64,7 +64,7 @@ local SaturnLabel = {
Parent = Saturn.Identifier,
Renderable = {
Enabled = false,
Type = "RenderableLabels",
Type = "RenderableLabel",
Text = "Saturn",
FontSize = 70.0,
Size = 8.85,

View File

@@ -36,7 +36,7 @@ local UranusLabel = {
Parent = Uranus.Identifier,
Renderable = {
Enabled = false,
Type = "RenderableLabels",
Type = "RenderableLabel",
Text = "Uranus",
FontSize = 70.0,
Size = 8.86,

View File

@@ -61,7 +61,7 @@ local VenusLabel = {
Parent = Venus.Identifier,
Renderable = {
Enabled = false,
Type = "RenderableLabels",
Type = "RenderableLabel",
Text = "Venus",
FontSize = 70.0,
Size = 8.54,

View File

@@ -25,7 +25,7 @@ local SunLabel = {
Parent = Sun.Identifier,
Renderable = {
Enabled = false,
Type = "RenderableLabels",
Type = "RenderableLabel",
Text = "Sun",
FontSize = 70.0,
Size = 14.17,
@@ -48,7 +48,7 @@ local SunLabel = {
local LightSource = {
Type = "SceneGraphLightSource",
Identifier = "Sun",
Node = transforms.SolarSystemBarycenter.Identifier,
Node = Sun.Identifier,
Intensity = 1.0
}
@@ -56,12 +56,12 @@ asset.onInitialize(function()
openspace.addSceneGraphNode(Sun)
openspace.addSceneGraphNode(SunLabel)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(SunLabel)
openspace.removeSceneGraphNode(Sun)
end)
asset.export(Sun)
asset.export(SunLabel)
asset.export("LightSource", LightSource)

View File

@@ -1,30 +1,175 @@
local orbit_right = {
Identifier = "ipac.orbit_right",
Name = "Orbit right",
Command = [[ openspace.navigation.addGlobalRotation(-5.0, 0.0) ]],
Documentation = "Orbits the camera to the right around the current focus",
GuiPath = "/Ipac",
IsLocal = false
}
asset.export("IpacOrbitRight", orbit_right)
local orbit_left = {
Identifier = "ipac.orbit_left",
Name = "Orbit left",
Command = [[ openspace.navigation.addGlobalRotation(5.0, 0.0) ]],
Documentation = "Orbits the camera to the left around the current focus",
GuiPath = "/Ipac",
IsLocal = false
}
asset.export("IpacOrbitLeft", orbit_left)
local orbit_up = {
Identifier = "ipac.orbit_up",
Name = "Orbit up",
Command = [[ openspace.navigation.addGlobalRotation(0.0, 5.0) ]],
Documentation = "Orbits the camera up around the current focus",
GuiPath = "/Ipac",
IsLocal = false
}
asset.export("IpacOrbitUp", orbit_up)
local orbit_down = {
Identifier = "ipac.orbit_down",
Name = "Orbit down",
Command = [[ openspace.navigation.addGlobalRotation(0.0, -5.0) ]],
Documentation = "Orbits the camera down around the current focus",
GuiPath = "/Ipac",
IsLocal = false
}
asset.export("IpacOrbitDown", orbit_down)
local pan_right = {
Identifier = "ipac.pan_right",
Name = "Pan right",
Command = [[ openspace.navigation.addLocalRotation(-5.0, 0.0) ]],
Documentation = "Pans the camera to the right",
GuiPath = "/Ipac",
IsLocal = false
}
asset.export("IpacPanRight", pan_right)
local pan_left = {
Identifier = "ipac.pan_left",
Name = "Pan left",
Command = [[ openspace.navigation.addLocalRotation(5.0, 0.0) ]],
Documentation = "Pans the camera to the left",
GuiPath = "/Ipac",
IsLocal = false
}
asset.export("IpacPanLeft", pan_left)
local pan_up = {
Identifier = "ipac.pan_up",
Name = "Pan up",
Command = [[ openspace.navigation.addLocalRotation(0.0, 5.0) ]],
Documentation = "Pans the camera up",
GuiPath = "/Ipac",
IsLocal = false
}
asset.export("IpacPanUp", pan_up)
local pan_down = {
Identifier = "ipac.pan_down",
Name = "Pan down",
Command = [[ openspace.navigation.addLocalRotation(0.0, -5.0) ]],
Documentation = "Pans the camera down",
GuiPath = "/Ipac",
IsLocal = false
}
asset.export("IpacPanDown", pan_down)
local zoom_in = {
Identifier = "ipac.zoom_in",
Name = "Zoom in",
Command = [[ openspace.navigation.addTruckMovement(0.0, 5.0) ]],
Documentation = "Zooms the camera in, towards the current focus",
GuiPath = "/Ipac",
IsLocal = false
}
asset.export("IpacZoomIn", zoom_in)
local zoom_out = {
Identifier = "ipac.zoom_out",
Name = "Zoom out",
Command = [[ openspace.navigation.addTruckMovement(0.0, -5.0) ]],
Documentation = "Zooms the camera out, away form the current focus",
GuiPath = "/Ipac",
IsLocal = false
}
asset.export("IpacZoomOut", zoom_out)
local focus_moon = {
Identifier = "ipac.focus_moon",
Name = "Focus on the Moon",
Command = [[
openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Aim", "");
openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Anchor", "Moon");
openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.RetargetAnchor", nil);
]],
Documentation = "Focuses the camera on the Moon",
GuiPath = "/Ipac",
IsLocal = false
}
asset.export("IpacFocusMoon", focus_moon)
local focus_earth = {
Identifier = "ipac.focus_earth",
Name = "Focus on the Earth",
Command = [[
openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Aim", "");
openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Anchor", "Earth");
openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.RetargetAnchor", nil)
]],
Documentation = "Focuses the camera on Earth",
GuiPath = "/Ipac",
IsLocal = false
}
asset.export("IpacFocusEarth", focus_earth)
local actions = {
orbit_right,
orbit_left,
orbit_up,
orbit_down,
pan_right,
pan_left,
pan_up,
pan_down,
zoom_in,
zoom_out,
focus_moon,
focus_earth
}
asset.onInitialize(function()
for _, a in ipairs(actions) do
openspace.action.registerAction(a)
end
openspace.clearKeys()
openspace.bindKey("RIGHT", "openspace.navigation.addGlobalRotation(-5.0, 0.0)");
openspace.bindKey("LEFT", "openspace.navigation.addGlobalRotation(5.0, 0.0)");
openspace.bindKey("UP", "openspace.navigation.addGlobalRotation(0.0, 5.0)");
openspace.bindKey("DOWN", "openspace.navigation.addGlobalRotation(0.0, -5.0)");
openspace.bindKey("RIGHT", orbit_right.Identifier)
openspace.bindKey("LEFT", orbit_left.Identifier)
openspace.bindKey("UP", orbit_up.Identifier)
openspace.bindKey("DOWN", orbit_down.Identifier)
openspace.bindKey("CTRL+RIGHT", "openspace.navigation.addLocalRotation(-5.0, 0.0)");
openspace.bindKey("CTRL+LEFT", "openspace.navigation.addLocalRotation(5.0, 0.0)");
openspace.bindKey("CTRL+UP", "openspace.navigation.addLocalRotation(0.0, 5.0)");
openspace.bindKey("CTRL+DOWN", "openspace.navigation.addLocalRotation(0.0, -5.0)");
openspace.bindKey("CTRL+RIGHT", pan_right.Identifier)
openspace.bindKey("CTRL+LEFT", pan_left.Identifier)
openspace.bindKey("CTRL+UP", pan_up.Identifier)
openspace.bindKey("CTRL+DOWN", pan_down.Identifier)
openspace.bindKey("ALT+UP", "openspace.navigation.addTruckMovement(0.0, 5.0)");
openspace.bindKey("ALT+DOWN", "openspace.navigation.addTruckMovement(0.0, -5.0)");
openspace.bindKey("ALT+UP", zoom_in.Identifier)
openspace.bindKey("ALT+DOWN", zoom_out.Identifier)
openspace.bindKey(
"SPACE",
[[
openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Aim", "");
openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Anchor", "Moon");
openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.RetargetAnchor", nil)
]])
openspace.bindKey(
"Z",
[[
openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Aim", "");
openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Anchor", "Earth");
openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.RetargetAnchor", nil)
]])
openspace.bindKey("SPACE", focus_moon.Identifier)
openspace.bindKey("Z", focus_earth.Identifier)
end)
asset.onDeinitialize(function ()
for i = #actions, 1, -1 do
openspace.action.removeAction(actions[i])
end
end)

View File

@@ -3,7 +3,7 @@ asset.require("./static_server")
local guiCustomization = asset.require("customization/gui")
-- Select which commit hashes to use for the frontend and backend
local frontendHash = "aeffda7eef46f4eaddfebcb41389672d2c473b35"
local frontendHash = "9f0298993d738f487c93c559084593945b5e093e"
local dataProvider = "data.openspaceproject.com/files/webgui"
local frontend = asset.syncedResource({

View File

@@ -0,0 +1,42 @@
{
"assets": [
"base_blank"
],
"camera": {
"aim": "",
"anchor": "Root",
"frame": "",
"position": {
"x": 20.0,
"y": 20.0,
"z": 20.0
},
"type": "setNavigationState",
"up": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"yaw": 0.0
},
"delta_times": [
1.0
],
"mark_nodes": [],
"meta": {
"author": "OpenSpace Team",
"description": "An empty profile, without anything special at all.",
"license": "MIT License",
"name": "Empty",
"url": "https://www.openspaceproject.com",
"version": "1.0"
},
"time": {
"type": "relative",
"value": "-1d"
},
"version": {
"major": 1,
"minor": 0
}
}

View File

@@ -73,12 +73,12 @@
"script": "local list = openspace.getProperty('{planetTrail_solarSystem}.Renderable.Enabled'); for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end local moonlist = openspace.getProperty('{moonTrail_solarSystem}.Renderable.Enabled') for _,v in pairs(moonlist) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end openspace.setPropertyValueSingle('Scene.MoonTrail.Renderable.Enabled', true)"
},
{
"documentation": "Toggle JWST launch, cruise and orbit trails, not the Sun trail",
"documentation": "Toggle JWST launch, cruise and L2 co-revolving orbit trails, not the Sun trail",
"gui_path": "/JWST",
"identifier": "profile.toggle.jwst_trails",
"is_local": false,
"name": "Toggle JWST trail",
"script": "local list = {'Scene.JWSTTrailLaunch.Renderable.Enabled', 'Scene.JWSTTrailCruise.Renderable.Enabled', 'Scene.JWSTTrailOrbit.Renderable.Enabled'}; for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)); end"
"script": "local list = {'Scene.JWSTTrailLaunch.Renderable.Enabled', 'Scene.JWSTTrailCruise.Renderable.Enabled', 'Scene.JWSTTrailCoRevOrbit.Renderable.Enabled'}; for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)); end"
}
],
"additional_scripts": [
@@ -294,6 +294,11 @@
"type": "setPropertyValueSingle",
"value": "false"
},
{
"name": "Scene.JWSTTrailOrbit.Renderable.Enabled",
"type": "setPropertyValueSingle",
"value": "false"
},
{
"name": "Scene.JWSTSunTrail.Renderable.Enabled",
"type": "setPropertyValueSingle",

View File

@@ -0,0 +1,6 @@
return {
{
Type = "ConvertRecFileVersionTask",
InputFilePath = "../../user/recordings/input.osrec"
}
}

View File

@@ -56,18 +56,25 @@ set_folder_location(GhoulTest "Unit Tests")
begin_dependency("Spice")
set(SPICE_BUILD_SHARED_LIBRARY OFF CACHE BOOL "" FORCE)
add_subdirectory(spice)
target_compile_features(spice PUBLIC cxx_std_20)
set_folder_location(spice "External")
end_dependency()
# Curl
begin_dependency("CURL")
add_library(external-curl INTERFACE)
if (WIN32)
target_include_directories(external-curl INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/curl/include")
target_link_libraries(external-curl INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/curl/lib/libcurl.lib")
add_library(external-curl SHARED IMPORTED GLOBAL)
target_include_directories(external-curl INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/curl/include)
set_property(TARGET external-curl PROPERTY IMPORTED_IMPLIB ${CMAKE_CURRENT_SOURCE_DIR}/curl/lib/libcurl.lib)
set_property(TARGET external-curl PROPERTY IMPORTED_LOCATION
${CMAKE_CURRENT_SOURCE_DIR}/curl/lib/libcurl.dll
${CMAKE_CURRENT_SOURCE_DIR}/curl/lib/libeay32.dll
${CMAKE_CURRENT_SOURCE_DIR}/curl/lib/ssleay32.dll
)
else ()
find_package(CURL)
if (CURL_FOUND)
add_library(external-curl INTERFACE)
target_include_directories(external-curl INTERFACE ${CURL_INCLUDE_DIRS})
target_link_libraries(external-curl INTERFACE ${CURL_LIBRARIES})
endif ()

View File

@@ -550,6 +550,16 @@ public:
*/
std::string convertFile(std::string filename, int depth = 0);
/**
* Converts file format of a session recording file to the current format version
* (will determine the file format conversion to convert from based on the file's
* header version number). Accepts a relative path (currently from task runner dir)
* rather than a path assumed to be relative to ${RECORDINGS}.
*
* \param filename name of the file to convert
*/
void convertFileRelativePath(std::string filenameRelative);
/**
* Goes to legacy session recording inherited class, and calls its convertFile()
* method, and then returns the resulting conversion filename.
@@ -617,7 +627,6 @@ protected:
bool handleRecordingFile(std::string filenameIn);
static bool isPath(std::string& filename);
void removeTrailingPathSlashes(std::string& filename);
void extractFilenameFromPath(std::string& filename);
bool playbackCamera();
bool playbackTimeChange();
bool playbackScript();

View File

@@ -80,11 +80,9 @@ private:
float _minValue = 0.f;
float _maxValue = 0.f;
float* _data = nullptr;
std::vector<float> _equalizer;
int _numValues = 0;
};
} // namespace openspace

View File

@@ -30,6 +30,7 @@
#include <openspace/documentation/verifier.h>
#include <openspace/engine/globals.h>
#include <openspace/navigation/navigationhandler.h>
#include <ghoul/misc/profiling.h>
#include <openspace/properties/property.h>
#include <openspace/rendering/deferredcastermanager.h>
#include <math.h>

View File

@@ -44,7 +44,7 @@ set(HEADER_FILES
rendering/grids/renderablesphericalgrid.h
rendering/renderablecartesianaxes.h
rendering/renderabledisc.h
rendering/renderablelabels.h
rendering/renderablelabel.h
rendering/renderablemodel.h
rendering/renderablenodeline.h
rendering/renderableplane.h
@@ -98,7 +98,7 @@ set(SOURCE_FILES
rendering/grids/renderablesphericalgrid.cpp
rendering/renderablecartesianaxes.cpp
rendering/renderabledisc.cpp
rendering/renderablelabels.cpp
rendering/renderablelabel.cpp
rendering/renderablemodel.cpp
rendering/renderablenodeline.cpp
rendering/renderableplane.cpp
@@ -165,3 +165,14 @@ create_new_module(
STATIC
${HEADER_FILES} ${SOURCE_FILES} ${SHADER_FILES}
)
target_precompile_headers(${base_module} PRIVATE
<openspace/documentation/documentation.h>
<openspace/documentation/verifier.h>
<openspace/properties/numericalproperty.h>
<openspace/rendering/renderable.h>
<ghoul/opengl/programobject.h>
<ghoul/opengl/shaderobject.h>
<ghoul/opengl/uniformcache.h>
<future>
<map>
)

View File

@@ -43,7 +43,7 @@
#include <modules/base/rendering/grids/renderablesphericalgrid.h>
#include <modules/base/rendering/renderablecartesianaxes.h>
#include <modules/base/rendering/renderabledisc.h>
#include <modules/base/rendering/renderablelabels.h>
#include <modules/base/rendering/renderablelabel.h>
#include <modules/base/rendering/renderablemodel.h>
#include <modules/base/rendering/renderablenodeline.h>
#include <modules/base/rendering/renderablesphere.h>
@@ -129,7 +129,7 @@ void BaseModule::internalInitialize(const ghoul::Dictionary&) {
fRenderable->registerClass<RenderableCartesianAxes>("RenderableCartesianAxes");
fRenderable->registerClass<RenderableDisc>("RenderableDisc");
fRenderable->registerClass<RenderableGrid>("RenderableGrid");
fRenderable->registerClass<RenderableLabels>("RenderableLabels");
fRenderable->registerClass<RenderableLabel>("RenderableLabel");
fRenderable->registerClass<RenderableModel>("RenderableModel");
fRenderable->registerClass<RenderableNodeLine>("RenderableNodeLine");
fRenderable->registerClass<RenderablePlaneImageLocal>("RenderablePlaneImageLocal");
@@ -212,7 +212,7 @@ std::vector<documentation::Documentation> BaseModule::documentations() const {
RenderableCartesianAxes::Documentation(),
RenderableDisc::Documentation(),
RenderableGrid::Documentation(),
RenderableLabels::Documentation(),
RenderableLabel::Documentation(),
RenderableModel::Documentation(),
RenderableNodeLine::Documentation(),
RenderablePlane::Documentation(),

View File

@@ -54,6 +54,19 @@ namespace {
"This value species the size of each dimensions of the box"
};
constexpr openspace::properties::Property::PropertyInfo DrawLabelInfo = {
"DrawLabels",
"Draw Labels",
"Determines whether labels should be drawn or hidden"
};
static const openspace::properties::PropertyOwner::PropertyOwnerInfo LabelsInfo =
{
"Labels",
"Labels",
"The labels for the grid"
};
struct [[codegen::Dictionary(RenderableBoxGrid)]] Parameters {
// [[codegen::verbatim(ColorInfo.description)]]
std::optional<glm::vec3> color [[codegen::color()]];
@@ -63,6 +76,13 @@ namespace {
// [[codegen::verbatim(SizeInfo.description)]]
std::optional<glm::vec3> size;
// [[codegen::verbatim(DrawLabelInfo.description)]]
std::optional<bool> drawLabels;
// [[codegen::verbatim(LabelsInfo.description)]]
std::optional<ghoul::Dictionary> labels
[[codegen::reference("space_labelscomponent")]];
};
#include "renderableboxgrid_codegen.cpp"
} // namespace
@@ -78,6 +98,7 @@ RenderableBoxGrid::RenderableBoxGrid(const ghoul::Dictionary& dictionary)
, _color(ColorInfo, glm::vec3(0.5f), glm::vec3(0.f), glm::vec3(1.f))
, _lineWidth(LineWidthInfo, 0.5f, 1.f, 20.f)
, _size(SizeInfo, glm::vec3(1.f), glm::vec3(1.f), glm::vec3(100.f))
, _drawLabels(DrawLabelInfo, false)
{
const Parameters p = codegen::bake<Parameters>(dictionary);
@@ -94,10 +115,26 @@ RenderableBoxGrid::RenderableBoxGrid(const ghoul::Dictionary& dictionary)
_size = p.size.value_or(_size);
_size.onChange([&]() { _gridIsDirty = true; });
addProperty(_size);
if (p.labels.has_value()) {
_drawLabels = p.drawLabels.value_or(_drawLabels);
addProperty(_drawLabels);
_labels = std::make_unique<LabelsComponent>(*p.labels);
_hasLabels = true;
addPropertySubOwner(_labels.get());
}
}
bool RenderableBoxGrid::isReady() const {
return _gridProgram != nullptr;
return _hasLabels ? _gridProgram && _labels->isReady() : _gridProgram != nullptr;
}
void RenderableBoxGrid::initialize() {
if (_hasLabels) {
_labels->initialize();
_labels->loadLabels();
}
}
void RenderableBoxGrid::initializeGL() {
@@ -146,12 +183,12 @@ void RenderableBoxGrid::render(const RenderData& data, RendererTasks&){
glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale));
glm::dmat4 modelViewTransform = data.camera.combinedViewMatrix() * modelTransform;
const glm::dmat4 projectionMatrix = data.camera.projectionMatrix();
const glm::dmat4 modelViewProjectionMatrix = projectionMatrix * modelViewTransform;
_gridProgram->setUniform("modelViewTransform", modelViewTransform);
_gridProgram->setUniform(
"MVPTransform",
glm::dmat4(data.camera.projectionMatrix()) * modelViewTransform
);
_gridProgram->setUniform("MVPTransform", modelViewProjectionMatrix);
_gridProgram->setUniform("opacity", opacity());
_gridProgram->setUniform("gridColor", _color);
@@ -176,6 +213,31 @@ void RenderableBoxGrid::render(const RenderData& data, RendererTasks&){
global::renderEngine->openglStateCache().resetBlendState();
global::renderEngine->openglStateCache().resetLineState();
global::renderEngine->openglStateCache().resetDepthState();
// Draw labels
if (_drawLabels && _hasLabels) {
const glm::vec3 lookup = data.camera.lookUpVectorWorldSpace();
const glm::vec3 viewDirection = data.camera.viewDirectionWorldSpace();
glm::vec3 right = glm::cross(viewDirection, lookup);
const glm::vec3 up = glm::cross(right, viewDirection);
const glm::dmat4 worldToModelTransform = glm::inverse(modelTransform);
glm::vec3 orthoRight = glm::normalize(
glm::vec3(worldToModelTransform * glm::vec4(right, 0.0))
);
if (orthoRight == glm::vec3(0.0)) {
glm::vec3 otherVector = glm::vec3(lookup.y, lookup.x, lookup.z);
right = glm::cross(viewDirection, otherVector);
orthoRight = glm::normalize(
glm::vec3(worldToModelTransform * glm::vec4(right, 0.0))
);
}
const glm::vec3 orthoUp = glm::normalize(
glm::vec3(worldToModelTransform * glm::dvec4(up, 0.0))
);
_labels->render(data, modelViewProjectionMatrix, orthoRight, orthoUp);
}
}
void RenderableBoxGrid::update(const UpdateData&) {

View File

@@ -27,6 +27,7 @@
#include <openspace/rendering/renderable.h>
#include <modules/space/labelscomponent.h>
#include <openspace/properties/scalar/floatproperty.h>
#include <openspace/properties/vector/vec3property.h>
#include <ghoul/opengl/ghoul_gl.h>
@@ -43,6 +44,7 @@ class RenderableBoxGrid : public Renderable {
public:
RenderableBoxGrid(const ghoul::Dictionary& dictionary);
void initialize() override;
void initializeGL() override;
void deinitializeGL() override;
@@ -71,6 +73,11 @@ protected:
GLenum _mode = GL_LINE_STRIP;
std::vector<Vertex> _varray;
// Labels
bool _hasLabels = false;
properties::BoolProperty _drawLabels;
std::unique_ptr<LabelsComponent> _labels;
};
}// namespace openspace

View File

@@ -42,6 +42,12 @@ namespace {
"This value determines the color of the grid lines that are rendered"
};
constexpr openspace::properties::Property::PropertyInfo HighlightColorInfo = {
"HighlightColor",
"Highlight Color",
"This value determines the color of the highlighted lines in the grid"
};
constexpr openspace::properties::Property::PropertyInfo SegmentsInfo = {
"Segments",
"Number of Segments",
@@ -49,30 +55,73 @@ namespace {
"grid in each direction"
};
constexpr openspace::properties::Property::PropertyInfo HighlightRateInfo = {
"HighlightRate",
"Highlight Rate",
"The rate that the columns and rows are highlighted, counted with respect to the "
"center of the grid. If the number of segments in the grid is odd, the "
"highlighting might be offset from the center."
};
constexpr openspace::properties::Property::PropertyInfo LineWidthInfo = {
"LineWidth",
"Line Width",
"This value specifies the line width of the grid"
};
constexpr openspace::properties::Property::PropertyInfo HighlightLineWidthInfo = {
"HighlightLineWidth",
"Highlight Line Width",
"This value specifies the line width of the highlighted lines in the grid"
};
constexpr openspace::properties::Property::PropertyInfo SizeInfo = {
"Size",
"Grid Size",
"This value species the size of each dimensions of the grid"
};
constexpr openspace::properties::Property::PropertyInfo DrawLabelInfo = {
"DrawLabels",
"Draw Labels",
"Determines whether labels should be drawn or hidden"
};
static const openspace::properties::PropertyOwner::PropertyOwnerInfo LabelsInfo =
{
"Labels",
"Labels",
"The labels for the grid"
};
struct [[codegen::Dictionary(RenderableGrid)]] Parameters {
// [[codegen::verbatim(ColorInfo.description)]]
std::optional<glm::vec3> color [[codegen::color()]];
// [[codegen::verbatim(HighlightColorInfo.description)]]
std::optional<glm::vec3> highlightColor [[codegen::color()]];
// [[codegen::verbatim(SegmentsInfo.description)]]
std::optional<glm::ivec2> segments;
// [[codegen::verbatim(HighlightRateInfo.description)]]
std::optional<glm::ivec2> highlightRate;
// [[codegen::verbatim(LineWidthInfo.description)]]
std::optional<float> lineWidth;
// [[codegen::verbatim(HighlightLineWidthInfo.description)]]
std::optional<float> highlightLineWidth;
// [[codegen::verbatim(SizeInfo.description)]]
std::optional<glm::vec2> size;
// [[codegen::verbatim(DrawLabelInfo.description)]]
std::optional<bool> drawLabels;
// [[codegen::verbatim(LabelsInfo.description)]]
std::optional<ghoul::Dictionary> labels
[[codegen::reference("space_labelscomponent")]];
};
#include "renderablegrid_codegen.cpp"
} // namespace
@@ -86,9 +135,13 @@ documentation::Documentation RenderableGrid::Documentation() {
RenderableGrid::RenderableGrid(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
, _color(ColorInfo, glm::vec3(0.5f), glm::vec3(0.f), glm::vec3(1.f))
, _highlightColor(HighlightColorInfo, glm::vec3(0.8f), glm::vec3(0.f), glm::vec3(1.f))
, _segments(SegmentsInfo, glm::uvec2(10), glm::uvec2(1), glm::uvec2(200))
, _highlightRate(HighlightRateInfo, glm::uvec2(0), glm::uvec2(0), glm::uvec2(200))
, _lineWidth(LineWidthInfo, 0.5f, 1.f, 20.f)
, _highlightLineWidth(HighlightLineWidthInfo, 0.5f, 1.f, 20.f)
, _size(SizeInfo, glm::vec2(1.f), glm::vec2(1.f), glm::vec2(1e11f))
, _drawLabels(DrawLabelInfo, false)
{
const Parameters p = codegen::bake<Parameters>(dictionary);
@@ -99,21 +152,50 @@ RenderableGrid::RenderableGrid(const ghoul::Dictionary& dictionary)
_color.setViewOption(properties::Property::ViewOptions::Color);
addProperty(_color);
// If no highlight color is specified then use the base color
_highlightColor = p.highlightColor.value_or(_color);
_highlightColor.setViewOption(properties::Property::ViewOptions::Color);
addProperty(_highlightColor);
_segments = p.segments.value_or(_segments);
_segments.onChange([&]() { _gridIsDirty = true; });
addProperty(_segments);
_highlightRate = p.highlightRate.value_or(_highlightRate);
_highlightRate.onChange([&]() { _gridIsDirty = true; });
addProperty(_highlightRate);
_lineWidth = p.lineWidth.value_or(_lineWidth);
addProperty(_lineWidth);
// If no highlight line width is specified then use the base line width
_highlightLineWidth = p.highlightLineWidth.value_or(_lineWidth);
addProperty(_highlightLineWidth);
_size.setExponent(10.f);
_size = p.size.value_or(_size);
_size.onChange([&]() { _gridIsDirty = true; });
addProperty(_size);
if (p.labels.has_value()) {
_drawLabels = p.drawLabels.value_or(_drawLabels);
addProperty(_drawLabels);
_labels = std::make_unique<LabelsComponent>(*p.labels);
_hasLabels = true;
addPropertySubOwner(_labels.get());
}
}
bool RenderableGrid::isReady() const {
return _gridProgram != nullptr;
return _hasLabels ? _gridProgram && _labels->isReady() : _gridProgram != nullptr;
}
void RenderableGrid::initialize() {
if (_hasLabels) {
_labels->initialize();
_labels->loadLabels();
}
}
void RenderableGrid::initializeGL() {
@@ -130,9 +212,14 @@ void RenderableGrid::initializeGL() {
glGenVertexArrays(1, &_vaoID);
glGenBuffers(1, &_vBufferID);
glGenVertexArrays(1, &_highlightVaoID);
glGenBuffers(1, &_highlightVBufferID);
glBindVertexArray(_vaoID);
glBindBuffer(GL_ARRAY_BUFFER, _vBufferID);
glBindVertexArray(_highlightVaoID);
glBindBuffer(GL_ARRAY_BUFFER, _highlightVBufferID);
glEnableVertexAttribArray(0);
glBindVertexArray(0);
}
@@ -140,9 +227,13 @@ void RenderableGrid::initializeGL() {
void RenderableGrid::deinitializeGL() {
glDeleteVertexArrays(1, &_vaoID);
_vaoID = 0;
glDeleteVertexArrays(1, &_highlightVaoID);
_highlightVaoID = 0;
glDeleteBuffers(1, &_vBufferID);
_vBufferID = 0;
glDeleteBuffers(1, &_highlightVBufferID);
_highlightVBufferID = 0;
BaseModule::ProgramObjectManager.release(
"GridProgram",
@@ -156,18 +247,36 @@ void RenderableGrid::deinitializeGL() {
void RenderableGrid::render(const RenderData& data, RendererTasks&){
_gridProgram->activate();
glm::dmat4 modelTransform =
const glm::dmat4 modelMatrix =
glm::translate(glm::dmat4(1.0), data.modelTransform.translation) * // Translation
glm::dmat4(data.modelTransform.rotation) * // Spice rotation
glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale));
glm::dmat4 modelViewTransform = data.camera.combinedViewMatrix() * modelTransform;
const glm::dmat4 modelViewTransform = data.camera.combinedViewMatrix() * modelMatrix;
const glm::dmat4 projectionMatrix = data.camera.projectionMatrix();
const glm::dmat4 modelViewProjectionMatrix = projectionMatrix * modelViewTransform;
const glm::vec3 lookup = data.camera.lookUpVectorWorldSpace();
const glm::vec3 viewDirection = data.camera.viewDirectionWorldSpace();
glm::vec3 right = glm::cross(viewDirection, lookup);
const glm::vec3 up = glm::cross(right, viewDirection);
const glm::dmat4 worldToModelTransform = glm::inverse(modelMatrix);
glm::vec3 orthoRight = glm::normalize(
glm::vec3(worldToModelTransform * glm::vec4(right, 0.0))
);
if (orthoRight == glm::vec3(0.0)) {
glm::vec3 otherVector = glm::vec3(lookup.y, lookup.x, lookup.z);
right = glm::cross(viewDirection, otherVector);
orthoRight = glm::normalize(
glm::vec3(worldToModelTransform * glm::vec4(right, 0.0))
);
}
_gridProgram->setUniform("modelViewTransform", modelViewTransform);
_gridProgram->setUniform(
"MVPTransform",
glm::dmat4(data.camera.projectionMatrix()) * modelViewTransform
);
_gridProgram->setUniform("MVPTransform", modelViewProjectionMatrix);
_gridProgram->setUniform("opacity", opacity());
_gridProgram->setUniform("gridColor", _color);
@@ -180,18 +289,37 @@ void RenderableGrid::render(const RenderData& data, RendererTasks&){
glEnablei(GL_BLEND, 0);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_LINE_SMOOTH);
glDepthMask(false);
glEnable(GL_DEPTH_TEST);
// Render minor grid
glBindVertexArray(_vaoID);
glDrawArrays(_mode, 0, static_cast<GLsizei>(_varray.size()));
glBindVertexArray(0);
_gridProgram->deactivate();
// Render major grid
#ifndef __APPLE__
glLineWidth(_highlightLineWidth);
#else
glLineWidth(1.f);
#endif
_gridProgram->setUniform("gridColor", _highlightColor);
glBindVertexArray(_highlightVaoID);
glDrawArrays(_mode, 0, static_cast<GLsizei>(_highlightArray.size()));
// Restore GL State
glBindVertexArray(0);
_gridProgram->deactivate();
global::renderEngine->openglStateCache().resetBlendState();
global::renderEngine->openglStateCache().resetLineState();
global::renderEngine->openglStateCache().resetDepthState();
// Draw labels
if (_drawLabels && _hasLabels) {
const glm::vec3 orthoUp = glm::normalize(
glm::vec3(worldToModelTransform * glm::dvec4(up, 0.0))
);
_labels->render(data, modelViewProjectionMatrix, orthoRight, orthoUp);
}
}
void RenderableGrid::update(const UpdateData&) {
@@ -199,50 +327,111 @@ void RenderableGrid::update(const UpdateData&) {
return;
}
const glm::vec2 halfSize = _size.value() / 2.f;
const glm::dvec2 halfSize = static_cast<glm::dvec2>(_size.value()) / 2.0;
const glm::uvec2 nSegments = _segments.value();
const glm::vec2 step = _size.value() / static_cast<glm::vec2>(nSegments);
const glm::dvec2 step =
static_cast<glm::dvec2>(_size.value()) / static_cast<glm::dvec2>(nSegments);
const int nLines = (2 * nSegments.x * nSegments.y) + nSegments.x + nSegments.y;
const int nVertices = 2 * nLines;
_varray.resize(nVertices);
_varray.clear();
_varray.reserve(nVertices);
_highlightArray.clear();
_highlightArray.reserve(nVertices);
// OBS! Could be optimized further by removing duplicate vertices
int nr = 0;
// If the number of segments are uneven the center won't be completly centered
const glm::uvec2 center = glm::uvec2(nSegments.x / 2.f, nSegments.y / 2.f);
for (unsigned int i = 0; i < nSegments.x; ++i) {
for (unsigned int j = 0; j < nSegments.y; ++j) {
const float y0 = -halfSize.y + j * step.y;
const float y1 = y0 + step.y;
const double y0 = -halfSize.y + j * step.y;
const double y1 = y0 + step.y;
const float x0 = -halfSize.x + i * step.x;
const float x1 = x0 + step.x;
const double x0 = -halfSize.x + i * step.x;
const double x1 = x0 + step.x;
_varray[nr++] = { x0, y0, 0.f };
_varray[nr++] = { x0, y1, 0.f };
// Line in y direction
bool shouldHighlight = false;
if (_highlightRate.value().x != 0) {
int dist = abs(static_cast<int>(i) - static_cast<int>(center.x));
int rest = dist % _highlightRate.value().x;
shouldHighlight = rest == 0;
}
_varray[nr++] = { x0, y0, 0.f };
_varray[nr++] = { x1, y0, 0.f };
if (shouldHighlight) {
_highlightArray.push_back({ x0, y0, 0.0 });
_highlightArray.push_back({ x0, y1, 0.0 });
}
else {
_varray.push_back({ x0, y0, 0.0 });
_varray.push_back({ x0, y1, 0.0 });
}
// Line in x direction
shouldHighlight = false;
if (_highlightRate.value().y != 0) {
int dist = abs(static_cast<int>(j) - static_cast<int>(center.y));
int rest = dist % _highlightRate.value().y;
shouldHighlight = abs(rest) == 0;
}
if (shouldHighlight) {
_highlightArray.push_back({ x0, y0, 0.0 });
_highlightArray.push_back({ x1, y0, 0.0 });
}
else {
_varray.push_back({ x0, y0, 0.0 });
_varray.push_back({ x1, y0, 0.0 });
}
}
}
// last x row
for (unsigned int i = 0; i < nSegments.x; ++i) {
const float x0 = -halfSize.x + i * step.x;
const float x1 = x0 + step.x;
_varray[nr++] = { x0, halfSize.y, 0.f };
_varray[nr++] = { x1, halfSize.y, 0.f };
const double x0 = -halfSize.x + i * step.x;
const double x1 = x0 + step.x;
bool shouldHighlight = false;
if (_highlightRate.value().y != 0) {
int dist = abs(static_cast<int>(nSegments.y) - static_cast<int>(center.y));
int rest = dist % _highlightRate.value().y;
shouldHighlight = abs(rest) == 0;
}
if (shouldHighlight) {
_highlightArray.push_back({ x0, halfSize.y, 0.0 });
_highlightArray.push_back({ x1, halfSize.y, 0.0 });
}
else {
_varray.push_back({ x0, halfSize.y, 0.0 });
_varray.push_back({ x1, halfSize.y, 0.0 });
}
}
// last y col
for (unsigned int i = 0; i < nSegments.y; ++i) {
const float y0 = -halfSize.y + i * step.y;
const float y1 = y0 + step.y;
_varray[nr++] = { halfSize.x, y0, 0.f };
_varray[nr++] = { halfSize.x, y1, 0.f };
for (unsigned int j = 0; j < nSegments.y; ++j) {
const double y0 = -halfSize.y + j * step.y;
const double y1 = y0 + step.y;
bool shouldHighlight = false;
if (_highlightRate.value().x != 0) {
int dist = abs(static_cast<int>(nSegments.x) - static_cast<int>(center.x));
int rest = dist % _highlightRate.value().x;
shouldHighlight = abs(rest) == 0;
}
if (shouldHighlight) {
_highlightArray.push_back({ halfSize.x, y0, 0.0 });
_highlightArray.push_back({ halfSize.x, y1, 0.0 });
}
else {
_varray.push_back({ halfSize.x, y0, 0.0 });
_varray.push_back({ halfSize.x, y1, 0.0 });
}
}
setBoundingSphere(glm::length(glm::dvec2(halfSize)));
// Minor grid
glBindVertexArray(_vaoID);
glBindBuffer(GL_ARRAY_BUFFER, _vBufferID);
glBufferData(
@@ -251,8 +440,19 @@ void RenderableGrid::update(const UpdateData&) {
_varray.data(),
GL_STATIC_DRAW
);
glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 3, GL_DOUBLE, GL_FALSE, sizeof(Vertex), nullptr);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), nullptr);
// Major grid
glBindVertexArray(_highlightVaoID);
glBindBuffer(GL_ARRAY_BUFFER, _highlightVBufferID);
glBufferData(
GL_ARRAY_BUFFER,
_highlightArray.size() * sizeof(Vertex),
_highlightArray.data(),
GL_STATIC_DRAW
);
glVertexAttribPointer(0, 3, GL_DOUBLE, GL_FALSE, sizeof(Vertex), nullptr);
glBindVertexArray(0);

View File

@@ -27,6 +27,7 @@
#include <openspace/rendering/renderable.h>
#include <modules/space/labelscomponent.h>
#include <openspace/properties/stringproperty.h>
#include <openspace/properties/vector/ivec2property.h>
#include <openspace/properties/scalar/floatproperty.h>
@@ -43,6 +44,7 @@ class RenderableGrid : public Renderable {
public:
RenderableGrid(const ghoul::Dictionary& dictionary);
void initialize() override;
void initializeGL() override;
void deinitializeGL() override;
@@ -55,25 +57,36 @@ public:
protected:
struct Vertex {
float location[3];
double location[3];
};
ghoul::opengl::ProgramObject* _gridProgram = nullptr;
properties::Vec3Property _color;
properties::Vec3Property _highlightColor;
// @TODO (abock, 2021-01-28) This was a UVec2Property before, but it wasn't supported
// be the codegen. As soon as it does, this should be changed back
properties::IVec2Property _segments;
properties::IVec2Property _highlightRate;
properties::FloatProperty _lineWidth;
properties::FloatProperty _highlightLineWidth;
properties::Vec2Property _size;
bool _gridIsDirty = true;
GLuint _vaoID = 0;
GLuint _vBufferID = 0;
GLuint _highlightVaoID = 0;
GLuint _highlightVBufferID = 0;
GLenum _mode = GL_LINES;
std::vector<Vertex> _varray;
std::vector<Vertex> _highlightArray;
// Labels
bool _hasLabels = false;
properties::BoolProperty _drawLabels;
std::unique_ptr<LabelsComponent> _labels;
};
}// namespace openspace

View File

@@ -71,6 +71,19 @@ namespace {
"ring"
};
constexpr openspace::properties::Property::PropertyInfo DrawLabelInfo = {
"DrawLabels",
"Draw Labels",
"Determines whether labels should be drawn or hidden"
};
static const openspace::properties::PropertyOwner::PropertyOwnerInfo LabelsInfo =
{
"Labels",
"Labels",
"The labels for the grid"
};
struct [[codegen::Dictionary(RenderableRadialGrid)]] Parameters {
// [[codegen::verbatim(ColorInfo.description)]]
std::optional<glm::vec3> color [[codegen::color()]];
@@ -86,6 +99,13 @@ namespace {
// [[codegen::verbatim(RadiiInfo.description)]]
std::optional<glm::vec2> radii;
// [[codegen::verbatim(DrawLabelInfo.description)]]
std::optional<bool> drawLabels;
// [[codegen::verbatim(LabelsInfo.description)]]
std::optional<ghoul::Dictionary> labels
[[codegen::reference("space_labelscomponent")]];
};
#include "renderableradialgrid_codegen.cpp"
} // namespace
@@ -103,6 +123,7 @@ RenderableRadialGrid::RenderableRadialGrid(const ghoul::Dictionary& dictionary)
, _circleSegments(CircleSegmentsInfo, 36, 4, 200)
, _lineWidth(LineWidthInfo, 0.5f, 1.f, 20.f)
, _radii(RadiiInfo, glm::vec2(0.f, 1.f), glm::vec2(0.f), glm::vec2(20.f))
, _drawLabels(DrawLabelInfo, false)
{
const Parameters p = codegen::bake<Parameters>(dictionary);
@@ -134,10 +155,26 @@ RenderableRadialGrid::RenderableRadialGrid(const ghoul::Dictionary& dictionary)
_radii.onChange([&]() { _gridIsDirty = true; });
addProperty(_radii);
if (p.labels.has_value()) {
_drawLabels = p.drawLabels.value_or(_drawLabels);
addProperty(_drawLabels);
_labels = std::make_unique<LabelsComponent>(*p.labels);
_hasLabels = true;
addPropertySubOwner(_labels.get());
}
}
bool RenderableRadialGrid::isReady() const {
return _gridProgram != nullptr;
return _hasLabels ? _gridProgram && _labels->isReady() : _gridProgram != nullptr;
}
void RenderableRadialGrid::initialize() {
if (_hasLabels) {
_labels->initialize();
_labels->loadLabels();
}
}
void RenderableRadialGrid::initializeGL() {
@@ -171,14 +208,14 @@ void RenderableRadialGrid::render(const RenderData& data, RendererTasks&) {
glm::dmat4(data.modelTransform.rotation) * // Spice rotation
glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale));
const glm::dmat4 modelViewTransform = data.camera.combinedViewMatrix() *
modelTransform;
const glm::dmat4 modelViewTransform =
data.camera.combinedViewMatrix() * modelTransform;
const glm::dmat4 projectionMatrix = data.camera.projectionMatrix();
const glm::dmat4 modelViewProjectionMatrix = projectionMatrix * modelViewTransform;
_gridProgram->setUniform("modelViewTransform", modelViewTransform);
_gridProgram->setUniform(
"MVPTransform",
glm::dmat4(data.camera.projectionMatrix()) * modelViewTransform
);
_gridProgram->setUniform("MVPTransform", modelViewProjectionMatrix);
_gridProgram->setUniform("opacity", opacity());
_gridProgram->setUniform("gridColor", _color);
@@ -205,6 +242,31 @@ void RenderableRadialGrid::render(const RenderData& data, RendererTasks&) {
global::renderEngine->openglStateCache().resetBlendState();
global::renderEngine->openglStateCache().resetLineState();
global::renderEngine->openglStateCache().resetDepthState();
// Draw labels
if (_drawLabels && _hasLabels) {
const glm::vec3 lookup = data.camera.lookUpVectorWorldSpace();
const glm::vec3 viewDirection = data.camera.viewDirectionWorldSpace();
glm::vec3 right = glm::cross(viewDirection, lookup);
const glm::vec3 up = glm::cross(right, viewDirection);
const glm::dmat4 worldToModelTransform = glm::inverse(modelTransform);
glm::vec3 orthoRight = glm::normalize(
glm::vec3(worldToModelTransform * glm::vec4(right, 0.0))
);
if (orthoRight == glm::vec3(0.0)) {
glm::vec3 otherVector = glm::vec3(lookup.y, lookup.x, lookup.z);
right = glm::cross(viewDirection, otherVector);
orthoRight = glm::normalize(
glm::vec3(worldToModelTransform * glm::vec4(right, 0.0))
);
}
const glm::vec3 orthoUp = glm::normalize(
glm::vec3(worldToModelTransform * glm::dvec4(up, 0.0))
);
_labels->render(data, modelViewProjectionMatrix, orthoRight, orthoUp);
}
}
void RenderableRadialGrid::update(const UpdateData&) {

View File

@@ -27,6 +27,7 @@
#include <openspace/rendering/renderable.h>
#include <modules/space/labelscomponent.h>
#include <openspace/properties/scalar/floatproperty.h>
#include <openspace/properties/scalar/intproperty.h>
#include <openspace/properties/vector/ivec2property.h>
@@ -46,6 +47,7 @@ public:
RenderableRadialGrid(const ghoul::Dictionary& dictionary);
~RenderableRadialGrid() override = default;
void initialize() override;
void initializeGL() override;
void deinitializeGL() override;
@@ -85,6 +87,11 @@ protected:
std::vector<GeometryData> _circles;
GeometryData _lines{GL_LINES};
// Labels
bool _hasLabels = false;
properties::BoolProperty _drawLabels;
std::unique_ptr<LabelsComponent> _labels;
};
}// namespace openspace

View File

@@ -55,6 +55,19 @@ namespace {
"This value specifies the line width of the spherical grid"
};
constexpr openspace::properties::Property::PropertyInfo DrawLabelInfo = {
"DrawLabels",
"Draw Labels",
"Determines whether labels should be drawn or hidden"
};
static const openspace::properties::PropertyOwner::PropertyOwnerInfo LabelsInfo =
{
"Labels",
"Labels",
"The labels for the grid"
};
struct [[codegen::Dictionary(RenderableSphericalGrid)]] Parameters {
// [[codegen::verbatim(ColorInfo.description)]]
std::optional<glm::vec3> color [[codegen::color()]];
@@ -64,6 +77,13 @@ namespace {
// [[codegen::verbatim(LineWidthInfo.description)]]
std::optional<float> lineWidth;
// [[codegen::verbatim(DrawLabelInfo.description)]]
std::optional<bool> drawLabels;
// [[codegen::verbatim(LabelsInfo.description)]]
std::optional<ghoul::Dictionary> labels
[[codegen::reference("space_labelscomponent")]];
};
#include "renderablesphericalgrid_codegen.cpp"
} // namespace
@@ -80,6 +100,7 @@ RenderableSphericalGrid::RenderableSphericalGrid(const ghoul::Dictionary& dictio
, _color(ColorInfo, glm::vec3(0.5f), glm::vec3(0.f), glm::vec3(1.f))
, _segments(SegmentsInfo, 36, 4, 200)
, _lineWidth(LineWidthInfo, 0.5f, 1.f, 20.f)
, _drawLabels(DrawLabelInfo, false)
{
const Parameters p = codegen::bake<Parameters>(dictionary);
@@ -104,12 +125,26 @@ RenderableSphericalGrid::RenderableSphericalGrid(const ghoul::Dictionary& dictio
// Radius is always 1
setBoundingSphere(1.0);
if (p.labels.has_value()) {
_drawLabels = p.drawLabels.value_or(_drawLabels);
addProperty(_drawLabels);
_labels = std::make_unique<LabelsComponent>(*p.labels);
_hasLabels = true;
addPropertySubOwner(_labels.get());
}
}
bool RenderableSphericalGrid::isReady() const {
bool ready = true;
ready &= (_gridProgram != nullptr);
return ready;
return _hasLabels ? _gridProgram && _labels->isReady() : _gridProgram != nullptr;
}
void RenderableSphericalGrid::initialize() {
if (_hasLabels) {
_labels->initialize();
_labels->loadLabels();
}
}
void RenderableSphericalGrid::initializeGL() {
@@ -162,14 +197,14 @@ void RenderableSphericalGrid::render(const RenderData& data, RendererTasks&){
glm::dmat4(data.modelTransform.rotation) * // Spice rotation
glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale));
const glm::dmat4 modelViewTransform = data.camera.combinedViewMatrix() *
modelTransform;
const glm::dmat4 modelViewTransform =
data.camera.combinedViewMatrix() * modelTransform;
const glm::dmat4 projectionMatrix = data.camera.projectionMatrix();
const glm::dmat4 modelViewProjectionMatrix = projectionMatrix * modelViewTransform;
_gridProgram->setUniform("modelViewTransform", modelViewTransform);
_gridProgram->setUniform(
"MVPTransform",
glm::dmat4(data.camera.projectionMatrix()) * modelViewTransform
);
_gridProgram->setUniform("MVPTransform", modelViewProjectionMatrix);
_gridProgram->setUniform("opacity", opacity());
_gridProgram->setUniform("gridColor", _color);
@@ -195,6 +230,31 @@ void RenderableSphericalGrid::render(const RenderData& data, RendererTasks&){
global::renderEngine->openglStateCache().resetBlendState();
global::renderEngine->openglStateCache().resetLineState();
global::renderEngine->openglStateCache().resetDepthState();
// Draw labels
if (_drawLabels && _hasLabels) {
const glm::vec3 lookup = data.camera.lookUpVectorWorldSpace();
const glm::vec3 viewDirection = data.camera.viewDirectionWorldSpace();
glm::vec3 right = glm::cross(viewDirection, lookup);
const glm::vec3 up = glm::cross(right, viewDirection);
const glm::dmat4 worldToModelTransform = glm::inverse(modelTransform);
glm::vec3 orthoRight = glm::normalize(
glm::vec3(worldToModelTransform * glm::vec4(right, 0.0))
);
if (orthoRight == glm::vec3(0.0)) {
glm::vec3 otherVector = glm::vec3(lookup.y, lookup.x, lookup.z);
right = glm::cross(viewDirection, otherVector);
orthoRight = glm::normalize(
glm::vec3(worldToModelTransform * glm::vec4(right, 0.0))
);
}
const glm::vec3 orthoUp = glm::normalize(
glm::vec3(worldToModelTransform * glm::dvec4(up, 0.0))
);
_labels->render(data, modelViewProjectionMatrix, orthoRight, orthoUp);
}
}
void RenderableSphericalGrid::update(const UpdateData&) {

View File

@@ -27,6 +27,7 @@
#include <openspace/rendering/renderable.h>
#include <modules/space/labelscomponent.h>
#include <openspace/properties/scalar/floatproperty.h>
#include <openspace/properties/scalar/intproperty.h>
#include <openspace/properties/vector/vec3property.h>
@@ -43,6 +44,7 @@ public:
RenderableSphericalGrid(const ghoul::Dictionary& dictionary);
~RenderableSphericalGrid() override = default;
void initialize() override;
void initializeGL() override;
void deinitializeGL() override;
@@ -75,6 +77,11 @@ protected:
unsigned int _vsize = 0;
std::vector<Vertex> _varray;
std::vector<int> _iarray;
// Labels
bool _hasLabels = false;
properties::BoolProperty _drawLabels;
std::unique_ptr<LabelsComponent> _labels;
};
}// namespace openspace

View File

@@ -22,7 +22,7 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#include <modules/base/rendering/renderablelabels.h>
#include <modules/base/rendering/renderablelabel.h>
#include <modules/base/basemodule.h>
#include <openspace/documentation/documentation.h>
@@ -166,7 +166,7 @@ namespace {
"Distance unit for fade-in/-out distance calculations. Defaults to \"au\""
};
struct [[codegen::Dictionary(RenderableLabels)]] Parameters {
struct [[codegen::Dictionary(RenderableLabel)]] Parameters {
enum class [[codegen::map(BlendMode)]] BlendMode {
Normal,
Additive
@@ -228,16 +228,16 @@ namespace {
// [[codegen::verbatim(FadeWidthsInfo.description)]]
std::optional<glm::vec2> fadeWidths;
};
#include "renderablelabels_codegen.cpp"
#include "renderablelabel_codegen.cpp"
} // namespace
namespace openspace {
documentation::Documentation RenderableLabels::Documentation() {
documentation::Documentation RenderableLabel::Documentation() {
return codegen::doc<Parameters>("base_renderable_labels");
}
RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary)
RenderableLabel::RenderableLabel(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
, _blendMode(BlendModeInfo, properties::OptionProperty::DisplayType::Dropdown)
, _color(ColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f))
@@ -357,17 +357,17 @@ RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary)
addProperty(_fadeWidths);
}
bool RenderableLabels::isReady() const {
bool RenderableLabel::isReady() const {
return true;
}
void RenderableLabels::initialize() {
void RenderableLabel::initialize() {
ZoneScoped
setRenderBin(Renderable::RenderBin::PreDeferredTransparent);
}
void RenderableLabels::initializeGL() {
void RenderableLabel::initializeGL() {
if (_font == nullptr) {
_font = global::fontManager->font(
"Mono",
@@ -378,9 +378,9 @@ void RenderableLabels::initializeGL() {
}
}
void RenderableLabels::deinitializeGL() {}
void RenderableLabel::deinitializeGL() {}
void RenderableLabels::render(const RenderData& data, RendererTasks&) {
void RenderableLabel::render(const RenderData& data, RendererTasks&) {
glDepthMask(true);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
@@ -421,11 +421,11 @@ void RenderableLabels::render(const RenderData& data, RendererTasks&) {
}
void RenderableLabels::setLabelText(const std::string & newText) {
void RenderableLabel::setLabelText(const std::string & newText) {
_text = newText;
}
void RenderableLabels::renderLabels(const RenderData& data,
void RenderableLabel::renderLabels(const RenderData& data,
const glm::dmat4& modelViewProjectionMatrix,
const glm::dvec3& orthoRight,
const glm::dvec3& orthoUp, float fadeInVariable)
@@ -463,7 +463,7 @@ void RenderableLabels::renderLabels(const RenderData& data,
);
}
float RenderableLabels::computeFadeFactor(float distanceNodeToCamera) const {
float RenderableLabel::computeFadeFactor(float distanceNodeToCamera) const {
float distanceUnit = unit(_fadeUnitOption);
float x = distanceNodeToCamera;
@@ -487,7 +487,7 @@ float RenderableLabels::computeFadeFactor(float distanceNodeToCamera) const {
}
}
float RenderableLabels::unit(int unit) const {
float RenderableLabel::unit(int unit) const {
switch (static_cast<Unit>(unit)) {
case Meter: return 1.f;
case Kilometer: return 1e3f;
@@ -505,7 +505,7 @@ float RenderableLabels::unit(int unit) const {
}
}
std::string_view RenderableLabels::toString(int unit) const {
std::string_view RenderableLabel::toString(int unit) const {
switch (static_cast<Unit>(unit)) {
case Meter: return MeterUnit;
case Kilometer: return KilometerUnit;

View File

@@ -22,8 +22,8 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __OPENSPACE_MODULE_BASE___RENDERABLELABELS___H__
#define __OPENSPACE_MODULE_BASE___RENDERABLELABELS___H__
#ifndef __OPENSPACE_MODULE_BASE___RENDERABLELABEL___H__
#define __OPENSPACE_MODULE_BASE___RENDERABLELABEL___H__
#include <openspace/rendering/renderable.h>
@@ -54,9 +54,9 @@ namespace documentation { struct Documentation; }
struct LinePoint;
class RenderableLabels : public Renderable {
class RenderableLabel : public Renderable {
public:
RenderableLabels(const ghoul::Dictionary& dictionary);
RenderableLabel(const ghoul::Dictionary& dictionary);
void initialize() override;
void initializeGL() override;
@@ -111,4 +111,4 @@ private:
} // namespace openspace
#endif // __OPENSPACE_MODULE_BASE___RENDERABLELABELS___H__
#endif // __OPENSPACE_MODULE_BASE___RENDERABLELABEL___H__

View File

@@ -37,11 +37,11 @@ void main() {
dvec4 objPosDouble = dvec4(in_position, 1.0);
dvec4 positionViewSpace = modelViewTransform * objPosDouble;
dvec4 positionClipSpace = MVPTransform * objPosDouble;
positionClipSpace.z = 0.0;
vs_depthClipSpace = float(positionClipSpace.w);
vs_positionViewSpace = vec4(positionViewSpace);
gl_Position = vec4(positionClipSpace);
}

View File

@@ -48,4 +48,18 @@ create_new_module(
${OPENSPACE_HEADER_FILES} ${OPENSPACE_SOURCE_FILES}
)
target_precompile_headers(${cefwebgui_module} PRIVATE
[["include/capi/cef_base_capi.h"]]
[["include/cef_render_handler.h"]]
<string>
<sstream>
<istream>
<ostream>
)
if (WIN32)
target_precompile_headers(${cefwebgui_module} PRIVATE
<Windows.h>
)
endif ()
set_modules_dependency_on_cef_libraries(${cefwebgui_module})

View File

@@ -32,8 +32,6 @@
#include <openspace/util/updatestructures.h>
#include <openspace/rendering/renderengine.h>
#include <ghoul/filesystem/filesystem.h>
#include <ghoul/font/fontmanager.h>
#include <ghoul/font/fontrenderer.h>
#include <ghoul/glm.h>
#include <ghoul/io/texture/texturereader.h>
#include <ghoul/logging/logmanager.h>
@@ -102,32 +100,6 @@ namespace {
"The path to the color map file of the astronomical object"
};
constexpr openspace::properties::Property::PropertyInfo TextColorInfo = {
"TextColor",
"Text Color",
"The text color for the astronomical object"
};
constexpr openspace::properties::Property::PropertyInfo TextOpacityInfo = {
"TextOpacity",
"Text Opacity",
"Determines the transparency of the text label, where 1 is completely opaque "
"and 0 fully transparent"
};
constexpr openspace::properties::Property::PropertyInfo TextSizeInfo = {
"TextSize",
"Text Size",
"The text size for the astronomical object labels"
};
constexpr openspace::properties::Property::PropertyInfo LabelMinMaxSizeInfo = {
"TextMinMaxSize",
"Text Min/Max Size",
"The minimal and maximal size (in pixels) of the text for the labels for the "
"astronomical objects being rendered"
};
constexpr openspace::properties::Property::PropertyInfo DrawElementsInfo = {
"DrawElements",
"Draw Elements",
@@ -140,6 +112,13 @@ namespace {
"Determines whether labels should be drawn or hidden"
};
static const openspace::properties::PropertyOwner::PropertyOwnerInfo LabelsInfo =
{
"Labels",
"Labels",
"The labels for the astronomical objects"
};
constexpr openspace::properties::Property::PropertyInfo ColorOptionInfo = {
"ColorOption",
"Color Option",
@@ -163,7 +142,8 @@ namespace {
constexpr openspace::properties::Property::PropertyInfo RenderOptionInfo = {
"RenderOption",
"Render Option",
"Debug option for rendering of billboards and texts"
"Option wether the billboards should face the camera or not. Used for "
"non-linear display envierments such as fisheye."
};
constexpr openspace::properties::Property::PropertyInfo FadeInDistancesInfo = {
@@ -274,21 +254,9 @@ namespace {
// [[codegen::verbatim(DrawLabelInfo.description)]]
std::optional<bool> drawLabels;
// [[codegen::verbatim(TextColorInfo.description)]]
std::optional<glm::vec3> textColor [[codegen::color()]];
// [[codegen::verbatim(TextOpacityInfo.description)]]
std::optional<float> textOpacity;
// [[codegen::verbatim(TextSizeInfo.description)]]
std::optional<float> textSize;
// The path to the label file that contains information about the astronomical
// objects being rendered
std::optional<std::string> labelFile;
// [[codegen::verbatim(LabelMinMaxSizeInfo.description)]]
std::optional<glm::ivec2> textMinMaxSize;
// [[codegen::verbatim(LabelsInfo.description)]]
std::optional<ghoul::Dictionary> labels
[[codegen::reference("space_labelscomponent")]];
// [[codegen::verbatim(ColorOptionInfo.description)]]
std::optional<std::vector<std::string>> colorOption;
@@ -339,15 +307,6 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
, _useColorMap(UseColorMapInfo, true)
, _pointColor(ColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f))
, _spriteTexturePath(SpriteTextureInfo)
, _textColor(TextColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f))
, _textOpacity(TextOpacityInfo, 1.f, 0.f, 1.f)
, _textSize(TextSizeInfo, 8.f, 0.5f, 24.f)
, _textMinMaxSize(
LabelMinMaxSizeInfo,
glm::ivec2(8, 20),
glm::ivec2(0),
glm::ivec2(100)
)
, _drawElements(DrawElementsInfo, true)
, _drawLabels(DrawLabelInfo, false)
, _pixelSizeControl(PixelSizeControlInfo, false)
@@ -481,28 +440,13 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
_polygonSides = p.polygonSides.value_or(_polygonSides);
_hasPolygon = p.polygonSides.has_value();
if (p.labelFile.has_value()) {
if (p.labels.has_value()) {
_drawLabels = p.drawLabels.value_or(_drawLabels);
addProperty(_drawLabels);
_labelFile = absPath(*p.labelFile).string();
_hasLabel = true;
_textColor = p.textColor.value_or(_textColor);
_hasLabel = p.textColor.has_value();
_textColor.setViewOption(properties::Property::ViewOptions::Color);
addProperty(_textColor);
_textColor.onChange([&]() { _textColorIsDirty = true; });
_textOpacity = p.textOpacity.value_or(_textOpacity);
addProperty(_textOpacity);
_textSize = p.textSize.value_or(_textSize);
addProperty(_textSize);
_textMinMaxSize = p.textMinMaxSize.value_or(_textMinMaxSize);
_textMinMaxSize.setViewOption(properties::Property::ViewOptions::MinMaxRange);
addProperty(_textMinMaxSize);
_labels = std::make_unique<LabelsComponent>(*p.labels);
_hasLabels = true;
addPropertySubOwner(_labels.get());
}
_transformationMatrix = p.transformationMatrix.value_or(_transformationMatrix);
@@ -557,7 +501,13 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
}
bool RenderableBillboardsCloud::isReady() const {
return (_program && (!_dataset.entries.empty())) || (!_labelset.entries.empty());
bool isReady = _program && !_dataset.entries.empty();
// If we have labels, they also need to be loaded
if (_hasLabels) {
isReady = isReady || _labels->isReady();
}
return isReady;
}
void RenderableBillboardsCloud::initialize() {
@@ -571,11 +521,9 @@ void RenderableBillboardsCloud::initialize() {
_colorMap = speck::color::loadFileWithCache(_colorMapFile);
}
if (!_labelFile.empty()) {
_labelset = speck::label::loadFileWithCache(_labelFile);
for (speck::Labelset::Entry& e : _labelset.entries) {
e.position = glm::vec3(_transformationMatrix * glm::dvec4(e.position, 1.0));
}
if (_hasLabels) {
_labels->initialize();
_labels->loadLabels();
}
if (!_colorOptionString.empty() && (_colorRangeData.size() > 1)) {
@@ -619,18 +567,6 @@ void RenderableBillboardsCloud::initializeGL() {
if (_hasPolygon) {
createPolygonTexture();
}
if (_hasLabel) {
if (!_font) {
size_t _fontSize = 50;
_font = global::fontManager->font(
"Mono",
static_cast<float>(_fontSize),
ghoul::fontrendering::FontManager::Outline::Yes,
ghoul::fontrendering::FontManager::LoadGlyphs::No
);
}
}
}
void RenderableBillboardsCloud::deinitializeGL() {
@@ -739,40 +675,6 @@ void RenderableBillboardsCloud::renderBillboards(const RenderData& data,
global::renderEngine->openglStateCache().resetDepthState();
}
void RenderableBillboardsCloud::renderLabels(const RenderData& data,
const glm::dmat4& modelViewProjectionMatrix,
const glm::dvec3& orthoRight,
const glm::dvec3& orthoUp,
float fadeInVariable)
{
glm::vec4 textColor = glm::vec4(glm::vec3(_textColor), _textOpacity * fadeInVariable);
ghoul::fontrendering::FontRenderer::ProjectedLabelsInformation labelInfo;
labelInfo.orthoRight = orthoRight;
labelInfo.orthoUp = orthoUp;
labelInfo.minSize = _textMinMaxSize.value().x;
labelInfo.maxSize = _textMinMaxSize.value().y;
labelInfo.cameraPos = data.camera.positionVec3();
labelInfo.cameraLookUp = data.camera.lookUpVectorWorldSpace();
labelInfo.renderType = _renderOption;
labelInfo.mvpMatrix = modelViewProjectionMatrix;
labelInfo.scale = pow(10.f, _textSize);
labelInfo.enableDepth = true;
labelInfo.enableFalseDepth = false;
for (const speck::Labelset::Entry& e : _labelset.entries) {
glm::vec3 scaledPos(e.position);
scaledPos *= toMeter(_unit);
ghoul::fontrendering::FontRenderer::defaultProjectionRenderer().render(
*_font,
scaledPos,
e.text,
textColor,
labelInfo
);
}
}
void RenderableBillboardsCloud::render(const RenderData& data, RendererTasks&) {
float fadeInVar = 1.f;
if (!_disableFadeInDistance) {
@@ -806,7 +708,7 @@ void RenderableBillboardsCloud::render(const RenderData& data, RendererTasks&) {
glm::cross(cameraUpDirectionWorld, cameraViewDirectionWorld)
);
if (orthoRight == glm::dvec3(0.0)) {
glm::dvec3 otherVector(
glm::dvec3 otherVector = glm::vec3(
cameraUpDirectionWorld.y,
cameraUpDirectionWorld.x,
cameraUpDirectionWorld.z
@@ -819,8 +721,8 @@ void RenderableBillboardsCloud::render(const RenderData& data, RendererTasks&) {
renderBillboards(data, modelMatrix, orthoRight, orthoUp, fadeInVar);
}
if (_drawLabels && _hasLabel) {
renderLabels(data, modelViewProjectionMatrix, orthoRight, orthoUp, fadeInVar);
if (_drawLabels && _hasLabels) {
_labels->render(data, modelViewProjectionMatrix, orthoRight, orthoUp, fadeInVar);
}
}

View File

@@ -27,7 +27,7 @@
#include <openspace/rendering/renderable.h>
#include <modules/space/speckloader.h>
#include <modules/space/labelscomponent.h>
#include <openspace/properties/optionproperty.h>
#include <openspace/properties/stringproperty.h>
#include <openspace/properties/triggerproperty.h>
@@ -43,7 +43,6 @@
#include <unordered_map>
namespace ghoul::filesystem { class File; }
namespace ghoul::fontrendering { class Font; }
namespace ghoul::opengl {
class ProgramObject;
class Texture;
@@ -79,19 +78,16 @@ private:
void renderPolygonGeometry(GLuint vao);
void renderBillboards(const RenderData& data, const glm::dmat4& modelMatrix,
const glm::dvec3& orthoRight, const glm::dvec3& orthoUp, float fadeInVariable);
void renderLabels(const RenderData& data, const glm::dmat4& modelViewProjectionMatrix,
const glm::dvec3& orthoRight, const glm::dvec3& orthoUp, float fadeInVariable);
bool _hasSpeckFile = false;
bool _dataIsDirty = true;
bool _textColorIsDirty = true;
bool _hasSpriteTexture = false;
bool _spriteTextureIsDirty = true;
bool _hasColorMapFile = false;
bool _isColorMapExact = false;
bool _hasDatavarSize = false;
bool _hasPolygon = false;
bool _hasLabel = false;
bool _hasLabels = false;
int _polygonSides = 0;
@@ -101,10 +97,6 @@ private:
properties::BoolProperty _useColorMap;
properties::Vec3Property _pointColor;
properties::StringProperty _spriteTexturePath;
properties::Vec3Property _textColor;
properties::FloatProperty _textOpacity;
properties::FloatProperty _textSize;
properties::IVec2Property _textMinMaxSize;
properties::BoolProperty _drawElements;
properties::BoolProperty _drawLabels;
properties::BoolProperty _pixelSizeControl;
@@ -133,20 +125,19 @@ private:
hasDvarScaling
) _uniformCache;
std::shared_ptr<ghoul::fontrendering::Font> _font;
std::string _speckFile;
std::string _colorMapFile;
std::string _labelFile;
std::string _colorOptionString;
std::string _datavarSizeOptionString;
DistanceUnit _unit = DistanceUnit::Parsec;
speck::Dataset _dataset;
speck::Labelset _labelset;
speck::ColorMap _colorMap;
// Everything related to the labels is handled by LabelsComponent
std::unique_ptr<LabelsComponent> _labels;
std::vector<glm::vec2> _colorRangeData;
std::unordered_map<int, std::string> _optionConversionMap;
std::unordered_map<int, std::string> _optionConversionSizeMap;

View File

@@ -255,6 +255,13 @@ bool RenderableDUMeshes::isReady() const {
(!_renderingMeshesMap.empty() || (!_labelset.entries.empty()));
}
void RenderableDUMeshes::initialize() {
bool success = loadData();
if (!success) {
throw ghoul::RuntimeError("Error loading data");
}
}
void RenderableDUMeshes::initializeGL() {
_program = DigitalUniverseModule::ProgramObjectManager.request(
"RenderableDUMeshes",
@@ -269,11 +276,6 @@ void RenderableDUMeshes::initializeGL() {
ghoul::opengl::updateUniformLocations(*_program, _uniformCache, UniformNames);
bool success = loadData();
if (!success) {
throw ghoul::RuntimeError("Error loading data");
}
createMeshes();
if (_hasLabel) {
@@ -536,8 +538,7 @@ bool RenderableDUMeshes::readSpeckFile() {
std::getline(file, line);
std::stringstream dim(line);
dim >> mesh.numU; // numU
dim >> mesh.numV; // numV
dim >> mesh.numU >> mesh.numV;
// We can now read the vertices data:
for (int l = 0; l < mesh.numU * mesh.numV; ++l) {
@@ -602,7 +603,6 @@ bool RenderableDUMeshes::readSpeckFile() {
}
}
}
setBoundingSphere(maxRadius);
return true;
@@ -636,7 +636,7 @@ void RenderableDUMeshes::createMeshes() {
// in_position
glEnableVertexAttribArray(0);
// (2022-03-23, emmbr) This code was actually never used. We only read three
// values per line and di not handle any texture cooridnates, even if there
// values per line and did not handle any texture cooridnates, even if there
// would have been some in the file
//// U and V may not be given by the user
//if (p.second.vertices.size() / (p.second.numU * p.second.numV) > 3) {

View File

@@ -55,6 +55,7 @@ public:
explicit RenderableDUMeshes(const ghoul::Dictionary& dictionary);
~RenderableDUMeshes() override = default;
void initialize() override;
void initializeGL() override;
void deinitializeGL() override;
@@ -84,7 +85,7 @@ private:
// "If you wish to draw a line between points, then numU will be 1 while
// numV will equal the number of points to connect.
// If you want a square, 4000×4000 grid with lines every 200 units,
// then numU numU will both equal 21
// then numU numV will both equal 21
int numU;
int numV;
MeshType style;

View File

@@ -31,8 +31,6 @@
#include <openspace/rendering/renderengine.h>
#include <openspace/util/updatestructures.h>
#include <ghoul/filesystem/filesystem.h>
#include <ghoul/font/fontmanager.h>
#include <ghoul/font/fontrenderer.h>
#include <ghoul/io/texture/texturereader.h>
#include <ghoul/logging/logmanager.h>
#include <ghoul/misc/profiling.h>
@@ -67,44 +65,11 @@ namespace {
"size of each point"
};
constexpr openspace::properties::Property::PropertyInfo TextColorInfo = {
"TextColor",
"Text Color",
"The text color for the astronomical object"
};
constexpr openspace::properties::Property::PropertyInfo TextOpacityInfo = {
"TextOpacity",
"Text Opacity",
"Determines the transparency of the text label, where 1 is completely opaque "
"and 0 fully transparent"
};
constexpr openspace::properties::Property::PropertyInfo TextSizeInfo = {
"TextSize",
"Text Size",
"The text size for the astronomical object labels"
};
constexpr openspace::properties::Property::PropertyInfo LabelFileInfo = {
"LabelFile",
"Label File",
"The path to the label file that contains information about the astronomical "
"objects being rendered"
};
constexpr openspace::properties::Property::PropertyInfo LabelMinSizeInfo = {
"TextMinSize",
"Text Min Size",
"The minimal size (in pixels) of the text for the labels for the astronomical "
"objects being rendered"
};
constexpr openspace::properties::Property::PropertyInfo LabelMaxSizeInfo = {
"TextMaxSize",
"Text Max Size",
"The maximum size (in pixels) of the text for the labels for the astronomical "
"objects being rendered"
static const openspace::properties::PropertyOwner::PropertyOwnerInfo LabelsInfo =
{
"Labels",
"Labels",
"The labels for the astronomical objects"
};
constexpr openspace::properties::Property::PropertyInfo DrawElementsInfo = {
@@ -176,23 +141,9 @@ namespace {
// [[codegen::verbatim(ScaleFactorInfo.description)]]
std::optional<float> scaleFactor;
// [[codegen::verbatim(TextColorInfo.description)]]
std::optional<glm::vec3> textColor [[codegen::color()]];
// [[codegen::verbatim(TextOpacityInfo.description)]]
std::optional<float> textOpacity;
// [[codegen::verbatim(TextSizeInfo.description)]]
std::optional<float> textSize;
// [[codegen::verbatim(LabelFileInfo.description)]]
std::optional<std::string> labelFile;
// [[codegen::verbatim(LabelMinSizeInfo.description)]]
std::optional<int> textMinSize;
// [[codegen::verbatim(LabelMaxSizeInfo.description)]]
std::optional<int> textMaxSize;
// [[codegen::verbatim(LabelsInfo.description)]]
std::optional<ghoul::Dictionary> labels
[[codegen::reference("space_labelscomponent")]];
// [[codegen::verbatim(TransformationMatrixInfo.description)]]
std::optional<glm::dmat4x4> transformationMatrix;
@@ -246,9 +197,6 @@ documentation::Documentation RenderablePlanesCloud::Documentation() {
RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
, _scaleFactor(ScaleFactorInfo, 1.f, 0.f, 300000.f)
, _textColor(TextColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f))
, _textOpacity(TextOpacityInfo, 1.f, 0.f, 1.f)
, _textSize(TextSizeInfo, 8.0, 0.5, 24.0)
, _drawElements(DrawElementsInfo, true)
, _blendMode(BlendModeInfo, properties::OptionProperty::DisplayType::Dropdown)
, _fadeInDistances(
@@ -290,23 +238,10 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary
addProperty(_scaleFactor);
_scaleFactor.onChange([&]() { _dataIsDirty = true; });
if (p.labelFile.has_value()) {
_labelFile = absPath(*p.labelFile);
_hasLabel = true;
_textColor = p.textColor.value_or(_textColor);
_textColor.setViewOption(properties::Property::ViewOptions::Color);
addProperty(_textColor);
_textColor.onChange([&]() { _textColorIsDirty = true; });
_textOpacity = p.textOpacity.value_or(_textOpacity);
addProperty(_textOpacity);
_textSize = p.textSize.value_or(_textSize);
addProperty(_textSize);
_textMinSize = p.textMinSize.value_or(_textMinSize);
_textMaxSize = p.textMaxSize.value_or(_textMaxSize);
if (p.labels.has_value()) {
_labels = std::make_unique<LabelsComponent>(*p.labels);
_hasLabels = true;
addPropertySubOwner(_labels.get());
}
_transformationMatrix = p.transformationMatrix.value_or(_transformationMatrix);
@@ -360,7 +295,13 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary
}
bool RenderablePlanesCloud::isReady() const {
return (_program && (!_dataset.entries.empty())) || (!_labelset.entries.empty());
bool isReady = _program && !_dataset.entries.empty();
// If we have labels, they also need to be loaded
if (_hasLabels) {
isReady = isReady || _labels->isReady();
}
return isReady;
}
void RenderablePlanesCloud::initialize() {
@@ -373,12 +314,9 @@ void RenderablePlanesCloud::initialize() {
}
}
if (!_labelFile.empty()) {
LINFO(fmt::format("Loading Label file {}", _labelFile));
_labelset = speck::label::loadFileWithCache(_labelFile);
for (speck::Labelset::Entry& e : _labelset.entries) {
e.position = glm::vec3(_transformationMatrix * glm::dvec4(e.position, 1.0));
}
if (_hasLabels) {
_labels->initialize();
_labels->loadLabels();
}
}
@@ -400,18 +338,6 @@ void RenderablePlanesCloud::initializeGL() {
createPlanes();
loadTextures();
if (_hasLabel) {
if (!_font) {
constexpr int FontSize = 30;
_font = global::fontManager->font(
"Mono",
static_cast<float>(FontSize),
ghoul::fontrendering::FontManager::Outline::Yes,
ghoul::fontrendering::FontManager::LoadGlyphs::No
);
}
}
}
void RenderablePlanesCloud::deleteDataGPUAndCPU() {
@@ -488,39 +414,6 @@ void RenderablePlanesCloud::renderPlanes(const RenderData&,
global::renderEngine->openglStateCache().resetPolygonAndClippingState();
}
void RenderablePlanesCloud::renderLabels(const RenderData& data,
const glm::dmat4& modelViewProjectionMatrix,
const glm::dvec3& orthoRight,
const glm::dvec3& orthoUp, float fadeInVariable)
{
double scale = toMeter(_unit);
glm::vec4 textColor = glm::vec4(glm::vec3(_textColor), _textOpacity * fadeInVariable);
ghoul::fontrendering::FontRenderer::ProjectedLabelsInformation labelInfo;
labelInfo.orthoRight = orthoRight;
labelInfo.orthoUp = orthoUp;
labelInfo.minSize = _textMinSize;
labelInfo.maxSize = _textMaxSize;
labelInfo.cameraPos = data.camera.positionVec3();
labelInfo.cameraLookUp = data.camera.lookUpVectorWorldSpace();
labelInfo.renderType = _renderOption;
labelInfo.mvpMatrix = modelViewProjectionMatrix;
labelInfo.scale = pow(10.f, _textSize);
labelInfo.enableDepth = true;
labelInfo.enableFalseDepth = false;
for (const speck::Labelset::Entry& e : _labelset.entries) {
glm::dvec3 scaledPos = glm::dvec3(e.position) * scale;
ghoul::fontrendering::FontRenderer::defaultProjectionRenderer().render(
*_font,
scaledPos,
e.text,
textColor,
labelInfo
);
}
}
void RenderablePlanesCloud::render(const RenderData& data, RendererTasks&) {
const double scale = toMeter(_unit);
@@ -547,24 +440,25 @@ void RenderablePlanesCloud::render(const RenderData& data, RendererTasks&) {
const glm::dmat4 modelViewMatrix = data.camera.combinedViewMatrix() * modelMatrix;
const glm::mat4 projectionMatrix = data.camera.projectionMatrix();
const glm::dmat4 mvpMatrix = glm::dmat4(projectionMatrix) * modelViewMatrix;
const glm::dmat4 invMVPParts = glm::inverse(modelMatrix) *
glm::inverse(data.camera.combinedViewMatrix()) *
glm::inverse(glm::dmat4(projectionMatrix));
const glm::dvec3 orthoRight = glm::normalize(
glm::dvec3(invMVPParts * glm::dvec4(1.0, 0.0, 0.0, 0.0))
);
const glm::dvec3 orthoUp = glm::normalize(
glm::dvec3(invMVPParts * glm::dvec4(0.0, 1.0, 0.0, 0.0))
);
if (_hasSpeckFile) {
renderPlanes(data, modelViewMatrix, projectionMatrix, fadeInVariable);
}
if (_hasLabel) {
renderLabels(data, mvpMatrix, orthoRight, orthoUp, fadeInVariable);
if (_hasLabels) {
const glm::dmat4 mvpMatrix = glm::dmat4(projectionMatrix) * modelViewMatrix;
const glm::dmat4 invMVPParts = glm::inverse(modelMatrix) *
glm::inverse(data.camera.combinedViewMatrix()) *
glm::inverse(glm::dmat4(projectionMatrix));
const glm::dvec3 orthoRight = glm::normalize(
glm::dvec3(invMVPParts * glm::dvec4(1.0, 0.0, 0.0, 0.0))
);
const glm::dvec3 orthoUp = glm::normalize(
glm::dvec3(invMVPParts * glm::dvec4(0.0, 1.0, 0.0, 0.0))
);
_labels->render(data, mvpMatrix, orthoRight, orthoUp, fadeInVariable);
}
}
@@ -753,10 +647,6 @@ void RenderablePlanesCloud::createPlanes() {
setBoundingSphere(maxRadius * _scaleFactor);
_fadeInDistances.setMaxValue(glm::vec2(10.f * maxSize));
}
if (_hasLabel && _labelDataIsDirty) {
_labelDataIsDirty = false;
}
}
} // namespace openspace

View File

@@ -27,7 +27,7 @@
#include <openspace/rendering/renderable.h>
#include <modules/space/speckloader.h>
#include <modules/space/labelscomponent.h>
#include <openspace/properties/optionproperty.h>
#include <openspace/properties/stringproperty.h>
#include <openspace/properties/scalar/boolproperty.h>
@@ -42,7 +42,6 @@
#include <unordered_map>
namespace ghoul::filesystem { class File; }
namespace ghoul::fontrendering { class Font; }
namespace ghoul::opengl {
class ProgramObject;
class Texture;
@@ -83,25 +82,15 @@ private:
void createPlanes();
void renderPlanes(const RenderData& data, const glm::dmat4& modelViewMatrix,
const glm::dmat4& projectionMatrix, float fadeInVariable);
void renderLabels(const RenderData& data,
const glm::dmat4& modelViewProjectionMatrix, const glm::dvec3& orthoRight,
const glm::dvec3& orthoUp, float fadeInVariable);
void loadTextures();
bool _hasSpeckFile = false;
bool _dataIsDirty = true;
bool _textColorIsDirty = true;
bool _hasLabel = false;
bool _labelDataIsDirty = true;
int _textMinSize = 0;
int _textMaxSize = 200;
bool _hasLabels = false;
properties::FloatProperty _scaleFactor;
properties::Vec3Property _textColor;
properties::FloatProperty _textOpacity;
properties::FloatProperty _textSize;
properties::BoolProperty _drawElements;
properties::OptionProperty _blendMode;
properties::Vec2Property _fadeInDistances;
@@ -113,20 +102,20 @@ private:
UniformCache(
modelViewProjectionTransform, alphaValue, fadeInValue, galaxyTexture
) _uniformCache;
std::shared_ptr<ghoul::fontrendering::Font> _font = nullptr;
std::unordered_map<int, std::unique_ptr<ghoul::opengl::Texture>> _textureMap;
std::unordered_map<int, std::string> _textureFileMap;
std::unordered_map<int, PlaneAggregate> _planesMap;
std::filesystem::path _speckFile;
std::filesystem::path _labelFile;
std::filesystem::path _texturesPath;
std::string _luminosityVar;
DistanceUnit _unit = DistanceUnit::Parsec;
speck::Dataset _dataset;
speck::Labelset _labelset;
// Everything related to the labels is handled by LabelsComponent
std::unique_ptr<LabelsComponent> _labels;
float _sluminosity = 1.f;

View File

@@ -22,6 +22,10 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#include <algorithm>
#include <string>
#include <string_view>
namespace {
constexpr std::string_view _loggerCat = "ExoplanetsModule";

View File

@@ -40,9 +40,9 @@
#include <optional>
namespace {
constexpr std::array<const char*, 6> UniformNames = {
constexpr std::array<const char*, 7> UniformNames = {
"modelViewProjectionTransform", "offset", "opacity",
"discTexture", "eccentricity", "semiMajorAxis"
"discTexture", "eccentricity", "semiMajorAxis", "multiplyColor"
};
constexpr openspace::properties::Property::PropertyInfo TextureInfo = {
@@ -74,6 +74,13 @@ namespace {
"from the semi-major axis and 1 is a whole semi-major axis's worth of deviation"
};
constexpr openspace::properties::Property::PropertyInfo MultiplyColorInfo = {
"MultiplyColor",
"Multiply Color",
"If set, the disc's texture is multiplied with this color. "
"Useful for applying a color grayscale images"
};
struct [[codegen::Dictionary(RenderableOrbitDisc)]] Parameters {
// [[codegen::verbatim(TextureInfo.description)]]
std::filesystem::path texture;
@@ -86,6 +93,9 @@ namespace {
// [[codegen::verbatim(OffsetInfo.description)]]
std::optional<glm::vec2> offset;
// [[codegen::verbatim(MultiplyColorInfo.description)]]
std::optional<glm::vec3> multiplyColor [[codegen::color()]];
};
#include "renderableorbitdisc_codegen.cpp"
} // namespace
@@ -102,6 +112,7 @@ RenderableOrbitDisc::RenderableOrbitDisc(const ghoul::Dictionary& dictionary)
, _size(SizeInfo, 1.f, 0.f, 3.0e12f)
, _eccentricity(EccentricityInfo, 0.f, 0.f, 1.f)
, _offset(OffsetInfo, glm::vec2(0.f), glm::vec2(0.f), glm::vec2(1.f))
, _multiplyColor(MultiplyColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f))
{
const Parameters p = codegen::bake<Parameters>(dictionary);
@@ -119,6 +130,10 @@ RenderableOrbitDisc::RenderableOrbitDisc(const ghoul::Dictionary& dictionary)
_texturePath.onChange([&]() { _texture->loadFromFile(_texturePath.value()); });
addProperty(_texturePath);
_multiplyColor = p.multiplyColor.value_or(_multiplyColor);
_multiplyColor.setViewOption(properties::Property::ViewOptions::Color);
addProperty(_multiplyColor);
_eccentricity = p.eccentricity;
_eccentricity.onChange([&]() { _planeIsDirty = true; });
addProperty(_eccentricity);
@@ -179,6 +194,7 @@ void RenderableOrbitDisc::render(const RenderData& data, RendererTasks&) {
_shader->setUniform(_uniformCache.opacity, opacity());
_shader->setUniform(_uniformCache.eccentricity, _eccentricity);
_shader->setUniform(_uniformCache.semiMajorAxis, _size);
_shader->setUniform(_uniformCache.multiplyColor, _multiplyColor);
ghoul::opengl::TextureUnit unit;
unit.activate();

View File

@@ -28,6 +28,7 @@
#include <openspace/properties/stringproperty.h>
#include <openspace/properties/scalar/floatproperty.h>
#include <openspace/properties/vector/vec2property.h>
#include <openspace/properties/vector/vec3property.h>
#include <openspace/rendering/renderable.h>
#include <openspace/rendering/texturecomponent.h>
#include <openspace/util/planegeometry.h>
@@ -64,10 +65,11 @@ private:
properties::FloatProperty _size;
properties::FloatProperty _eccentricity;
properties::Vec2Property _offset;
properties::Vec3Property _multiplyColor;
std::unique_ptr<ghoul::opengl::ProgramObject> _shader = nullptr;
UniformCache(modelViewProjection, offset, opacity, texture,
eccentricity, semiMajorAxis) _uniformCache;
eccentricity, semiMajorAxis, multiplyColor) _uniformCache;
std::unique_ptr<PlaneGeometry> _plane;
std::unique_ptr<TextureComponent> _texture;

View File

@@ -32,6 +32,7 @@ uniform vec2 offset; // relative to semi major axis
uniform float opacity;
uniform float eccentricity;
uniform float semiMajorAxis;
uniform vec3 multiplyColor = vec3(1.0);
const float Epsilon = 0.0000001;
@@ -122,6 +123,7 @@ Fragment getFragment() {
vec4 diffuse = texture(discTexture, textureCoord);
diffuse.a *= opacity;
diffuse.rgb *= multiplyColor;
Fragment frag;
frag.color = diffuse;

View File

@@ -41,6 +41,7 @@
#include <ccmc/Kameleon.h>
#include <ccmc/KameleonInterpolator.h>
#include <ccmc/Tracer.h>
#include <modules/kameleon/include/kameleonhelper.h>
#ifdef _MSC_VER

View File

@@ -64,3 +64,8 @@ disable_external_warnings(CCfits)
target_include_directories(openspace-module-fitsfilereader SYSTEM PRIVATE ${INCLUDES_FOR_TARGET})
target_link_libraries(openspace-module-fitsfilereader PRIVATE cfitsio CCfits)
target_precompile_headers(CCfits PRIVATE
<istream>
<ostream>
)

View File

@@ -139,13 +139,21 @@ create_new_module(
STATIC
${HEADER_FILES} ${SOURCE_FILES} ${SHADER_FILES}
)
target_precompile_headers(${globebrowsing_module} PRIVATE
<modules/globebrowsing/src/tileprovider/tileprovider.h>
<modules/globebrowsing/globebrowsingmodule.h>
<future>
<map>
)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/gdal_data DESTINATION modules/globebrowsing)
if (WIN32)
target_include_directories(openspace-module-globebrowsing SYSTEM PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/ext/gdal/include)
target_link_libraries(openspace-module-globebrowsing PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/ext/gdal/lib/gdal_i.lib)
register_external_libraries("${CMAKE_CURRENT_SOURCE_DIR}/ext/gdal/lib/gdal241.dll")
add_library(gdal SHARED IMPORTED)
target_include_directories(gdal SYSTEM INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/ext/gdal/include)
set_target_properties(gdal PROPERTIES IMPORTED_IMPLIB ${CMAKE_CURRENT_SOURCE_DIR}/ext/gdal/lib/gdal_i.lib)
set_target_properties(gdal PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/ext/gdal/lib/gdal241.dll)
target_link_libraries(openspace-module-globebrowsing PRIVATE gdal)
else (WIN32)
find_package(GDAL REQUIRED)

View File

@@ -55,6 +55,7 @@ uniform vec3 lightDirectionCameraSpace;
#if PERFORM_SHADING
uniform float orenNayarRoughness;
uniform float ambientIntensity;
#endif // PERFORM_SHADING
#if SHADOW_MAPPING_ENABLED
@@ -205,7 +206,8 @@ Fragment getFragment() {
normal,
lightDirectionCameraSpace,
normalize(positionCameraSpace),
orenNayarRoughness
orenNayarRoughness,
ambientIntensity
);
#endif // PERFORM_SHADING

View File

@@ -374,9 +374,9 @@ vec4 calculateNight(vec4 currentColor, vec2 uv, vec3 levelWeights,
vec4 calculateShadedColor(vec4 currentColor, vec3 ellipsoidNormalCameraSpace,
vec3 lightDirectionCameraSpace, vec3 viewDirectionCameraSpace,
float roughness)
float roughness, float ambientIntensity)
{
vec3 shadedColor = currentColor.rgb * 0.05;
vec3 shadedColor = currentColor.rgb * ambientIntensity;
vec3 n = normalize(ellipsoidNormalCameraSpace);

View File

@@ -222,6 +222,12 @@ namespace {
"The roughness factor that is used for the Oren-Nayar lighting mode"
};
constexpr openspace::properties::Property::PropertyInfo AmbientIntensityInfo = {
"AmbientIntensity",
"Ambient Intensity",
"The intensity factor for the ambient light used for light shading"
};
constexpr openspace::properties::Property::PropertyInfo NActiveLayersInfo = {
"NActiveLayers",
"Number of active layers",
@@ -524,6 +530,7 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary)
FloatProperty(TargetLodScaleFactorInfo, 15.f, 1.f, 50.f),
FloatProperty(CurrentLodScaleFactorInfo, 15.f, 1.f, 50.f),
FloatProperty(OrenNayarRoughnessInfo, 0.f, 0.f, 1.f),
FloatProperty(AmbientIntensityInfo, 0.05f, 0.f, 1.f),
IntProperty(NActiveLayersInfo, 0, 0, OpenGLCap.maxTextureUnits() / 3)
})
, _debugPropertyOwner({ "Debug" })
@@ -607,6 +614,7 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary)
addProperty(_generalProperties.targetLodScaleFactor);
addProperty(_generalProperties.currentLodScaleFactor);
addProperty(_generalProperties.orenNayarRoughness);
addProperty(_generalProperties.ambientIntensity);
_generalProperties.nActiveLayers.setReadOnly(true);
addProperty(_generalProperties.nActiveLayers);
@@ -964,6 +972,10 @@ void RenderableGlobe::renderChunks(const RenderData& data, RendererTasks&,
const float onr = _generalProperties.orenNayarRoughness;
_localRenderer.program->setUniform("orenNayarRoughness", onr);
_globalRenderer.program->setUniform("orenNayarRoughness", onr);
const float amb = _generalProperties.ambientIntensity;
_localRenderer.program->setUniform("ambientIntensity", amb);
_globalRenderer.program->setUniform("ambientIntensity", amb);
}
_localRenderer.program->setUniform("opacity", opacity());
@@ -2271,7 +2283,7 @@ int RenderableGlobe::desiredLevelByAvailableTileData(const Chunk& chunk) const {
ZoneScoped
const int currLevel = chunk.tileIndex.level;
for (const layers::Group& gi : layers::Groups) {
const std::vector<Layer*>& lyrs = _layerManager.layerGroup(gi.id).activeLayers();
for (Layer* layer : lyrs) {

View File

@@ -141,6 +141,7 @@ private:
properties::FloatProperty targetLodScaleFactor;
properties::FloatProperty currentLodScaleFactor;
properties::FloatProperty orenNayarRoughness;
properties::FloatProperty ambientIntensity;
properties::IntProperty nActiveLayers;
} _generalProperties;

View File

@@ -512,7 +512,7 @@ void ShadowComponent::saveDepthBuffer() {
<< std::endl;
ppmFile << "255" << std::endl;
std::cout << "\n\nSaving depth texture to file depthBufferShadowMapping.ppm\n\n";
LDEBUG("Saving depth texture to file depthBufferShadowMapping.ppm");
int k = 0;
for (int i = 0; i < _shadowDepthTextureWidth; i++) {
for (int j = 0; j < _shadowDepthTextureHeight; j++, k++) {
@@ -523,8 +523,7 @@ void ShadowComponent::saveDepthBuffer() {
}
ppmFile.close();
std::cout << "Texture saved to file depthBufferShadowMapping.ppm\n\n";
LDEBUG("Texture saved to file depthBufferShadowMapping.ppm");
}
buffer.clear();
@@ -552,7 +551,7 @@ void ShadowComponent::saveDepthBuffer() {
<< std::endl;
ppmFile << "255" << std::endl;
std::cout << "\n\nSaving texture position to positionBufferShadowMapping.ppm\n\n";
LDEBUG("Saving texture position to positionBufferShadowMapping.ppm");
float biggestValue = 0.f;
@@ -580,7 +579,7 @@ void ShadowComponent::saveDepthBuffer() {
ppmFile.close();
LINFO("Texture saved to file positionBufferShadowMapping.ppm");
LDEBUG("Texture saved to file positionBufferShadowMapping.ppm");
}
}

View File

@@ -80,3 +80,7 @@ create_new_module(
STATIC
${HEADER_FILES} ${SOURCE_FILES} ${SHADER_FILES}
)
target_precompile_headers(${iswa_module} PRIVATE
<openspace/json.h>
<future>
)

Some files were not shown because too many files have changed in this diff Show More