コード例 #1
0
void CHLSL_Solver_Clip::OnWriteFXC( bool bIsPixelShader, WriteContext_FXC &context )
{
	CHLSL_Var *pvar = GetSourceVar( 0 );

	char tmp[MAXTARGC];
	Q_snprintf( tmp, sizeof( tmp ), "clip( %s );\n", pvar->GetName() );

	context.buf_code.PutString( tmp );
}
コード例 #2
0
void CHLSL_Solver_Invert::OnWriteFXC( bool bIsPixelShader, WriteContext_FXC &context )
{
	CHLSL_Var *tg = GetTargetVar( 0 );
	tg->DeclareMe(context);
	CHLSL_Var *src1 = GetSourceVar( 0 );

	char tmp[MAXTARGC];
	Q_snprintf( tmp, MAXTARGC, "%s = 1.0f - %s;\n",
		tg->GetName(),src1->GetName() );
	context.buf_code.PutString( tmp );
}
コード例 #3
0
void CHLSL_Solver_VectorRefract::OnWriteFXC( bool bIsPixelShader, WriteContext_FXC &context )
{
	CHLSL_Var *tg = GetTargetVar( 0 );
	tg->DeclareMe(context);
	CHLSL_Var *src1 = GetSourceVar( 0 );
	CHLSL_Var *src2 = GetSourceVar( 1 );
	CHLSL_Var *src3 = GetSourceVar( 2 );

	char tmp[MAXTARGC];
	Q_snprintf( tmp, MAXTARGC, "%s = refract( %s, %s, %s );\n",
		tg->GetName(),src1->GetName(),src2->GetName(),src3->GetName() );
	context.buf_code.PutString( tmp );
}