source: trunk/vizservers/nanovis/NvParticleAdvectionShader.cpp @ 749

Last change on this file since 749 was 585, checked in by vrinside, 18 years ago
File size: 797 bytes
Line 
1#include "NvParticleAdvectionShader.h"
2
3NvParticleAdvectionShader::NvParticleAdvectionShader(const Vector3& scale)
4{
5    init(scale);
6}
7
8NvParticleAdvectionShader::~NvParticleAdvectionShader()
9{
10}
11
12void NvParticleAdvectionShader::init(const Vector3& scale)
13{
14    _cgFP= cgCreateProgramFromFile(g_context, CG_SOURCE,
15        "/opt/nanovis/lib/shaders/update_pos.cg", CG_PROFILE_FP30, "main", NULL);
16
17    cgGLLoadProgram(_cgFP);
18
19    _posTimestepParam  = cgGetNamedParameter(_cgFP, "timestep");
20    _velTexParam = cgGetNamedParameter(_cgFP, "vel_tex");
21    _posTexParam = cgGetNamedParameter(_cgFP, "pos_tex");
22    _scaleParam = cgGetNamedParameter(_cgFP, "scale");
23    // TBD..
24    //cgGLSetTextureParameter(_velTexParam, volume);
25    cgGLSetParameter3f(_scaleParam, scale.x, scale.y, scale.z);
26}
27
Note: See TracBrowser for help on using the repository browser.