コード例 #1
0
bool CNodeRandom::CreateSolvers(GenericShaderData *ShaderData)
{
	CJack *pJ_Out = GetJack_Out( 0 );
	const int res = pJ_Out->GetResourceType();

	CHLSL_Var *tg = pJ_Out->AllocateVarFromSmartType();
	tg->MakeConstantOnly();

	CHLSL_Solver_Random *solver = new CHLSL_Solver_Random( GetUniqueIndex() );
	solver->SetResourceType( res );
	solver->AddTargetVar( tg );
	solver->SetState( m_iNumComponents, m_flValue_Min, m_flValue_Max );
	AddSolver( solver );

	return true;
}
コード例 #2
0
bool CNodeLightscale::CreateSolvers(GenericShaderData *ShaderData)
{
    CJack *pJ_Out = GetJack_Out( 0 );
    const int res = pJ_Out->GetResourceType();

    SetAllocating( false );
    CHLSL_Var *tg = pJ_Out->AllocateVarFromSmartType();
    tg->MakeConstantOnly();

    CHLSL_Solver_Lightscale *solver = new CHLSL_Solver_Lightscale( GetUniqueIndex() );
    solver->SetResourceType( res );
    solver->AddTargetVar( tg );
    solver->SetState( m_iLightScale );
    AddSolver( solver );
    return true;
}
コード例 #3
0
bool CNodeConstant::CreateSolvers(GenericShaderData *ShaderData)
{
	CJack *pJ_Out = GetJack_Out( 0 );

	const int res = pJ_Out->GetResourceType();

	CHLSL_Var *tg = pJ_Out->AllocateVarFromSmartType();
	tg->MakeConstantOnly();

	CHLSL_Solver_Constant *solver = new CHLSL_Solver_Constant( GetUniqueIndex() );
	solver->SetResourceType( res );
	solver->AddTargetVar( tg );
	solver->SetComponentInfo( m_iChannelInfo );
	AddSolver( solver );

	return true;
}
コード例 #4
0
bool CNodeVSInput::CreateSolvers(GenericShaderData *ShaderData)
{
	for ( int i = 0; i < GetNumJacks_Out(); i++ )
	{
		CJack *pJ = GetJack_Out( i );
		if ( !pJ->GetNumBridgesConnected() )
			continue;

		const int res = pJ->GetResourceType();
		CHLSL_Var *var = pJ->AllocateVarFromSmartType();
		var->MakeConstantOnly();

		CHLSL_Solver_ReadSemantics *solver = new CHLSL_Solver_ReadSemantics( GetUniqueIndex() );
		solver->SendVSSetup( curSetup );
		solver->SetResourceType( res );
		solver->AddTargetVar( var );
		AddSolver( solver );
	}

	SmartCreateDummySolver();
	return true;
}
コード例 #5
0
bool CNodeBumpBasis::CreateSolvers(GenericShaderData *ShaderData)
{
	for ( int i = 0; i < GetNumJacks_Out(); i++ )
	{
		CJack *pJCur = GetJack_Out(i);
		if ( !pJCur->GetNumBridgesConnected() && i != 0 )
			continue;

		const int res = pJCur->GetResourceType();

		CHLSL_Var *tg = pJCur->AllocateVarFromSmartType();
		tg->MakeConstantOnly();

		CHLSL_Solver_BumpBasis *solver = new CHLSL_Solver_BumpBasis( GetUniqueIndex() );
		solver->SetResourceType( res );
		solver->AddTargetVar( tg );
		solver->SetState( i );
		AddSolver( solver );
	}

	return !!GetNumSolvers();
}
コード例 #6
0
bool CNodeCallback::CreateSolvers(GenericShaderData *ShaderData)
{
	if ( !szCallbackName || !Q_strlen( szCallbackName ) || !iNumComponents )
		return false;
	int target = shaderEdit->FindCallback( szCallbackName );
	if ( target < 0 )
		return false;

	CJack *pJ_Out = GetJack_Out( 0 );

	const int res = pJ_Out->GetResourceType();

	SetAllocating( true );
	CHLSL_Var *tg = pJ_Out->AllocateVarFromSmartType();
	tg->MakeConstantOnly();

	CHLSL_Solver_Callback *solver = new CHLSL_Solver_Callback( GetUniqueIndex() );
	solver->SetState( target, szCallbackName, iNumComponents );
	solver->SetResourceType( res );
	solver->AddTargetVar( tg );
	AddSolver( solver );

	return true;
}