1 #ifndef MSP_GL_ENVIRONMENTMAP_H_
2 #define MSP_GL_ENVIRONMENTMAP_H_
6 #include "framebuffer.h"
8 #include "programdata.h"
9 #include "renderbuffer.h"
10 #include "texturecube.h"
20 Creates a cube map texture of the surroundings of the renderable. This texture
21 can then be used to implement effects such as reflections or refractions.
23 If the EnvironmentMap is used in a Pipeline, it's worth noting that the cube
24 map will be prepared outside of any rendering pass. It's recommended to use
25 another Pipeline to define which passes should be used to render the
28 class EnvironmentMap: public Effect
32 Renderable &environment;
34 Renderbuffer depth_buf;
36 const Sampler &sampler;
38 mutable ProgramData shdata;
40 unsigned update_interval;
41 unsigned update_delay;
44 EnvironmentMap(Resources &, unsigned size, Renderable &rend, Renderable &env);
46 void set_depth_clip(float, float);
47 void set_update_interval(unsigned);
50 virtual void setup_frame(Renderer &);
51 virtual void finish_frame();
53 virtual void render(Renderer &, const Tag & = Tag()) const;