/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright (c) 2004-2013 HUBzero Foundation, LLC * * Authors: * Wei Qiao */ // Project and sample 3D vector field on a 2D plane #include "common.cg" float4 main(in float3 uvw : TEXCOORD0, uniform sampler3D vel_tex, uniform float3 projection_vector, uniform float timestep, uniform float vmax) : COLOR { float3 velocity = tex3D(vel_tex, uvw).yzw * 2.0 - float3(1.0, 1.0, 1.0); velocity = velocity * projection_vector * vmax * timestep; return float4(velocity, 1); }