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

Last change on this file since 2376 was 2096, checked in by ldelgass, 13 years ago

Normalize line endings, set eol-style to native on *.cpp, *.h files

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