From f78bf69be55123616bbbf4d1d198a826426df9d6 Mon Sep 17 00:00:00 2001 From: Daniel Emminizer Date: Tue, 15 Mar 2022 13:20:35 -0400 Subject: [PATCH] DEV: Removed GLSL_DEFAULT_PRECISION_FLOAT references from shaders, unused. Removed #version string from GradientShader.cpp and Picker.cpp shaders. Intended to allow code to compile against master osgEarth. Review: 27255 --HG-- branch : stable --- SDK/simUtil/TerrainToggleEffect.frag.glsl | 1 - SDK/simUtil/TerrainToggleEffect.vert.glsl | 1 - SDK/simUtil/VelocityParticleLayer.part.frag.glsl | 1 - SDK/simUtil/VelocityParticleLayer.part.vert.glsl | 1 - SDK/simVis/DisableDepthOnAlpha.frag.glsl | 1 - SDK/simVis/GradientShader.cpp | 2 -- SDK/simVis/Picker.cpp | 1 - 7 files changed, 8 deletions(-) diff --git a/SDK/simUtil/TerrainToggleEffect.frag.glsl b/SDK/simUtil/TerrainToggleEffect.frag.glsl index 7b35e58bb..bbbad6fd1 100644 --- a/SDK/simUtil/TerrainToggleEffect.frag.glsl +++ b/SDK/simUtil/TerrainToggleEffect.frag.glsl @@ -1,5 +1,4 @@ #version $GLSL_VERSION_STR -$GLSL_DEFAULT_PRECISION_FLOAT #pragma vp_entryPoint simutil_terraintoggle_frag #pragma vp_location fragment_coloring diff --git a/SDK/simUtil/TerrainToggleEffect.vert.glsl b/SDK/simUtil/TerrainToggleEffect.vert.glsl index 027761be6..ca08ba880 100644 --- a/SDK/simUtil/TerrainToggleEffect.vert.glsl +++ b/SDK/simUtil/TerrainToggleEffect.vert.glsl @@ -1,5 +1,4 @@ #version $GLSL_VERSION_STR -$GLSL_DEFAULT_PRECISION_FLOAT #pragma vp_entryPoint simutil_terraintoggle_vert #pragma vp_location vertex_view diff --git a/SDK/simUtil/VelocityParticleLayer.part.frag.glsl b/SDK/simUtil/VelocityParticleLayer.part.frag.glsl index cbd0504c8..56bd7d2e7 100644 --- a/SDK/simUtil/VelocityParticleLayer.part.frag.glsl +++ b/SDK/simUtil/VelocityParticleLayer.part.frag.glsl @@ -1,5 +1,4 @@ #version $GLSL_VERSION_STR -$GLSL_DEFAULT_PRECISION_FLOAT #pragma vp_entryPoint simutil_vpl_frag #pragma vp_location fragment_coloring diff --git a/SDK/simUtil/VelocityParticleLayer.part.vert.glsl b/SDK/simUtil/VelocityParticleLayer.part.vert.glsl index 53bce2c7d..8ca419066 100644 --- a/SDK/simUtil/VelocityParticleLayer.part.vert.glsl +++ b/SDK/simUtil/VelocityParticleLayer.part.vert.glsl @@ -1,5 +1,4 @@ #version $GLSL_VERSION_STR -$GLSL_DEFAULT_PRECISION_FLOAT #pragma vp_entryPoint simutil_vpl_rtt_vertex #pragma vp_location vertex_model diff --git a/SDK/simVis/DisableDepthOnAlpha.frag.glsl b/SDK/simVis/DisableDepthOnAlpha.frag.glsl index 806efb471..6b3b3b10a 100644 --- a/SDK/simVis/DisableDepthOnAlpha.frag.glsl +++ b/SDK/simVis/DisableDepthOnAlpha.frag.glsl @@ -1,5 +1,4 @@ #version $GLSL_VERSION_STR -$GLSL_DEFAULT_PRECISION_FLOAT #pragma import_defines(SV_USE_DISABLE_DEPTH_ON_ALPHA) #pragma import_defines(SV_USE_LOG_DEPTH_BUFFER) diff --git a/SDK/simVis/GradientShader.cpp b/SDK/simVis/GradientShader.cpp index 87c485bb9..7d0d5ca95 100644 --- a/SDK/simVis/GradientShader.cpp +++ b/SDK/simVis/GradientShader.cpp @@ -106,8 +106,6 @@ std::string GradientShader::buildShader() const { std::stringstream buf; - buf << "#version " GLSL_VERSION_STR << "\n"; - buf << GLSL_DEFAULT_PRECISION_FLOAT << "\n"; buf << "vec4 " << functionName_ << "(in float value)\n"; buf << "{\n"; diff --git a/SDK/simVis/Picker.cpp b/SDK/simVis/Picker.cpp index 496a8e340..083f41997 100644 --- a/SDK/simVis/Picker.cpp +++ b/SDK/simVis/Picker.cpp @@ -476,7 +476,6 @@ void RTTPicker::setUpViewWithDebugTexture(osgViewer::View* intoView, simVis::Vie stateSet->setAttributeAndModes(new osg::BlendFunc(GL_ONE, GL_ZERO), 1); const char* fs = - "#version " GLSL_VERSION_STR "\n" "void swap(inout vec4 c) { c.rgba = c==vec4(0)? vec4(1) : vec4(vec3((c.r+c.g+c.b+c.a)/4.0),1); }\n"; osgEarth::Registry::shaderGenerator().run(geode); osgEarth::VirtualProgram::getOrCreate(geode->getOrCreateStateSet())->setFunction("swap", fs, osgEarth::ShaderComp::LOCATION_FRAGMENT_COLORING);