Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 167 vs 168 for /trunk/Source Code/Rendering/RenderPass/Headers/Reflector.h

Diff revisions: vs.
  @@ -44,9 +44,11 @@
44 44
45 45 ///This function should be unique to every reflector. Portals may need special effects, mirrors some special lighting, etc
46 46 virtual void updateReflection() = 0;
47 -
48 - inline FrameBufferObject* getReflectionFBO(){return _reflectedTexture;}
49 -
47 + ///Each reflector has a certain plane equation. Update this after each transform to obtain proper reflections
48 + virtual void updatePlaneEquation() = 0;
49 + ///Retrieves the reflection texture
50 + inline FrameBufferObject* getReflectionFBO() {return _reflectedTexture;}
51 + inline const Plane<F32>& getReflectionPlane() {return _reflectionPlane;}
50 52 ///Rendering callback is that function in the scene used to render the reflection
51 53 ///The SceneGraph is not the default rendering class for reflections as some elements (i.e. Sky) are not part of it
52 54 ///As the sky and other elements should be included in the reflection, we should set a custom callback
  @@ -57,6 +59,10 @@
57 59 ///Draw a small quad with our reflection buffer as a texture
58 60 void previewReflection();
59 61
62 + private:
63 + /// Create FBO
64 + bool build();
65 +
60 66 protected:
61 67 ///This is inherited from FrameListener and is used to queue upreflection on every frame start
62 68 bool framePreRenderEnded(const FrameEvent& evt);
  @@ -73,19 +79,18 @@
73 79 /// Use this to force current reflector to draw itself in reflection
74 80 bool _excludeSelfReflection;
75 81 bool _previewReflection;
76 - private:
77 - /// Create FBO
78 - bool build();
79 82
80 - protected:
81 83 boost::function0<void> _renderCallback;
82 84 FrameBufferObject* _reflectedTexture;
83 - Quad3D* _renderQuad;
85 + Quad3D* _renderQuad;
86 + Plane<F32> _reflectionPlane;
84 87 ShaderProgram* _previewReflectionShader;
85 88 /// used for render exclusion. Do not render self in own reflection
86 89 bool _updateSelf;
87 90 /// Have we initialized our FBO?
88 91 bool _createdFBO;
92 + /// does the reflector plane need updating?
93 + bool _planeDirty;
89 94 };
90 95
91 96 #endif