source: trunk/packages/vizservers/nanovis/NvParticleAdvectionShader.h @ 2825

Last change on this file since 2825 was 2798, checked in by ldelgass, 13 years ago

Add emacs mode magic line in preparation for indentation cleanup

  • Property svn:eol-style set to native
File size: 1.8 KB
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2#ifndef __NV_PARTICLE_ADV_SHADER_H__
3#define __NV_PARTICLE_ADV_SHADER_H__
4
5#include "Vector3.h"
6#include "NvShader.h"
7
8class NvParticleAdvectionShader : public NvShader {
9
10    CGparameter _posTimestepParam;
11    CGparameter _velTexParam;
12    //CGparameter _tfTexParam;
13    CGparameter _posTexParam;
14    CGparameter _initPosTexParam;
15    CGparameter _scaleParam;
16    CGparameter _maxParam;
17    CGparameter _modeParam;
18    unsigned int _velocityVolumeID;
19    Vector3 _scale;
20    float _max;
21    float _timeStep;
22
23    int _mode;
24
25public :
26    NvParticleAdvectionShader();
27    ~NvParticleAdvectionShader();
28
29private :
30    void init();
31public :
32    //void bind(unsigned int texID, unsigned int tfTexID, unsigned int initPosTexID);
33    void bind(unsigned int texID, unsigned int initPosTexID);
34    void unbind();
35    void setScale(const Vector3& scale);
36    void setVelocityVolume(unsigned int texID, float max);
37    void setTimeStep(float timeStep);
38    void setRenderMode(int mode);
39};
40
41inline void NvParticleAdvectionShader::setTimeStep(float timeStep)
42{
43    _timeStep = timeStep;
44}
45
46inline void NvParticleAdvectionShader::unbind()
47{
48     cgGLDisableProfile(CG_PROFILE_FP30);
49   
50     cgGLDisableTextureParameter(_velTexParam);
51     cgGLDisableTextureParameter(_posTexParam);
52     //cgGLDisableTextureParameter(_tfTexParam);
53     cgGLDisableTextureParameter(_initPosTexParam);
54}
55
56inline void NvParticleAdvectionShader::setScale(const Vector3& scale)
57{
58    _scale = scale;
59}
60
61inline void NvParticleAdvectionShader::setVelocityVolume(unsigned int texID, float max)
62{
63    _velocityVolumeID = texID;
64    _max = max;
65}
66
67inline void NvParticleAdvectionShader::setRenderMode(int mode)
68{
69    _mode = mode;
70}
71
72#endif //__NV_PARTICLE_ADV_SHADER_H__
Note: See TracBrowser for help on using the repository browser.