Small changes to be able to show different visualizations on nodes close to the Earth

This commit is contained in:
Emilie
2020-09-14 16:07:56 +02:00
parent b0928405eb
commit 3f7e35a6f0
5 changed files with 15 additions and 15 deletions

View File

@@ -21,8 +21,8 @@ local streamnodeColorTable = transferFunctions .. "/stream_nodes.txt"
local streamnodeColorTableCMR = transferFunctions .. "/CMR.txt"
local streamnodeColorTableEarth = transferFunctions .. "/stream_nodes_grey_scale.txt"
local streamnodeColorTableFlow = transferFunctions .. "/stream_nodes_flow.txt"
local streamnodeColorTableIlluminance = transferFunctions .. "/CMR_illuminance.txt"
local streamnodeColorTableIlluminance2 = transferFunctions .. "/CMR_illuminance2.txt"
--local streamnodeColorTableIlluminance = transferFunctions .. "/CMR_illuminance.txt"
--local streamnodeColorTableIlluminance2 = transferFunctions .. "/CMR_illuminance2.txt"
local streamnodesDirectory = asset.syncedResource({
Name = "Bastille Day Stream nodes",
@@ -61,8 +61,8 @@ local Streamnodes = {
streamnodeColorTableCMR,
streamnodeColorTableEarth,
streamnodeColorTableFlow,
streamnodeColorTableIlluminance,
streamnodeColorTableIlluminance2,
--streamnodeColorTableIlluminance,
--streamnodeColorTableIlluminance2,
},
--ColorTableMinMax = {
-- { 0, 1000000 },

View File

@@ -546,8 +546,8 @@ void RenderableStreamNodes::initializeGL() {
_transferFunctionCMR = std::make_unique<TransferFunction>(absPath(_colorTablePaths[1]));
_transferFunctionEarth = std::make_unique<TransferFunction>(absPath(_colorTablePaths[2]));
_transferFunctionFlow = std::make_unique<TransferFunction>(absPath(_colorTablePaths[3]));
_transferFunctionIlluminance = std::make_unique<TransferFunction>(absPath(_colorTablePaths[4]));
_transferFunctionIlluminance2 = std::make_unique<TransferFunction>(absPath(_colorTablePaths[5]));
//_transferFunctionIlluminance = std::make_unique<TransferFunction>(absPath(_colorTablePaths[4]));
//_transferFunctionIlluminance2 = std::make_unique<TransferFunction>(absPath(_colorTablePaths[5]));
// EXTRACT OPTIONAL INFORMATION FROM DICTIONARY
std::string outputFolderPath;
@@ -1474,7 +1474,7 @@ void RenderableStreamNodes::render(const RenderData& data, RendererTasks&) {
_transferFunctionFlow->bind(); // Calls update internally
_shaderProgram->setUniform("colorTableFlow", textureUnitFlow);
ghoul::opengl::TextureUnit textureUnitIlluminance;
/*ghoul::opengl::TextureUnit textureUnitIlluminance;
textureUnitIlluminance.activate();
_transferFunctionIlluminance->bind(); // Calls update internally
_shaderProgram->setUniform("colorTableIlluminance", textureUnitIlluminance);
@@ -1482,7 +1482,7 @@ void RenderableStreamNodes::render(const RenderData& data, RendererTasks&) {
ghoul::opengl::TextureUnit textureUnitIlluminance2;
textureUnitIlluminance2.activate();
_transferFunctionIlluminance2->bind(); // Calls update internally
_shaderProgram->setUniform("colorTableIlluminance2", textureUnitIlluminance2);
_shaderProgram->setUniform("colorTableIlluminance2", textureUnitIlluminance2);*/
}
const std::vector<glm::vec3>& vertPos = _vertexPositions;

View File

@@ -162,9 +162,9 @@ private:
// Transfer function used to color line flow
std::unique_ptr<TransferFunction> _transferFunctionFlow;
// Transfer function used to color illuminance for nodes close to the Earth
std::unique_ptr<TransferFunction> _transferFunctionIlluminance;
//std::unique_ptr<TransferFunction> _transferFunctionIlluminance;
// Transfer function used to color illuminance for nodes close to the Earth2
std::unique_ptr<TransferFunction> _transferFunctionIlluminance2;
//std::unique_ptr<TransferFunction> _transferFunctionIlluminance2;
// ------------------------------------ VECTORS ----------------------------------- //
// Paths to color tables. One for each 'ColorFlux'

View File

@@ -132,12 +132,12 @@ Fragment getFragment() {
if(usingPulse && usingCameraPerspective){
if(vs_closeToEarth > 0.5){
if(pulsatingAlways || camera_IsCloseEnough > 0.5){
if(length(coord) > 0.46){
if(length(coord) > 0.40){ //0.46 (utan vec4(1, 1, 1, 1)), 0.4, 0.32
frag.color = vec4(1,1,1,1); //HÄR
float speed = 60.f;
int modulusResult = int(double(speed) * vs_time) % 60;
if(modulusResult > 0 && modulusResult < 30){
//frag.color = vec4(1, 1, 1, 1);
discard;
//discard;
}
}
}

View File

@@ -35,8 +35,8 @@ uniform sampler1D colorTable;
uniform sampler1D colorTableCMR;
uniform sampler1D colorTableEarth;
uniform sampler1D colorTableFlow;
uniform sampler1D colorTableIlluminance;
uniform sampler1D colorTableIlluminance2;
//uniform sampler1D colorTableIlluminance;
//uniform sampler1D colorTableIlluminance2;
uniform vec2 colorTableRange;
// Uniforms needed for Particle Flow