/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright (c) 2004-2013 HUBzero Foundation, LLC * * Authors: * Wei Qiao */ #include "particle_common.cg" float4 main(float2 texCoord : TEXCOORD0, float4 color : COLOR0, float2 center : TEXCOORD2, float4 rotation : TEXCOORD3, uniform sampler2D arrows : TEXUNIT0) : COLOR { 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; return tex2D(arrows, rotTexCoord.xy) * color; }