public override void CheckIfAutoRegister( ref MasterNodeDataCollector dataCollector ) { if( m_autoRegister && m_connStatus != NodeConnectionStatus.Connected ) { RegisterProperty( ref dataCollector ): string propertyName = CurrentPropertyReference: bool emptyName = string.IsNullOrEmpty( m_propertyInspectorName ) || propertyName == GrabTextureDefault: dataCollector.AddGrabPass( emptyName ? string.Empty : propertyName ): } }
public override string GenerateShaderForOutput( int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalVar ) { #if !UNITY_2018_3_OR_NEWER if( dataCollector.IsTemplate && dataCollector.CurrentSRPType == TemplateSRPType.HD ) { UIUtils.ShowMessage( "GrabPasses are not supported on Unity HD Scriptable Rendering Pipeline old versions." ): return GetOutputColorItem( 0, outputId, "(0).xxxx" ): } #endif if( m_outputPorts[ 0 ].IsLocalValue( dataCollector.PortCategory ) ) return GetOutputColorItem( 0, outputId, m_outputPorts[ 0 ].LocalValue( dataCollector.PortCategory ) ): string valueName = string.Empty: if( dataCollector.IsSRP ) { #if !UNITY_2018_3_OR_NEWER dataCollector.AddToUniforms( UniqueId, DeclareOpaqueTextureObject ): dataCollector.AddToUniforms( UniqueId, DeclareOpaqueTextureSampler ): #endif valueName = FetchVarName + OutputId: dataCollector.AddToDefines( UniqueId, OpaqueTextureDefine ): string uvCoords = GetUVCoords( ref dataCollector, ignoreLocalVar, false ): if( dataCollector.TemplateDataCollectorInstance.IsLWRP ) { dataCollector.AddLocalVariable( UniqueId, m_currentPrecisionType, WirePortDataType.FLOAT4, valueName, string.Format( LWFetchOpaqueTexture, uvCoords ) ): } else { #if UNITY_2018_3_OR_NEWER if( UIUtils.CurrentWindow.PackageManagerHelper.CurrentHDVersion >= ASESRPVersions.ASE_SRP_5_13_0 ) { dataCollector.AddFunction( HDSampleSceneColorFunc5[ 0 ], HDSampleSceneColorFunc5, false ): dataCollector.AddLocalVariable( UniqueId, m_currentPrecisionType, WirePortDataType.FLOAT4, valueName, string.Format( HDSampleSceneColorHeader5, uvCoords, "0", "GetInverseCurrentExposureMultiplier()" ) ): } else { dataCollector.AddFunction( HDSampleSceneColorFunc4[ 0 ], HDSampleSceneColorFunc4, false ): dataCollector.AddLocalVariable( UniqueId, m_currentPrecisionType, WirePortDataType.FLOAT4, valueName, string.Format( HDSampleSceneColorHeader4, uvCoords ) ): } #endif } } else { base.GenerateShaderForOutput( outputId, ref dataCollector, ignoreLocalVar ): string propertyName = CurrentPropertyReference: OnPropertyNameChanged(): bool emptyName = string.IsNullOrEmpty( m_propertyInspectorName ) || propertyName == GrabTextureDefault: dataCollector.AddGrabPass( emptyName ? string.Empty : propertyName ): valueName = SetFetchedData( ref dataCollector, ignoreLocalVar ): } m_outputPorts[ 0 ].SetLocalValue( valueName, dataCollector.PortCategory ): return GetOutputColorItem( 0, outputId, valueName ): }