source: trunk/packages/vizservers/nanovis/PointShader.cpp @ 4364

Last change on this file since 4364 was 3630, checked in by ldelgass, 11 years ago

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.

  • Property svn:eol-style set to native
File size: 938 bytes
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 * Copyright (c) 2004-2013  HUBzero Foundation, LLC
4 *
5 */
6#include "PointShader.h"
7
8using namespace nv;
9
10PointShader::PointShader() :
11    Shader(),
12    _scale(1.0f),
13    _normal(NULL)
14{
15    loadVertexProgram("pointsvp.cg");
16}
17
18PointShader::~PointShader()
19{
20}
21
22void PointShader::bind()
23{
24    setGLStateMatrixVPParameter("modelView", MODELVIEW_MATRIX, MATRIX_IDENTITY);
25    setGLStateMatrixVPParameter("modelViewProj", MODELVIEW_PROJECTION_MATRIX, MATRIX_IDENTITY);
26
27    setVPParameter1f("atten", 1.0f);
28    setVPParameter4f("posoffset", 1.0f, 1.0f, 1.0f, 1.0f);
29    setVPParameter4f("basepos", 1.0f, 1.0f, 1.0f, 1.0f);
30    setVPParameter4f("scale", _scale, 1.0f, 1.0f, 1.0f);
31    //setVPTextureParameter("normal", _normal->getGraphicsObjectID());
32
33    Shader::bind();
34}
35
36void PointShader::unbind()
37{
38    //disableVPTextureParameter("normal");
39
40    Shader::unbind();
41}
Note: See TracBrowser for help on using the repository browser.