source: trunk/packages/vizservers/nanovis/ParticleAdvectionShader.cpp @ 3612

Last change on this file since 3612 was 3612, checked in by ldelgass, 7 years ago

Remove Nv prefix from shader classes now that they are in nv namespace.

  • Property svn:eol-style set to native
File size: 1.1 KB
RevLine 
[2798]1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
[3502]2/*
3 * Copyright (c) 2004-2013  HUBzero Foundation, LLC
4 *
5 */
[3612]6#include "ParticleAdvectionShader.h"
[585]7
[3611]8using namespace nv;
9
[3612]10ParticleAdvectionShader::ParticleAdvectionShader() :
[953]11    _velocityVolumeID(0),
12    _scale(1.0f, 1.0f, 1.0f),
13    _max(1.0f),
[2916]14    _timeStep(0.0005f),
15    _mode(1)
[585]16{
[850]17    init();
[585]18}
19
[3612]20ParticleAdvectionShader::~ParticleAdvectionShader()
[585]21{
22}
23
[3612]24void ParticleAdvectionShader::init()
[585]25{
[2870]26    loadFragmentProgram("update_pos.cg", "main");
[585]27}
28
[1362]29void
[3612]30ParticleAdvectionShader::bind(unsigned int texID, unsigned int initPosTexID)
[1299]31{
[2956]32    setFPTextureParameter("pos_tex", texID);
33    setFPTextureParameter("init_pos_tex", initPosTexID);
34    setFPTextureParameter("vel_tex", _velocityVolumeID);
[1299]35
[2956]36    setFPParameter1f("timestep", _timeStep);
37    setFPParameter1f("max", _max);
38    setFPParameter1f("mode", _mode);
39    setFPParameter3f("scale", _scale.x, _scale.y, _scale.z);
[1331]40
[3612]41    Shader::bind();
[1299]42}
[2837]43
44void
[3612]45ParticleAdvectionShader::unbind()
[2837]46{
[2956]47     disableFPTextureParameter("pos_tex");
48     disableFPTextureParameter("init_pos_tex");
49     disableFPTextureParameter("vel_tex");
[2916]50
[3612]51     Shader::unbind();
[2837]52}
Note: See TracBrowser for help on using the repository browser.