Changeset 2967 for trunk/packages/vizservers/nanovis/shaders
- Timestamp:
- Apr 13, 2012 2:37:25 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/nanovis/shaders/render_vel.cg
r2925 r2967 12 12 */ 13 13 14 // update positions based on velocity14 // Project and sample 3D vector field on a 2D plane 15 15 16 16 #include "common.cg" … … 18 18 float4 main(in float3 uvw : TEXCOORD0, 19 19 uniform sampler3D vel_tex, 20 uniform float4 plane_normal, 20 uniform float3 projection_vector, 21 uniform float timestep, 21 22 uniform float vmax) : COLOR 22 23 { 23 //float4 vel = float4(tex3D(vel_tex, uvw).xyz, 0) - float4(0.5, 0.5, 0.5, 0.0); 24 float4 vel = float4(tex3D(vel_tex, uvw).yzw, 0) - float4(0.5, 0.5, 0.5, 0.0); 25 vel = vel * (vmax * 2); 26 float4 ret = plane_normal * vel * 0.0005; 27 28 return float4(ret.xyz, 1); 24 float3 velocity = tex3D(vel_tex, uvw).yzw * 2.0 - float3(1.0, 1.0, 1.0); 25 velocity = velocity * projection_vector * vmax * timestep; 26 return float4(velocity, 1); 29 27 } 30
Note: See TracChangeset
for help on using the changeset viewer.