1 | #pragma once
|
---|
2 | #include "ParticleSystem.h"
|
---|
3 | #include "Texture.h"
|
---|
4 | #include "Impostor.h"
|
---|
5 | #include <RttRes/RenderTexture.h>
|
---|
6 | #include <MyCgRes/CgProgram.h>
|
---|
7 | #include "Scene.h"
|
---|
8 |
|
---|
9 | class AdvancedParticleSystem
|
---|
10 | {
|
---|
11 | public:
|
---|
12 | AdvancedParticleSystem(void);
|
---|
13 | ~AdvancedParticleSystem(void);
|
---|
14 |
|
---|
15 | private:
|
---|
16 | //Impostor to display
|
---|
17 | Impostor m_DisplayImpostor;
|
---|
18 | //Impostor for illuminatoin calculation
|
---|
19 | Impostor m_IllumImpostor;
|
---|
20 |
|
---|
21 | //Display Rendertexture
|
---|
22 | RenderTexture m_DisplayTexture;
|
---|
23 | //Illumination textures
|
---|
24 | RenderTexture m_IllumTexture; //4 textures will be rendered in the 4 AUX buffers using MRT
|
---|
25 | //Depth Texture for appropriate density blending
|
---|
26 | RenderTexture m_FrontDepthTexture;
|
---|
27 | RenderTexture m_BackDepthTexture;
|
---|
28 | RenderTexture m_ObjectsTexture;
|
---|
29 | RenderTexture m_ScatteredIlumTexture;
|
---|
30 |
|
---|
31 |
|
---|
32 | CgProgram m_IllumProgram;
|
---|
33 | CgProgram m_FrontDepthProgram;
|
---|
34 | CgProgram m_DensityOnlyProgram;
|
---|
35 | CgProgram m_DisplayProgram;
|
---|
36 | CgProgram m_Psys_Depth_Multiple_Forward_Program;
|
---|
37 | CgProgram m_TempProg;CgProgram m_TempProg2;
|
---|
38 | CgProgram m_ObjDepthProg;
|
---|
39 | CgProgram m_ScatterIllumProgram;
|
---|
40 | CgProgram m_Psys_Multiple_Forward_Program;
|
---|
41 | CgProgram m_Psys_Single_Phase_Program;
|
---|
42 | CgProgram m_Psys_Depth_Single_Phase_Program;
|
---|
43 | CgProgram m_Psys_Depth_Default_Program;
|
---|
44 | CgProgram m_Psys_Default_Program;
|
---|
45 |
|
---|
46 | Camera m_LightCamera;
|
---|
47 |
|
---|
48 |
|
---|
49 | public:
|
---|
50 | Scene* theScene;
|
---|
51 | bool object_shadows;
|
---|
52 | bool depthcalc;
|
---|
53 | int m_PSys_RenderMode;
|
---|
54 | float albedo;
|
---|
55 | float symmetry;float symmetry2;
|
---|
56 | float transparency;
|
---|
57 | unsigned int PhaseTexID;
|
---|
58 | unsigned int AngleTexID;
|
---|
59 | Vector m_LightColor;
|
---|
60 |
|
---|
61 | ParticleSystem m_ParticleSystem;
|
---|
62 | ParticleSystem m_LittleParticleSystem;
|
---|
63 |
|
---|
64 | //Billboard display texture
|
---|
65 | Texture m_BillboardTexture;
|
---|
66 | Texture m_BbBackDepthTexture;
|
---|
67 | Texture m_BbFrontDepthTexture;
|
---|
68 |
|
---|
69 | void Display(Camera* cam,Vector LightPos);
|
---|
70 | void Refresh(Camera* cam,Vector LightPos,unsigned int Dt,unsigned int TimefromSecond);
|
---|
71 |
|
---|
72 | void RefreshDepths(Camera* cam);
|
---|
73 | void RefreshDepthswithSpheres(Camera* cam);
|
---|
74 | void Initialize();
|
---|
75 | void InitSystems();
|
---|
76 | void RenderObjectDepths(Camera* cam);
|
---|
77 |
|
---|
78 | void displayillum(Camera* cam);
|
---|
79 | void displayLittle(Camera* cam);
|
---|
80 |
|
---|
81 | void RefreshIllumTextures(Vector LightPos);
|
---|
82 |
|
---|
83 | void DecreaseAlbedo(){albedo-=0.05;if(albedo<0)albedo=0;}
|
---|
84 | void IncreaseAlbedo(){albedo+=0.05;if(albedo>1)albedo=1;}
|
---|
85 | void DecreaseTransparency(){transparency-=0.05;if(transparency<0)transparency=0;}
|
---|
86 | void IncreaseTransparency(){transparency+=0.05;if(transparency>1)transparency=1;}
|
---|
87 | void DecreaseSymmetry(){symmetry-=0.05;if(symmetry<-1)symmetry=-1;}
|
---|
88 | void IncreaseSymmetry(){symmetry+=0.05;if(symmetry>1)symmetry=1;}
|
---|
89 | };
|
---|
90 |
|
---|