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"
19 Creates a cube map texture of the surroundings of the renderable. This texture
20 can then be used to implement effects such as reflections or refractions.
22 If the EnvironmentMap is used in a Pipeline, it's worth noting that the cube
23 map will be prepared outside of any rendering pass. It's recommended to use
24 another Pipeline to define which passes should be used to render the
27 class EnvironmentMap: public Effect
31 Renderable &environment;
33 Renderbuffer depth_buf;
34 mutable Framebuffer fbo[6];
35 mutable Camera camera;
36 mutable ProgramData shdata;
37 mutable bool rendered;
40 EnvironmentMap(unsigned size, Renderable &rend, Renderable &env);
42 virtual void setup_frame() const;
43 virtual void finish_frame() const;
45 virtual void render(Renderer &, const Tag &) const;