source: trunk/packages/vizservers/nanovis/ParticleAdvectionShader.h @ 3630

Last change on this file since 3630 was 3630, checked in by ldelgass, 6 years ago

Nanovis refactoring to fix problems with scaling and multiple results.
Do rendering in world space to properly place and scale multiple data sets.
Also fix flows to reduce resets of animations. More work toward removing
Cg dependency. Fix panning to convert viewport coords to world coords.

  • Property svn:eol-style set to native
File size: 1.1 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#ifndef NV_PARTICLE_ADVECTION_SHADER_H
7#define NV_PARTICLE_ADVECTION_SHADER_H
8
9#include <vrmath/Vector3f.h>
10
11#include "Shader.h"
12
13namespace nv {
14
15class ParticleAdvectionShader : public Shader
16{
17public:
18    ParticleAdvectionShader();
19
20    virtual ~ParticleAdvectionShader();
21
22    virtual void bind(unsigned int texID, unsigned int initPosTexID, bool init);
23
24    virtual void unbind();
25
26    void setScale(const vrmath::Vector3f& scale)
27    {
28        _scale = scale;
29    }
30
31    void setVelocityVolume(unsigned int texID, float max)
32    {
33        _velocityVolumeID = texID;
34        _max = max;
35        // FIXME: Is this needed?
36        if (_max > 100.f)
37            _max = 100.0f;
38    }
39
40    void setTimeStep(float timeStep)
41    {
42        _timeStep = timeStep;
43    }
44
45    void setRenderMode(int mode)
46    {
47        _mode = mode;
48    }
49
50private:
51    void init();
52
53    unsigned int _velocityVolumeID;
54    vrmath::Vector3f _scale;
55    float _max;
56    float _timeStep;
57    int _mode;
58};
59
60}
61
62#endif
Note: See TracBrowser for help on using the repository browser.