source: branches/1.2/packages/vizservers/nanovis/shaders/velocityslicefp.cg @ 3589

Last change on this file since 3589 was 2964, checked in by ldelgass, 12 years ago

Convert arrow glyph shaders to new NvShader? API. Fix velocity arrow glpyh and
line implementation, add arrow head to line arrows. Alpha channel of arrow
texture atlas still needs cleanup -- should probably just create a utility to
generate the texture to allow changes in lighting, FOV, etc. Note that volumes
and flows are currently not scaled properly -- the aspect ratios of the number
of samples is used rather than the physical lengths of the volumes/flows. This will be fixed for volumes, flows and the grid in a future commit. Also, client doesn't currently enable arrows, this will also be enabled in another commit.

File size: 818 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              float4 color : COLOR0,
7              float2 center : TEXCOORD2,
8              float4 rotation : TEXCOORD3,
9              uniform sampler2D arrows : TEXUNIT0) : 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 tex2D(arrows, rotTexCoord.xy) * color;
20}
Note: See TracBrowser for help on using the repository browser.