MCPcopy Create free account
hub / github.com/ImageEngine/cortex / lookupRampParameterSuffixes

Function lookupRampParameterSuffixes

src/IECoreScene/ShaderNetworkAlgo.cpp:791–817  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

789}
790
791std::tuple< const std::string*, const std::string*, const std::string*, const std::string*, const std::string* >
792lookupRampParameterSuffixes( const std::string &shaderName )
793{
794 // We seem to be able to identify shaders that should use the PRMan convention by whether they start
795 // with one of the PRMan prefixes.
796 // NOTE : This will fail if a shader is loaded from an explicit path, rather than being found in the
797 // search path, because the shader name will include the full file path. We consider this an
798 // acceptable failure, because shaders should be found in the search paths.
799 if( boost::starts_with( shaderName, "Pxr" ) || boost::starts_with( shaderName, "Lama" ) )
800 {
801 // The convention used by the PRMan shader library.
802 static const std::string positions( "_Knots" );
803 static const std::string floatValues( "_Floats" );
804 static const std::string colorValues( "_Colors" );
805 static const std::string basis( "_Interpolation" );
806 static const std::string count( "" );
807 return { &positions, &floatValues, &colorValues, &basis, &count };
808 }
809 else
810 {
811 // The convention used by the OSL shaders that we ship with Gaffer.
812 static const std::string positions( "Positions" );
813 static const std::string values( "Values" );
814 static const std::string basis( "Basis" );
815 return { &positions, &values, &values, &basis, nullptr };
816 }
817}
818
819template<typename Ramp>
820int expandRamp( const InternedString &name, const Ramp &ramp, CompoundDataMap &newParameters, const std::string &shaderName )

Callers 2

expandRampFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected