Ignore:
Timestamp:
Apr 13, 2012 2:37:25 PM (12 years ago)
Author:
ldelgass
Message:

Convert NvLIC to use new NvShader? parameter API. Also fixes for LIC when plane
is not XY plane. Remove unused/incomplete Renderable base class (source files
remain for now, but it is not part of default build).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanovis/shaders/render_vel.cg

    r2925 r2967  
    1212 */
    1313
    14 // update positions based on velocity
     14// Project and sample 3D vector field on a 2D plane
    1515
    1616#include "common.cg"
     
    1818float4 main(in float3 uvw : TEXCOORD0,
    1919            uniform sampler3D vel_tex,
    20             uniform float4 plane_normal,
     20            uniform float3 projection_vector,
     21            uniform float timestep,
    2122            uniform float vmax) : COLOR
    2223{
    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);
    2927}
    30 
Note: See TracChangeset for help on using the changeset viewer.