Negative

From GameStudio Wiki

Jump to: navigation, search

Lite-C:


The material for the effect:

// Negative
MATERIAL* Negative_mat =
{
	effect = "negative.fx";
}

The negative.fx file:

////////////////////////////////////
//////////Negative Effect///////////
////////////////////////////////////


texture TargetMap;

sampler postTex = sampler_state
{
	texture 		= (TargetMap);
	MinFilter	= linear;
	MagFilter	= linear;
	MipFilter	= linear;
	AddressU		= Clamp;
	AddressV		= Clamp;
};

float4 Negative_PS(float2 tex : TEXCOORD0) : COLOR
{
	float4 pixel = tex2D(postTex,tex);
	pixel.a = 0;
	
	return float4(1.0f,1.0f,1.0f,1.0f) - pixel;
}

technique tech_00
{
	pass pass_00
	{
		VertexShader = null;
		PixelShader = compile ps_2_0 Negative_PS();
	}
}

technique fallback { pass one { } }


C-Script


The material for the effect:

// Negative
material Negative_mat
{
	effect = "negative.fx";
}

The negative.fx file:

////////////////////////////////////
//////////Negative Effect///////////
////////////////////////////////////


texture entSkin1;

sampler postTex = sampler_state
{
	texture 		= (entSkin1);
	MinFilter	= linear;
	MagFilter	= linear;
	MipFilter	= linear;
	AddressU		= Clamp;
	AddressV		= Clamp;
};

float4 Negative_PS(float2 tex : TEXCOORD0) : COLOR
{
	float4 pixel = tex2D(postTex,tex);
	pixel.a = 0;
	
	return float4(1.0f,1.0f,1.0f,1.0f) - pixel;
}

technique tech_00
{
	pass pass_00
	{
		VertexShader = null;
		PixelShader = compile ps_2_0 Negative_PS();
	}
}

technique tech_01
{
	pass pass_00
	{
		Texture[0] = <entSkin1>;
	}
}

--Slin 23:25, 10 November 2007 (CET)

Personal tools