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

Last change on this file since 2720 was 2096, checked in by ldelgass, 14 years ago

Normalize line endings, set eol-style to native on *.cpp, *.h files

  • Property svn:eol-style set to native
File size: 1.3 KB
Line 
1
2#include <stdio.h>
3#include <stdlib.h>
4#include <assert.h>
5#include <R2/R2FilePath.h>
6#include <R2/R2string.h>
7#include "PointShader.h"
8
9PointShader::PointShader() :
10    NvShader(),
11    _normal(0)
12{
13    this->loadVertexProgram("pointsvp.cg", "main");
14    _modelviewVP  = getNamedParameterFromVP("modelview");
15    _projectionVP = getNamedParameterFromVP("projection");
16    _attenVP      = getNamedParameterFromVP("atten");
17    _posoffsetVP  = getNamedParameterFromVP("posoffset");
18    _baseposVP    = getNamedParameterFromVP("basepos");
19    _scaleVP      = getNamedParameterFromVP("scale");
20    _normalParam  = getNamedParameterFromVP("normal");
21}
22
23PointShader::~PointShader()
24{
25}
26
27void PointShader::setParameters()
28{
29    cgGLSetStateMatrixParameter(_modelviewVP, CG_GL_MODELVIEW_MATRIX, CG_GL_MATRIX_IDENTITY);
30    cgGLSetStateMatrixParameter(_projectionVP, CG_GL_PROJECTION_MATRIX, CG_GL_MATRIX_IDENTITY);
31       
32    cgGLSetParameter1f(_attenVP, 1.0f);
33    cgGLSetParameter4f(_posoffsetVP, 1.0f, 1.0f, 1.0f, 1.0f);
34    cgGLSetParameter4f(_baseposVP, 1.0f, 1.0f, 1.0f, 1.0f);
35    cgGLSetParameter4f(_scaleVP, 1.0f, 1.0f, 1.0f, 1.0f);
36   
37    //cgGLSetTextureParameter(_normalParam,_normal->getGraphicsObjectID());
38    //cgGLEnableTextureParameter(_normalParam);
39   
40}
41
42void PointShader::resetParameters()
43{
44    //cgGLDisableTextureParameter(_normalParam);
45}
Note: See TracBrowser for help on using the repository browser.