mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-30 07:49:31 -05:00
Merge conflicts resolved
This commit is contained in:
@@ -38,51 +38,50 @@ local Keybindings = {
|
||||
Key = "F3",
|
||||
Name = "Show Flux Value Legend",
|
||||
Command = "openspace.setPropertyValueSingle('ScreenSpace.Legendstreamnodes.Enabled', false);",
|
||||
Documentation = "Hides the legend image",
|
||||
Documentation = "Hides the legend image",
|
||||
Local = true
|
||||
},
|
||||
{
|
||||
Key = "F4",
|
||||
Name = "Change to Earth focus",
|
||||
Command =
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.Earthfocus.distancePlanetThreshold', 155022826061.149994);"..
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.Earthfocus.enhanceMethod', 0.000000);"..
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', '');"..
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Earth');"..
|
||||
"openspace.navigation.loadNavigationState('Earth');"..
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);",
|
||||
Documentation = "Start to focus on Earth",
|
||||
Name = "Focus on Earth",
|
||||
GuiPath = "/CCMC/Nodes",
|
||||
Local = false
|
||||
Key = "F4",
|
||||
Name = "Change to Earth focus",
|
||||
Command =
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.Earthfocus.distancePlanetThreshold', 155022826061.149994);"..
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.Earthfocus.enhanceMethod', 0.000000);"..
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', '');"..
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Earth');"..
|
||||
"openspace.navigation.loadNavigationState('Earth');"..
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);",
|
||||
Documentation = "Start to focus on Earth",
|
||||
Name = "Focus on Earth",
|
||||
GuiPath = "/CCMC/Nodes",
|
||||
Local = false
|
||||
},
|
||||
{
|
||||
Key = "Shift+r",
|
||||
Command =
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.Color.colorMode', 1.000000);" ..
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.NodeGroup.skippingNodes', 1.000000);" ..
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.NodeGroup.amountOfNodes', 1.000000);" ..
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.Color.fluxColorAlpha', 1.000000);" ..
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.NodeGroup.nodeSkip', 1.000000);" ..
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.NodeGroup.nodeSize', 2.000000);" ..
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.NodeGroup.nodeSizeLargerFlux', 2.00000);" ..
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.NodeGroup.skippingNodesByFlux', 0.000000);" ..
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.NodeGroup.skippingNodesByRadius', 0.000000);" ..
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.Streams.thresholdFlux', 0.000000);" ..
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.Streams.filterLower', 0.000000);" ..
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.Earthfocus.distancePlanetThreshold', 0.000000);"..
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', '');"..
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Sun');"..
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);"..
|
||||
"openspace.navigation.loadNavigationState('Sun');"..
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.Streams.filterUpper', 5.000000);",
|
||||
--"Todo, fix the last one which is on the z axis"
|
||||
--"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.Streams.limitsZLower', {--358139527168.969971,953488375808.000000});",
|
||||
Documentation = "Resets the visualisation of streamnodes",
|
||||
Name = "Reset Streamnodes Vis back",
|
||||
GuiPath = "/CCMC/Nodes",
|
||||
Local = false
|
||||
|
||||
Key = "Shift+r",
|
||||
Command =
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.Color.colorMode', 1.000000);" ..
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.NodeGroup.skippingNodes', 1.000000);" ..
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.NodeGroup.amountOfNodes', 1.000000);" ..
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.Color.fluxColorAlpha', 1.000000);" ..
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.NodeGroup.nodeSkip', 1.000000);" ..
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.NodeGroup.nodeSize', 2.000000);" ..
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.NodeGroup.nodeSizeLargerFlux', 2.00000);" ..
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.NodeGroup.skippingNodesByFlux', 0.000000);" ..
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.NodeGroup.skippingNodesByRadius', 0.000000);" ..
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.Streams.thresholdFlux', 0.000000);" ..
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.Streams.filterLower', 0.000000);" ..
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.Earthfocus.distancePlanetThreshold', 0.000000);"..
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', '');"..
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Sun');"..
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);"..
|
||||
"openspace.navigation.loadNavigationState('Sun');"..
|
||||
"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.Streams.filterUpper', 5.000000);",
|
||||
--"Todo, fix the last one which is on the z axis"
|
||||
--"openspace.setPropertyValueSingle('Scene.MAS_MHD_StreamNodes.Renderable.Streams.limitsZLower', {--358139527168.969971,953488375808.000000});",
|
||||
Documentation = "Resets the visualisation of streamnodes",
|
||||
Name = "Reset Streamnodes Vis back",
|
||||
GuiPath = "/CCMC/Nodes",
|
||||
Local = false
|
||||
},
|
||||
{
|
||||
Key = "Shift+s",
|
||||
@@ -134,6 +133,19 @@ local Keybindings = {
|
||||
GuiPath = "/CCMC/Nodes",
|
||||
Local = false
|
||||
},
|
||||
{
|
||||
Key = "F11",
|
||||
Command =
|
||||
"openspace.setPropertyValueSingle('Scene.EarthAtmosphere.Renderable.SunFollowingCamera', true);" ..
|
||||
"openspace.setPropertyValueSingle('Scene.Moon.Renderable.PerformShading', false);" ..
|
||||
"openspace.setPropertyValueSingle('Scene.MoonTrail.Renderable.Appearance.EnableFade', false);" ..
|
||||
"openspace.setPropertyValueSingle('Scene.MoonTrail.Renderable.Appearance.Color', {1.000000,1.000000,1.000000});" ..
|
||||
"openspace.setPropertyValueSingle('Scene.Earth.Renderable.Layers.NightLayers.Earth_at_Night_2012.Enabled', false);",
|
||||
Documentation = "Sun artificially placed, remove shadow on Earth and Moon and show Moon trail",
|
||||
Name = "Earth and moon without shadow",
|
||||
GuiPath = "/CCMC/Nodes",
|
||||
Local = false
|
||||
},
|
||||
{
|
||||
Key = "i",
|
||||
Command = [[
|
||||
@@ -164,8 +176,6 @@ local Keybindings = {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
asset.onInitialize(function ()
|
||||
openspace.time.setTime("2000 JUL 14 08:33:37.100")
|
||||
|
||||
|
||||
@@ -25,38 +25,9 @@ local speedofLight = {
|
||||
},
|
||||
GUI = {
|
||||
Path = "/Solar System/Heliosphere",
|
||||
Name = "Lighttravel"
|
||||
Name = "Light Travel"
|
||||
}
|
||||
}
|
||||
|
||||
local SpeedOfLightLabel = {
|
||||
Identifier = "LightLabel",
|
||||
Parent = earthTransforms.EarthBarycenter.Identifier,
|
||||
Renderable = {
|
||||
Enabled = false,
|
||||
Type = "RenderableLabels",
|
||||
LabelText = "Speed of light",
|
||||
FontSize = 80.0,
|
||||
LabelSize = 8.6,
|
||||
LabelMaxSize = 80.0,
|
||||
LabelMinSize = 1.0,
|
||||
LabelOrientationOption = "Camera View Direction",
|
||||
BlendMode = "Additive",
|
||||
--TransformationMatrix = {
|
||||
-- 1.0, 0.0, 0.0, 0.0,
|
||||
-- 0.0, 0.0, 0.0, 0.0,
|
||||
-- 0.0, 0.0, 0.0, 0.0,
|
||||
-- 0.0, 0.0, 0.0, 1.0
|
||||
-- },
|
||||
},
|
||||
Tag = { "solarsystem_labels" },
|
||||
GUI = {
|
||||
Name = "Speed of Light Label",
|
||||
Path = "/Solar System/Heliosphere"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
assetHelper.registerSceneGraphNodesAndExport(asset, { speedofLight, SpeedOfLightLabel})
|
||||
assetHelper.registerSceneGraphNodesAndExport(asset, { speedofLight })
|
||||
|
||||
|
||||
@@ -233,6 +233,11 @@ namespace {
|
||||
"Toggles the rendering of moving particles along the lines. Can, for example, "
|
||||
"illustrate magnetic flow."
|
||||
};
|
||||
constexpr openspace::properties::Property::PropertyInfo InterestingStreamsInfo = {
|
||||
"interestingStreamsEnabled",
|
||||
"Interesting Streams Enabled",
|
||||
"Toggles the rendering of selected streams."
|
||||
};
|
||||
constexpr openspace::properties::Property::PropertyInfo FlowParticleSizeInfo = {
|
||||
"particleSize",
|
||||
"Particle Size",
|
||||
@@ -324,6 +329,11 @@ namespace {
|
||||
"Nodes close to Earth blinks",
|
||||
"Boolean for blinking."
|
||||
};
|
||||
/*constexpr openspace::properties::Property::PropertyInfo TestChangeInfo = {
|
||||
"testChange",
|
||||
"Test factor",
|
||||
"Test"
|
||||
};*/
|
||||
enum class SourceFileType : int {
|
||||
Json = 0,
|
||||
Invalid
|
||||
@@ -414,6 +424,7 @@ RenderableStreamNodes::RenderableStreamNodes(const ghoul::Dictionary& dictionary
|
||||
glm::vec4(1.f)
|
||||
)
|
||||
, _pFlowEnabled(FlowEnabledInfo, false)
|
||||
, _pInterestingStreamsEnabled(InterestingStreamsInfo, false)
|
||||
, _pFlowGroup({ "Flow" })
|
||||
, _pFlowParticleSize(FlowParticleSizeInfo, 5, 0, 500)
|
||||
, _pFlowParticleSpacing(FlowParticleSpacingInfo, 60, 0, 500)
|
||||
@@ -434,6 +445,7 @@ RenderableStreamNodes::RenderableStreamNodes(const ghoul::Dictionary& dictionary
|
||||
, _pMinNodeSize(MinNodeSizeInfo, 1.f, 1.f, 10.f)
|
||||
, _pUseBlinking(UseBlinkInfo, true)
|
||||
, _pBlinkAlways(AlwaysBlinkInfo, false)
|
||||
//, _pTestChange(TestChangeInfo, 0.5f, 0.0f, 1.f)
|
||||
|
||||
{
|
||||
_dictionary = std::make_unique<ghoul::Dictionary>(dictionary);
|
||||
@@ -1147,6 +1159,7 @@ void RenderableStreamNodes::setupProperties() {
|
||||
_pEarthdistGroup.addProperty(_pDistancemethod);
|
||||
_pEarthdistGroup.addProperty(_pDistanceThreshold);
|
||||
_pEarthdistGroup.addProperty(_pEnhancemethod);
|
||||
_pEarthdistGroup.addProperty(_pInterestingStreamsEnabled);
|
||||
|
||||
_pFlowGroup.addProperty(_pFlowEnabled);
|
||||
_pFlowGroup.addProperty(_pFlowColor);
|
||||
@@ -1155,6 +1168,8 @@ void RenderableStreamNodes::setupProperties() {
|
||||
_pFlowGroup.addProperty(_pFlowSpeed);
|
||||
_pFlowGroup.addProperty(_pUseFlowColor);
|
||||
|
||||
// _pStreamGroup.addProperty(_pTestChange);
|
||||
|
||||
// --------------------- Add Options to OptionProperties --------------------- //
|
||||
_pGoesEnergyBins.addOption(static_cast<int>(GoesEnergyBins::Emin01), "Emin01");
|
||||
_pGoesEnergyBins.addOption(static_cast<int>(GoesEnergyBins::Emin03), "Emin03");
|
||||
@@ -1180,7 +1195,7 @@ void RenderableStreamNodes::setupProperties() {
|
||||
_pEnhancemethod.addOption(static_cast<int>(EnhanceMethod::Sizescaling), "SizeScaling");
|
||||
_pEnhancemethod.addOption(static_cast<int>(EnhanceMethod::Colortables), "ColorTables");
|
||||
_pEnhancemethod.addOption(static_cast<int>(EnhanceMethod::Outline), "Outline");
|
||||
_pEnhancemethod.addOption(static_cast<int>(EnhanceMethod::Lines), "Lines");
|
||||
_pEnhancemethod.addOption(static_cast<int>(EnhanceMethod::Blinking), "Blinking");
|
||||
_pEnhancemethod.addOption(static_cast<int>(EnhanceMethod::Sizeandcolor), "Sizescaling and colortables");
|
||||
_pEnhancemethod.addOption(static_cast<int>(EnhanceMethod::test), "test");
|
||||
|
||||
@@ -1333,6 +1348,7 @@ void RenderableStreamNodes::render(const RenderData& data, RendererTasks&) {
|
||||
_shaderProgram->setUniform("enhanceMethod", _pEnhancemethod);
|
||||
_shaderProgram->setUniform("flowColor", _pFlowColor);
|
||||
_shaderProgram->setUniform("usingParticles", _pFlowEnabled);
|
||||
_shaderProgram->setUniform("usingInterestingStreams", _pInterestingStreamsEnabled);
|
||||
_shaderProgram->setUniform("particleSize", _pFlowParticleSize);
|
||||
_shaderProgram->setUniform("particleSpacing", _pFlowParticleSpacing);
|
||||
_shaderProgram->setUniform("particleSpeed", _pFlowSpeed);
|
||||
@@ -1349,7 +1365,8 @@ void RenderableStreamNodes::render(const RenderData& data, RendererTasks&) {
|
||||
_shaderProgram->setUniform("drawHollow", _pDrawingHollow);
|
||||
_shaderProgram->setUniform("useGaussian", _pGaussianAlphaFilter);
|
||||
_shaderProgram->setUniform("usingRadiusPerspective", _pRadiusPerspective);
|
||||
_shaderProgram->setUniform("PerspectiveDistanceFactor", _pPerspectiveDistanceFactor);
|
||||
_shaderProgram->setUniform("perspectiveDistanceFactor", _pPerspectiveDistanceFactor);
|
||||
//_shaderProgram->setUniform("testChange", _pTestChange);
|
||||
_shaderProgram->setUniform("maxNodeSize", _pMaxNodeSize);
|
||||
_shaderProgram->setUniform("minNodeSize", _pMinNodeSize);
|
||||
_shaderProgram->setUniform("UseBlinking", _pUseBlinking);
|
||||
|
||||
@@ -89,7 +89,7 @@ private:
|
||||
Sizescaling = 0,
|
||||
Colortables = 1,
|
||||
Outline = 2,
|
||||
Lines = 3,
|
||||
Blinking = 3,
|
||||
Sizeandcolor = 4,
|
||||
test = 5
|
||||
};
|
||||
@@ -230,6 +230,8 @@ private:
|
||||
properties::FloatProperty _pMaxNodeDistanceSize;
|
||||
// Threshold for where to interpolate between the max and min node distance
|
||||
properties::FloatProperty _pNodeDistanceThreshold;
|
||||
// Toggle selected streams [ON/OFF]
|
||||
properties::BoolProperty _pInterestingStreamsEnabled;
|
||||
|
||||
properties::FloatProperty _pMaxNodeSize;
|
||||
properties::FloatProperty _pMinNodeSize;
|
||||
@@ -289,6 +291,8 @@ private:
|
||||
properties::BoolProperty _pUseBlinking;
|
||||
properties::BoolProperty _pBlinkAlways;
|
||||
|
||||
//properties::FloatProperty _pTestChange;
|
||||
|
||||
// initialization
|
||||
std::vector<std::string> _sourceFiles;
|
||||
// binary files sourcefolder
|
||||
|
||||
@@ -28,6 +28,7 @@ uniform sampler2D texture1;
|
||||
uniform bool drawCircles;
|
||||
uniform bool drawHollow;
|
||||
uniform bool useGaussian;
|
||||
//uniform float testChange;
|
||||
uniform bool blinkingAlways;
|
||||
uniform bool UseBlinking;
|
||||
in vec2 vs_st;
|
||||
@@ -50,6 +51,13 @@ Fragment getFragment() {
|
||||
vec2 coord = gl_PointCoord - vec2(0.5);
|
||||
|
||||
if(camera_IsCloseEnough > 0.5){
|
||||
|
||||
/*if(length(coord.x) > 0.15){
|
||||
if((coord.y) > 0){
|
||||
discard;
|
||||
}
|
||||
}*/
|
||||
|
||||
if(drawCircles){
|
||||
|
||||
if(length(coord) > 0.5){
|
||||
|
||||
@@ -76,6 +76,7 @@ uniform int activeStreamNumber;
|
||||
uniform bool firstRender;
|
||||
uniform int enhanceMethod;
|
||||
uniform double time;
|
||||
uniform bool usingInterestingStreams;
|
||||
|
||||
|
||||
//uniform float interestingStreams[4];
|
||||
@@ -98,7 +99,8 @@ uniform vec3 cameraPos;
|
||||
//uniform vec2 screenSize;
|
||||
uniform bool usingCameraPerspective;
|
||||
uniform bool usingRadiusPerspective;
|
||||
uniform float PerspectiveDistanceFactor;
|
||||
uniform float perspectiveDistanceFactor;
|
||||
|
||||
uniform float maxNodeSize;
|
||||
uniform float minNodeSize;
|
||||
// Inputs
|
||||
@@ -219,120 +221,62 @@ bool CheckvertexIndex(){
|
||||
//todo fix gl_VertexID
|
||||
|
||||
bool isParticle(){
|
||||
|
||||
int modulusResult = int(double(particleSpeed) * time + gl_VertexID) % particleSpacing;
|
||||
float speedIrregular = 1;
|
||||
if(rValue > 1){
|
||||
//if(Streamnumber % 2 == 1)
|
||||
//{
|
||||
speedIrregular = 4;
|
||||
modulusResult = int(double(particleSpeed)* speedIrregular * time + gl_VertexID) % particleSpacing;
|
||||
//}
|
||||
//else{
|
||||
// modulusResult = int(double(particleSpeed) * time + gl_VertexID) % particleSpacing;
|
||||
//}
|
||||
|
||||
}
|
||||
else{
|
||||
modulusResult = int(double(particleSpeed) * time + gl_VertexID*2) % particleSpacing;
|
||||
}
|
||||
return modulusResult > 0 && modulusResult <= particleSize;
|
||||
return false;
|
||||
}
|
||||
|
||||
//function for showing nodes different depending on distance to earth
|
||||
void DecidehowtoshowClosetoEarth(){
|
||||
//Sizescaling
|
||||
if(enhanceMethod == 0){
|
||||
float tempR = rValue + 0.4;
|
||||
if(tempR > 1.5){
|
||||
tempR = 1.5;
|
||||
}
|
||||
// SizeScaling
|
||||
if(enhanceMethod == 0){
|
||||
float tempR = rValue + 0.4;
|
||||
if(tempR > 1.5){
|
||||
tempR = 1.5;
|
||||
}
|
||||
gl_PointSize = tempR * tempR * tempR * gl_PointSize * 5;
|
||||
return;
|
||||
}
|
||||
//Colortables
|
||||
if(enhanceMethod == 1){
|
||||
vec4 fluxColor = getTransferFunctionColor(colorTable);
|
||||
vs_color = vec4(fluxColor.xyz, fluxColor.a);
|
||||
return;
|
||||
}
|
||||
//Outline
|
||||
if(enhanceMethod == 2){
|
||||
if(!firstRender && vs_color.x != 0 && vs_color.y != 0){
|
||||
gl_PointSize = gl_PointSize + 1;
|
||||
vs_color = vec4(streamColor.xyz, fluxColorAlpha);
|
||||
}
|
||||
return;
|
||||
}
|
||||
//lines
|
||||
if(enhanceMethod == 3){
|
||||
// Draw every other line grey
|
||||
vs_color = vec4(0.18, 0.18, 0.18, 1*fluxColorAlpha);
|
||||
|
||||
//float interestingStreams[6] = float[](154, 156, 153, 157, 158, 163);
|
||||
// vs_color = vec4(0);
|
||||
float interestingStreams[26] = float[](135, 138, 145, 146, 147, 149, 153, 154, 155, 156, 157, 158, 159, 160, 167, 163,
|
||||
168, 169, 170, 172, 174, 180, 181, 183, 356, 364);
|
||||
//float interestingStreams[3] = float[](37, 154, 210);
|
||||
|
||||
int modulusResult = int(double(particleSpeed) * time + gl_VertexID) % particleSpacing;
|
||||
|
||||
for(int i = 0; i < interestingStreams.length(); i++){
|
||||
if(Streamnumber == interestingStreams[i]){
|
||||
// if(!firstRender){
|
||||
// vs_color = vec4(streamColor.xyz, fluxColorAlpha);
|
||||
if(usingParticles && isParticle() && rValue > 0.f){
|
||||
if(modulusResult >= particleSize - 30){
|
||||
|
||||
if(flowColoring){
|
||||
vec4 fluxColor3 = getTransferFunctionColor(colorTable);
|
||||
vs_color = vec4(fluxColor3.xyz, flowColor.a * 0.8);
|
||||
//vs_color = vec4(1,1,1,1);
|
||||
}
|
||||
else{
|
||||
vs_color = vec4(0.9,0.9,0.9,0.5);
|
||||
//vs_color = flowColor;
|
||||
}
|
||||
}
|
||||
else{
|
||||
vec4 fluxColorFlow = getTransferFunctionColor(colorTableFlow);
|
||||
vs_color = vec4(fluxColorFlow.xyz, 1);
|
||||
}
|
||||
//vs_color = vec4(0.37, 0.37, 0.37, flowColor.a);
|
||||
// }
|
||||
// else{
|
||||
// vec4 fluxColor3 = getTransferFunctionColor(colorTable);
|
||||
// vs_color = vec4(fluxColor3.xyz, fluxColor3.a);
|
||||
// vs_color = vec4(0.37, 0.37, 0.37, flowColor.a);
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
//SizeandColor
|
||||
// ColorTables
|
||||
if(enhanceMethod == 1){
|
||||
vec4 fluxColor = getTransferFunctionColor(colorTable);
|
||||
vs_color = vec4(fluxColor.xyz, fluxColor.a);
|
||||
return;
|
||||
}
|
||||
// Outline
|
||||
if(enhanceMethod == 2){
|
||||
if(!firstRender && vs_color.x != 0 && vs_color.y != 0){
|
||||
gl_PointSize = gl_PointSize + 1;
|
||||
vs_color = vec4(streamColor.xyz, fluxColorAlpha);
|
||||
}
|
||||
return;
|
||||
}
|
||||
// Blinking
|
||||
if(enhanceMethod == 3){
|
||||
}
|
||||
//SizeColor
|
||||
if(enhanceMethod == 4){
|
||||
vec4 fluxColor3 = getTransferFunctionColor(colorTable);
|
||||
vs_color = vec4(fluxColor3.xyz, fluxColor3.a);
|
||||
vec4 fluxColor3 = getTransferFunctionColor(colorTable);
|
||||
vs_color = vec4(fluxColor3.xyz, fluxColor3.a);
|
||||
|
||||
float tempR2 = rValue + 0.4;
|
||||
if(tempR2 > 1.5){
|
||||
tempR2 = 1.5;
|
||||
}
|
||||
gl_PointSize = tempR2 * tempR2 * tempR2 * gl_PointSize * 5;
|
||||
float tempR2 = rValue + 0.4;
|
||||
if(tempR2 > 1.5){
|
||||
tempR2 = 1.5;
|
||||
}
|
||||
gl_PointSize = tempR2 * tempR2 * tempR2 * gl_PointSize * 5;
|
||||
}
|
||||
}
|
||||
|
||||
void CheckdistanceMethod() {
|
||||
//Enhance by distance to Earth
|
||||
float maxdist = 10000000000.f * PerspectiveDistanceFactor;
|
||||
float maxdist = 10000000000.f * perspectiveDistanceFactor;
|
||||
float distancevec = distance(earthPos, in_position.xyz);
|
||||
vs_closeToEarth = 0;
|
||||
if(distancevec < maxdist){
|
||||
|
||||
if(distancevec < maxdist / 2){
|
||||
vs_closeToEarth = 1;
|
||||
//gl_PointSize = 20;
|
||||
gl_PointSize = 20;
|
||||
}
|
||||
}
|
||||
if(enhanceMethod == 1 || enhanceMethod == 4){
|
||||
@@ -405,6 +349,45 @@ void main() {
|
||||
vs_color = vec4(0);
|
||||
}
|
||||
|
||||
if(usingInterestingStreams){
|
||||
// Draw every other line grey
|
||||
//vs_color = vec4(0.18, 0.18, 0.18, 1*fluxColorAlpha);
|
||||
|
||||
vs_color = vec4(0);
|
||||
|
||||
float interestingStreams[6] = float[](154, 156, 153, 157, 158, 163);
|
||||
//float interestingStreams[26] = float[](135, 138, 145, 146, 147, 149, 153, 154, 155, 156, 157, 158, 159, 160, 167, 163,
|
||||
//168, 169, 170, 172, 174, 180, 181, 183, 356, 364);
|
||||
//float interestingStreams[3] = float[](37, 154, 210);
|
||||
for(int i = 0; i < interestingStreams.length(); i++){
|
||||
if(Streamnumber == interestingStreams[i]){
|
||||
vec4 fluxColor3 = getTransferFunctionColor(colorTable);
|
||||
vs_color = vec4(fluxColor3.xyz, 1*fluxColorAlpha);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(usingParticles && isParticle() && rValue > 0.f){
|
||||
int modulusResult = int(double(particleSpeed) * time + gl_VertexID)
|
||||
% particleSpacing;
|
||||
|
||||
if(modulusResult >= particleSize - 30){
|
||||
if(flowColoring){
|
||||
vec4 fluxColor3 = getTransferFunctionColor(colorTable);
|
||||
vs_color = vec4(fluxColor3.xyz, flowColor.a * 0.8);
|
||||
//vs_color = vec4(1,1,1,1);
|
||||
}
|
||||
else{
|
||||
vs_color = vec4(0.9,0.9,0.9,0.5);
|
||||
//vs_color = flowColor;
|
||||
}
|
||||
}
|
||||
else{
|
||||
vec4 fluxColorFlow = getTransferFunctionColor(colorTableFlow);
|
||||
vs_color = vec4(fluxColorFlow.xyz, 1);
|
||||
}
|
||||
}
|
||||
|
||||
if(usingCameraPerspective){
|
||||
float rtemp = 1.0;
|
||||
if(rValue > 1.0){
|
||||
@@ -413,21 +396,20 @@ void main() {
|
||||
else{
|
||||
rtemp = rValue;
|
||||
}
|
||||
|
||||
float maxdist = 100000000000.f * PerspectiveDistanceFactor;
|
||||
//maxdist = 600000000000.f;
|
||||
float distancevec = distance(cameraPos, in_position.xyz);
|
||||
|
||||
float maxDistance = 100000000000.f * perspectiveDistanceFactor;
|
||||
float distanceVec = distance(cameraPos, in_position.xyz);
|
||||
|
||||
if(distancevec > maxdist && vs_closeToEarth < 0.5){
|
||||
if(distanceVec > maxDistance && vs_closeToEarth < 0.5){
|
||||
camera_IsCloseEnough = 0;
|
||||
}
|
||||
else{
|
||||
camera_IsCloseEnough = 1;
|
||||
}
|
||||
if(distancevec < maxdist){
|
||||
if(distanceVec < maxDistance){
|
||||
vs_closeToEarth = 0;
|
||||
float distScale = 1 - smoothstep(0, maxdist, distancevec);
|
||||
//float distMinScale = 1 - smoothstep(0, nodeDistanceThreshold, distancevec);
|
||||
float distScale = 1 - smoothstep(0, maxDistance, distanceVec);
|
||||
//float distMinScale = 1 - smoothstep(0, nodeDistanceThreshold, distanceVec);
|
||||
float factorS = 1.f;
|
||||
if(usingRadiusPerspective){
|
||||
factorS = pow(distScale, 9) * 500.f * pow(rtemp, 2);
|
||||
@@ -436,21 +418,18 @@ void main() {
|
||||
factorS = pow(distScale, 9) * 500.f;
|
||||
}
|
||||
gl_PointSize = factorS * maxNodeDistanceSize * 0.8;
|
||||
}
|
||||
}
|
||||
// else{
|
||||
// gl_PointSize = nodeSize;
|
||||
// }
|
||||
|
||||
|
||||
if(gl_PointSize > maxNodeSize){
|
||||
gl_PointSize = maxNodeSize;
|
||||
gl_PointSize = maxNodeSize;
|
||||
}
|
||||
|
||||
if(gl_PointSize < minNodeSize){
|
||||
gl_PointSize = minNodeSize;
|
||||
}
|
||||
|
||||
|
||||
gl_PointSize = minNodeSize;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user