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

Last change on this file since 1321 was 1299, checked in by vrinside, 15 years ago

modified lic

File size: 1.3 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    CGparameter _posTimestepParam;
9    CGparameter _velTexParam;
10    CGparameter _posTexParam;
11    CGparameter _scaleParam;
12    CGparameter _maxParam;
13    unsigned int _velocityVolumeID;
14    Vector3 _scale;
15    float _max;
16    float _timeStep;
17
18public :
19    NvParticleAdvectionShader();
20    ~NvParticleAdvectionShader();
21
22private :
23    void init();
24public :
25    void bind(unsigned int texID);
26    void unbind();
27    void setScale(const Vector3& scale);
28    void setVelocityVolume(unsigned int texID, float max);
29    void setTimeStep(float timeStep);
30};
31
32inline void NvParticleAdvectionShader::setTimeStep(float timeStep)
33{
34    _timeStep = timeStep;
35}
36
37inline void NvParticleAdvectionShader::unbind()
38{
39     cgGLDisableProfile(CG_PROFILE_FP30);
40   
41     cgGLDisableTextureParameter(_velTexParam);
42     cgGLDisableTextureParameter(_posTexParam);
43}
44
45inline void NvParticleAdvectionShader::setScale(const Vector3& scale)
46{
47    _scale = scale;
48}
49
50inline void NvParticleAdvectionShader::setVelocityVolume(unsigned int texID, float max)
51{
52    _velocityVolumeID = texID;
53    _max = max;
54}
55
56#endif //__NV_PARTICLE_ADV_SHADER_H__
Note: See TracBrowser for help on using the repository browser.