Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
water.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 // Water and lava rendering including reflections
4 
5 #include "inexor/engine/material.hpp" // for ::MATF_INDEX
6 #include "inexor/network/SharedVar.hpp" // for SharedVar
7 #include "inexor/shared/geom.hpp"
8 
9 struct Texture;
10 struct bvec;
11 struct materialsurface;
12 
13 extern int refracting, refractfog;
14 extern bool reflecting, fading, fogging;
15 extern float reflectz;
17 
18 #define GETMATIDXVAR(name, var, type) \
19  type get##name##var(int mat) \
20  { \
21  switch(mat&MATF_INDEX) \
22  { \
23  default: case 0: return name##var; \
24  case 1: return name##2##var; \
25  case 2: return name##3##var; \
26  case 3: return name##4##var; \
27  } \
28  }
29 
30 extern const bvec &getwatercolor(int mat);
31 extern const bvec &getwaterfallcolor(int mat);
32 extern int getwaterfog(int mat);
33 extern const bvec &getlavacolor(int mat);
34 extern int getlavafog(int mat);
35 extern const bvec &getglasscolor(int mat);
36 
37 extern void cleanreflections();
38 extern void queryreflections();
39 extern void drawreflections();
40 extern void renderwater();
41 extern void renderlava(const materialsurface &m, Texture *tex, float scale);
42 extern void loadcaustics(bool force = false);
43 extern void preloadwatershaders(bool force = false);
SharedVar< int > caustics
int refractfog
Definition: water.cpp:818
int getwaterfog(int mat)
void loadcaustics(bool force=false)
Definition: renderva.cpp:1487
SharedVar< int > waterfade
void queryreflections()
Definition: water.cpp:739
const bvec & getwaterfallcolor(int mat)
Definition: octree.hpp:31
bool fogging
Definition: water.cpp:820
SharedVar< int > waterrefract
SharedVar< int > reflectdist
void renderlava(const materialsurface &m, Texture *tex, float scale)
Definition: water.cpp:239
bool fading
Definition: water.cpp:820
void preloadwatershaders(bool force=false)
Definition: water.cpp:330
void cleanreflections()
Definition: water.cpp:545
int refracting
Definition: water.cpp:818
3-dimensional UNSIGNED CHAR vector.
Definition: geom.hpp:1398
bool reflecting
Definition: water.cpp:820
const bvec & getlavacolor(int mat)
float reflectz
Definition: water.cpp:821
int getlavafog(int mat)
SharedVar< int > waterreflect
SharedVar wrapper for primitive/immutable objects.
Definition: SharedVar.hpp:55
const bvec & getwatercolor(int mat)
SharedVar< int > waterfallrefract
const bvec & getglasscolor(int mat)
void drawreflections()
Definition: water.cpp:940
mathmatics for vectors, matrices, quaterions and more
void renderwater()
Definition: water.cpp:349
SharedVar< int > vertwater
A Texture entry, holding info about a texture on the GPU.
Definition: texture.hpp:27