source: trunk/packages/vizservers/nanovis/NvParticleAdvectionShader.cpp @ 3611

Last change on this file since 3611 was 3611, checked in by ldelgass, 12 years ago

Use nv namespace for classes in nanovis rather than prefixing class names with
Nv (still need to convert shader classes).

  • Property svn:eol-style set to native
File size: 1.2 KB
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 "NvParticleAdvectionShader.h"
7
8using namespace nv;
9
10NvParticleAdvectionShader::NvParticleAdvectionShader() :
11    _velocityVolumeID(0),
12    _scale(1.0f, 1.0f, 1.0f),
13    _max(1.0f),
14    _timeStep(0.0005f),
15    _mode(1)
16{
17    init();
18}
19
20NvParticleAdvectionShader::~NvParticleAdvectionShader()
21{
22}
23
24void NvParticleAdvectionShader::init()
25{
26    loadFragmentProgram("update_pos.cg", "main");
27}
28
29void
30NvParticleAdvectionShader::bind(unsigned int texID, unsigned int initPosTexID)
31{
32    setFPTextureParameter("pos_tex", texID);
33    setFPTextureParameter("init_pos_tex", initPosTexID);
34    setFPTextureParameter("vel_tex", _velocityVolumeID);
35
36    setFPParameter1f("timestep", _timeStep);
37    setFPParameter1f("max", _max);
38    setFPParameter1f("mode", _mode);
39    setFPParameter3f("scale", _scale.x, _scale.y, _scale.z);
40
41    NvShader::bind();
42}
43
44void
45NvParticleAdvectionShader::unbind()
46{
47     disableFPTextureParameter("pos_tex");
48     disableFPTextureParameter("init_pos_tex");
49     disableFPTextureParameter("vel_tex");
50
51     NvShader::unbind();
52}
Note: See TracBrowser for help on using the repository browser.