void CHLSL_Solver_Subtract::Render( Preview2DContext &c )
{
	int type0 = GetSourceVar(0)->GetType();
	int type1 = GetSourceVar(1)->GetType();

	SetUVParamBySourceVar( NPSOP_CALC_SUBTRACT, 0, 0 );
	SetUVParamBySourceVar( NPSOP_CALC_SUBTRACT, 1, 1 );

	IMaterialVar *var_2 = pEditorRoot->GetUVTargetParam( NPSOP_CALC_SUBTRACT, 2 );
	IMaterialVar *var_3 = pEditorRoot->GetUVTargetParam( NPSOP_CALC_SUBTRACT, 3 );
	var_2->SetVecValue( 0, 0, 0, 0 );
	var_3->SetVecValue( 0, 0, 0, 0 );

	if ( type0 != type1 )
	{
		int maxSlots = ::GetSlotsFromTypeFlag( max( type0, type1 ) );
		Assert( maxSlots > 1 );
		bool target_is_0 = ( type0 < type1 );

		IMaterialVar *var_target = target_is_0 ? var_2 : var_3;
		var_target->SetVecValue( maxSlots >= 2, maxSlots >= 3, maxSlots >= 4, 0 );
	}

	CNodeView::RenderSingleSolver( c, pEditorRoot->GetOperatorMaterial( NPSOP_CALC_SUBTRACT ) );
	UpdateTargetVarToReflectMapIndex( 0 );
}
void CHLSL_Solver_ReadSemantics::Render( Preview2DContext &c )
{
	int opNum = 0;
	const ResourceType_t &type = GetResourceType();
	switch ( type )
	{
		case RESOURCETYPE_TEXCOORD_0:
		case RESOURCETYPE_TEXCOORD_1:
		case RESOURCETYPE_TEXCOORD_2:
		case RESOURCETYPE_TEXCOORD_3:
		case RESOURCETYPE_TEXCOORD_4:
		case RESOURCETYPE_TEXCOORD_5:
		case RESOURCETYPE_TEXCOORD_6:
		case RESOURCETYPE_TEXCOORD_7:
			opNum = type - RESOURCETYPE_TEXCOORD_0;
			break;
		case RESOURCETYPE_COLOR_0:
		case RESOURCETYPE_COLOR_1:
			opNum = type - RESOURCETYPE_COLOR_0 + NPSOP_WRITE_COLOR_0;
			break;
	}

	Assert( opNum >= NPSOP_WRITE_TEXCOORD_0 && opNum < NPSOP_WRITE_MAX );
	c.pMat_PsInOP->SetIntValue( opNum );
	CNodeView::RenderSingleSolver( c, c.pMat_PsIn );

	UpdateTargetVarToReflectMapIndex( 0 );
}
void CHLSL_Solver_Array::Render( Preview2DContext &c )
{
    float info_0[4] = { 1, 1, 1, 1 };
    IMaterialVar *pMatVar0 = pEditorRoot->GetUVTargetParam( NPSOP_SET_CONSTANT, 0 );
    pMatVar0->SetVecValue( info_0, 4 );

    CNodeView::RenderSingleSolver( c, pEditorRoot->GetOperatorMaterial( NPSOP_SET_CONSTANT ) );
    UpdateTargetVarToReflectMapIndex( 0 );
}
void CHLSL_Solver_Callback::Render( Preview2DContext &c )
{
	float info_0[4] = { 0, 0, 0, 0 };
	_clCallback *cb = shaderEdit->GetCallback( iCallbackIndex );
	cb->func( info_0 );

	IMaterialVar *pMatVar0 = pEditorRoot->GetUVTargetParam( NPSOP_SET_CONSTANT, 0 );
	pMatVar0->SetVecValue( info_0, 4 );

	CNodeView::RenderSingleSolver( c, pEditorRoot->GetOperatorMaterial( NPSOP_SET_CONSTANT ) );
	UpdateTargetVarToReflectMapIndex( 0 );
}
void CHLSL_Solver_Invert::Render( Preview2DContext &c )
{
	SetUVParamBySourceVar( NPSOP_CALC_INVERT, 0, 0 );
	CNodeView::RenderSingleSolver( c, pEditorRoot->GetOperatorMaterial( NPSOP_CALC_INVERT ) );
	UpdateTargetVarToReflectMapIndex( 0 );
}
void CHLSL_Solver_Clip::Render( Preview2DContext &c )
{
	SetUVParamBySourceVar( NPSOP_UTILITY_DECLARE, 0, 0 );
	CNodeView::RenderSingleSolver( c, pEditorRoot->GetOperatorMaterial( NPSOP_UTILITY_DECLARE ) );
	UpdateTargetVarToReflectMapIndex( 0 );
}