Last change
on this file since 5143 was
3630,
checked in by ldelgass, 11 years ago
|
Nanovis refactoring to fix problems with scaling and multiple results.
Do rendering in world space to properly place and scale multiple data sets.
Also fix flows to reduce resets of animations. More work toward removing
Cg dependency. Fix panning to convert viewport coords to world coords.
|
File size:
915 bytes
|
Line | |
---|
1 | /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ |
---|
2 | /* |
---|
3 | * Copyright (c) 2004-2013 HUBzero Foundation, LLC |
---|
4 | * |
---|
5 | * Authors: |
---|
6 | * Wei Qiao <qiaow@purdue.edu> |
---|
7 | */ |
---|
8 | |
---|
9 | #include "particle_common.cg" |
---|
10 | |
---|
11 | float4 main(float2 texCoord : TEXCOORD0, |
---|
12 | float4 color : COLOR0, |
---|
13 | float2 center : TEXCOORD2, |
---|
14 | float4 rotation : TEXCOORD3, |
---|
15 | uniform sampler2D arrows : TEXUNIT0) : COLOR |
---|
16 | { |
---|
17 | float2 newTexCoord = float2((texCoord.x - 0.5) / NUM_SUBIMAGE_X, (texCoord.y - 0.5) / NUM_SUBIMAGE_Y); |
---|
18 | float2 rotTexCoord; |
---|
19 | rotTexCoord.x = rotation.x * newTexCoord.x + rotation.y * newTexCoord.y; |
---|
20 | rotTexCoord.y = rotation.z * newTexCoord.x + rotation.w * newTexCoord.y; |
---|
21 | rotTexCoord.x = rotTexCoord.x + 0.5 / NUM_SUBIMAGE_X; |
---|
22 | rotTexCoord.y = rotTexCoord.y + 0.5 / NUM_SUBIMAGE_Y; |
---|
23 | rotTexCoord = rotTexCoord + center; |
---|
24 | |
---|
25 | return tex2D(arrows, rotTexCoord.xy) * color; |
---|
26 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.