source: branches/blt4/packages/vizservers/nanovis/shaders/velocityslicefp.cg @ 2936

Last change on this file since 2936 was 2936, checked in by gah, 12 years ago

sync back with trunk

File size: 838 bytes
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2
3#include "particle_common.cg"
4
5float4 fpmain(float2 texCoord : TEXCOORD0,
6              float3 color : COLOR,
7              float2 center : TEXCOORD2,
8              float4 rotation : TEXCOORD3,
9              uniform sampler2D arrows : register(s0)) : COLOR
10{
11    float2 newTexCoord = float2((texCoord.x - 0.5) / NUM_SUBIMAGE_X, (texCoord.y - 0.5) / NUM_SUBIMAGE_Y);
12    float2 rotTexCoord;
13    rotTexCoord.x = rotation.x * newTexCoord.x + rotation.y * newTexCoord.y;
14    rotTexCoord.y = rotation.z * newTexCoord.x + rotation.w * newTexCoord.y;
15    rotTexCoord.x = rotTexCoord.x + 0.5 / NUM_SUBIMAGE_X;
16    rotTexCoord.y = rotTexCoord.y + 0.5 / NUM_SUBIMAGE_Y;
17    rotTexCoord = rotTexCoord + center;
18
19    return float4(tex2D(arrows, rotTexCoord.xy).xyz * color, 1.0);
20}
Note: See TracBrowser for help on using the repository browser.