/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ #include "particle_common.cg" #ifdef USE_TIME_SERIES #define LEVEL1 0.5 #define LEVEL2 0.4 #else #define LEVEL1 0.7 #define LEVEL2 0.5 #endif float4 fpmain(float2 texCoord : TEXCOORD0, float3 color : COLOR, float2 center : TEXCOORD2, float4 rotation : TEXCOORD3, float skip : TEXCOORD4, float mag : TEXCOORD5, float zValue : TEXCOORD6, uniform sampler2D arrows : register(s0)) : COLOR { if (skip > 0.5) { discard; } float2 newTexCoord = float2((texCoord.x - 0.5) / NUM_SUBIMAGE_X, (texCoord.y - 0.5) / NUM_SUBIMAGE_Y); float2 rotTexCoord; rotTexCoord.x = rotation.x * newTexCoord.x + rotation.y * newTexCoord.y; rotTexCoord.y = rotation.z * newTexCoord.x + rotation.w * newTexCoord.y; rotTexCoord.x = rotTexCoord.x + 0.5 / NUM_SUBIMAGE_X; rotTexCoord.y = rotTexCoord.y + 0.5 / NUM_SUBIMAGE_Y; rotTexCoord = rotTexCoord + center; float4 refColor; #ifdef USE_J_WIRE if (mag > 0.2) refColor = float4(1, 0, 0, 1.0); else if (mag > 0.1) refColor = float4(1, 1, 0, 0.3); else refColor = float4(1, 1, 1, 0.3); #else if (mag > LEVEL1) refColor = float4(1, 0, 0, 1.0); //refColor = float4(1, 0, 0, 1.0 * (3.0 + zValue) / 3); else if (mag > LEVEL2) refColor = float4(1, 1, 0, 0.3); //refColor = float4(1, 1, 0, 1.0); else refColor = float4(0.5, 0.5, 0.5, 0.2); //refColor = float4(0.5, 0.5, 0.5, 1.0); #endif float4 arrowc = tex2D(arrows, rotTexCoord.xy); float4 c = float4(arrowc.xyz, ((arrowc.w == 1.0)? 1 : 0)); //float4 c = float4(arrowc.xyz, ((arrowc.w != 0.0)? 1 : 0)); return c * refColor; }