source: nanovis/branches/1.2/shaders/render_vel.cg @ 5046

Last change on this file since 5046 was 4904, checked in by ldelgass, 9 years ago

Merge serveral changes from trunk. Does not include threading, world space
changes, etc.

File size: 625 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// Project and sample 3D vector field on a 2D plane
10
11#include "common.cg"
12
13float4 main(in float3 uvw : TEXCOORD0,
14            uniform sampler3D vel_tex,
15            uniform float3 projection_vector,
16            uniform float timestep,
17            uniform float vmax) : COLOR
18{
19    float3 velocity = tex3D(vel_tex, uvw).yzw * 2.0 - float3(1.0, 1.0, 1.0);
20    velocity = velocity * projection_vector * vmax * timestep;
21    return float4(velocity, 1);
22}
Note: See TracBrowser for help on using the repository browser.