Radar Shader

posted in Yeah
Published September 25, 2008
Advertisement
Finally got my radar working... and I think its even CG complaint

Radar

float4	RADAR_OUTTER_COLOR;float4	RADAR_INNER_COLOR;float4	RADAR_COLOR;float4	RADAR_ANG;float4	RADAR_RING1;float4	RADAR_RING2;float RADAR_PAUSED;sampler RT : register(s0);float4 ps_main(float2 iTexCoord : TEXCOORD0): COLOR{	float4 color = float4(0,0,0,0);	float2 centre = float2(0.5,0.5);	float2 dir = iTexCoord - centre;	float dist = length(dir);	if(dist<0.45)	{		color = tex2D(RT, iTexCoord);// * float4(0,0,4,1);			float ang = (180 + atan2(dir.y,dir.x) * 57.325);						if(ang> RADAR_ANG.x && ang		{			color += RADAR_INNER_COLOR;		}else{			color += RADAR_OUTTER_COLOR;		}		if((dist > RADAR_RING1.x && dist < RADAR_RING1.y) || (dist > RADAR_RING1.z && dist < RADAR_RING1.w) || (dist > RADAR_RING2.z && dist < RADAR_RING2.w))		{			color += RADAR_COLOR;		}						//		color *= float4(0,0,1,0);		color.a = .5;	}			return color;}
Next Entry Native Client
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement