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

Last change on this file since 3464 was 2956, checked in by ldelgass, 8 years ago

First batch of converting shaders to use new parameter support in NvShader?.

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