1 #ifndef OPENMW_MWRENDER_VISMASK_H
2 #define OPENMW_MWRENDER_VISMASK_H
3 
4 namespace MWRender
5 {
6 
7     /// Node masks used for controlling visibility of game objects.
8     /// @par Any node in the OSG scene graph can have a node mask. When traversing the scene graph,
9     /// the node visitor's traversal mask is bitwise AND'ed with the node mask. If the result of this test is
10     /// 0, then the node <i>and all its child nodes</i> are not processed.
11     /// @par Important traversal masks are the camera's cull mask (determines what is visible),
12     /// the update visitor mask (what is updated) and the intersection visitor mask (what is
13     /// selectable through mouse clicks or other intersection tests).
14     /// @par In practice, it can be useful to make a "hierarchy" out of the node masks - e.g. in OpenMW,
15     /// all 3D rendering nodes are child of a Scene Root node with Mask_Scene. When we do not want 3D rendering,
16     /// we can just omit Mask_Scene from the traversal mask, and do not need to omit all the individual
17     /// element masks (water, sky, terrain, etc.) since the traversal will already have stopped at the Scene root node.
18     /// @par The comments within the VisMask enum should give some hints as to what masks are commonly "child" of
19     /// another mask, or what type of node this mask is usually set on.
20     /// @note The mask values are not serialized within models, nor used in any other way that would break backwards
21     /// compatibility if the enumeration values were to be changed. Feel free to change them when it makes sense.
22     enum VisMask : unsigned int
23     {
24         Mask_UpdateVisitor = 0x1, // reserved for separating UpdateVisitors from CullVisitors
25 
26         // child of Scene
27         Mask_Effect = (1<<1),
28         Mask_Debug = (1<<2),
29         Mask_Actor = (1<<3),
30         Mask_Player = (1<<4),
31         Mask_Sky = (1<<5),
32         Mask_Water = (1<<6), // choose Water or SimpleWater depending on detail required
33         Mask_SimpleWater = (1<<7),
34         Mask_Terrain = (1<<8),
35         Mask_FirstPerson = (1<<9),
36         Mask_Object = (1<<10),
37         Mask_Static = (1<<11),
38 
39         // child of Sky
40         Mask_Sun = (1<<12),
41         Mask_WeatherParticles = (1<<13),
42 
43         // top level masks
44         Mask_Scene = (1<<14),
45         Mask_GUI = (1<<15),
46 
47         // Set on a ParticleSystem Drawable
48         Mask_ParticleSystem = (1<<16),
49 
50         // Set on cameras within the main scene graph
51         Mask_RenderToTexture = (1<<17),
52 
53         Mask_PreCompile = (1<<18),
54 
55         // Set on a camera's cull mask to enable the LightManager
56         Mask_Lighting = (1<<19),
57 
58         Mask_Groundcover = (1<<20),
59     };
60 
61 }
62 
63 #endif
64