Ignore:
Timestamp:
Apr 16, 2013, 3:52:20 AM (7 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/StdVertexShader.cpp

    r3612 r3630  
    44 *
    55 */
     6#include <vrmath/Vector4f.h>
     7
    68#include "StdVertexShader.h"
    79
     10using namespace vrmath;
    811using namespace nv;
    912
     
    1922void StdVertexShader::init()
    2023{
    21     loadVertexProgram("vertex_std.cg", "main");
     24    loadVertexProgram("vertex_std.cg");
    2225}
    2326
    24 void StdVertexShader::bind(float *mvp, float *mvInv)
     27void StdVertexShader::bind(const Vector4f& objPlaneS,
     28                           const Vector4f& objPlaneT,
     29                           const Vector4f& objPlaneR,
     30                           float *mvp, float *mvInv)
    2531{
    2632    if (mvp != NULL) {
    2733        setVPMatrixParameterf("modelViewProjMatrix", mvp);
    2834    } else {
    29         setGLStateMatrixVPParameter("modelViewProjMatrix", MODELVIEW_PROJECTION_MATRIX);
     35        setGLStateMatrixVPParameter("modelViewProjMatrix",
     36                                    MODELVIEW_PROJECTION_MATRIX);
    3037    }
    3138    if (mvInv != NULL) {
    3239        setVPMatrixParameterf("modelViewInv", mvInv);
    3340    } else {
    34         setGLStateMatrixVPParameter("modelViewInv", MODELVIEW_MATRIX, MATRIX_INVERSE);
     41        setGLStateMatrixVPParameter("modelViewInv",
     42                                    MODELVIEW_MATRIX, MATRIX_INVERSE);
    3543    }
     44
     45    setVPParameter4f("light0Position", 1, 1, 1, 1);
     46    setVPParameter4f("objPlaneS",
     47                     objPlaneS.x, objPlaneS.y, objPlaneS.z, objPlaneS.w);
     48    setVPParameter4f("objPlaneT",
     49                     objPlaneT.x, objPlaneT.y, objPlaneT.z, objPlaneT.w);
     50    setVPParameter4f("objPlaneR",
     51                     objPlaneR.x, objPlaneR.y, objPlaneR.z, objPlaneR.w);
    3652
    3753    Shader::bind();
Note: See TracChangeset for help on using the changeset viewer.