source: nanovis/branches/1.1/ParticleAdvectionShader.cpp @ 4923

Last change on this file since 4923 was 4904, checked in by ldelgass, 9 years ago

Merge serveral changes from trunk. Does not include threading, world space
changes, etc.

  • 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),
[4904]14    _timeStep(0.0005f)
[585]15{
[850]16    init();
[585]17}
18
[3612]19ParticleAdvectionShader::~ParticleAdvectionShader()
[585]20{
21}
22
[3612]23void ParticleAdvectionShader::init()
[585]24{
[4904]25    loadFragmentProgram("update_pos.cg");
[585]26}
27
[1362]28void
[3612]29ParticleAdvectionShader::bind(unsigned int texID, unsigned int initPosTexID)
[1299]30{
[2956]31    setFPTextureParameter("pos_tex", texID);
32    setFPTextureParameter("init_pos_tex", initPosTexID);
33    setFPTextureParameter("vel_tex", _velocityVolumeID);
[1299]34
[2956]35    setFPParameter1f("timestep", _timeStep);
36    setFPParameter1f("max", _max);
37    setFPParameter3f("scale", _scale.x, _scale.y, _scale.z);
[1331]38
[3612]39    Shader::bind();
[1299]40}
[2837]41
42void
[3612]43ParticleAdvectionShader::unbind()
[2837]44{
[2956]45     disableFPTextureParameter("pos_tex");
46     disableFPTextureParameter("init_pos_tex");
47     disableFPTextureParameter("vel_tex");
[2916]48
[3612]49     Shader::unbind();
[2837]50}
Note: See TracBrowser for help on using the repository browser.