source: nanovis/trunk/shaders/render_vel.cg @ 4795

Last change on this file since 4795 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: 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.