Ignore:
Timestamp:
Apr 16, 2013, 12:52:20 AM (12 years ago)
Author:
ldelgass
Message:

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:
1 edited

Legend:

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

    r3177 r3630  
    11/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
    22/*
    3  * ======================================================================
    4  *  AUTHOR:  Wei Qiao <qiaow@purdue.edu>
    5  *           Purdue Rendering and Perceptualization Lab (PURPL)
     3 * Copyright (c) 2004-2013  HUBzero Foundation, LLC
    64 *
    7  *  Copyright (c) 2004-2012  HUBzero Foundation, LLC
    8  *
    9  *  See the file "license.terms" for information on usage and
    10  *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
    11  * ======================================================================
     5 * Authors:
     6 *   Wei Qiao <qiaow@purdue.edu>
    127 */
    138
     
    1611v2f main(a2v IN,
    1712         uniform float4x4 modelViewProjMatrix,
    18          uniform float4x4 modelViewInv)
     13         uniform float4x4 modelViewInv,
     14         uniform float4 light0Position,
     15         uniform float4 objPlaneS,
     16         uniform float4 objPlaneT,
     17         uniform float4 objPlaneR)
    1918{
    2019    v2f OUT;
     
    2423    float4 eyePosObjSpace = mul(modelViewInv, float4(0,0,0,1));
    2524
    26     //clip space vertex position
    27     //OUT.HPosition = mul(modelViewProjMatrix, mul(modelViewInv, IN.Position));
     25    // Clip space vertex position
    2826    OUT.HPosition = mul(modelViewProjMatrix, objPos);
    2927
    30     //eye space texture coordinates
    31     OUT.TexCoord = IN.TexCoord;
     28    // Generate world space texture coordinates
     29    OUT.TexCoord.x = dot(objPos, objPlaneS);
     30    OUT.TexCoord.y = dot(objPos, objPlaneT);
     31    OUT.TexCoord.z = dot(objPos, objPlaneR);
    3232
    33     //world space eye position
    34     //OUT.EyeVector = normalize(-IN.Position.xyz);
     33    // World space eye position
    3534    OUT.EyeVector = normalize(eyePosObjSpace - objPos);
    3635
    37     //world space light postion
    38     //OUT.Light = normalize(float3(1,1,1)-IN.Position.xyz);
    39     OUT.Light = normalize(mul(modelViewInv, float4(1,1,1,1))-objPos);
     36    // World space light postion (light0Position is in eye coords)
     37    OUT.Light = normalize(mul(modelViewInv, light0Position)-objPos);
    4038
    4139    return OUT;
Note: See TracChangeset for help on using the changeset viewer.