]> git.mxchange.org Git - simgear.git/commitdiff
Create new buffer type : emission
authorFrederic Bouvier <fredfgfs01@free.fr>
Sat, 14 Jan 2012 12:35:33 +0000 (13:35 +0100)
committerFrederic Bouvier <fredfgfs01@free.fr>
Sun, 4 Mar 2012 19:21:29 +0000 (20:21 +0100)
simgear/scene/material/Effect.hxx
simgear/scene/material/TextureBuilder.cxx

index 5187c5bbaccfd1a6bdbd5ac9712cb564dc23bc33..34ab62a0b630b39348d77ecc93900138ce4eea48 100644 (file)
@@ -81,6 +81,16 @@ public:
            const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
     osg::StateSet* getDefaultStateSet();
 
+    enum Buffer
+    {
+        DEPTH_BUFFER,
+        NORMAL_BUFFER,
+        DIFFUSE_BUFFER,
+        SPECULAR_BUFFER,
+        EMISSION_BUFFER,
+        LIGHTING_BUFFER
+    };
+
     // Define what needs to be generated for this effect
     enum Generator
     {
index d9ee830831ae0377373fdc4179732994cf00146f..ef1d6c1d4840d8fff1d835ab3f0b123ccd4a2685 100644 (file)
@@ -911,11 +911,12 @@ Texture* GBufferBuilder::build(Effect* effect, Pass* pass, const SGPropertyNode*
 
 namespace
 {
-TextureBuilder::Registrar installDepthBuffer("depth-buffer", new GBufferBuilder(0));
-TextureBuilder::Registrar installNormalBuffer("normal-buffer", new GBufferBuilder(1));
-TextureBuilder::Registrar installDiffuseBuffer("diffuse-buffer", new GBufferBuilder(2));
-TextureBuilder::Registrar installSpecularBuffer("specular-buffer", new GBufferBuilder(3));
-TextureBuilder::Registrar installLightingBuffer("lighting-buffer", new GBufferBuilder(4));
+    TextureBuilder::Registrar installDepthBuffer("depth-buffer", new GBufferBuilder(Effect::DEPTH_BUFFER));
+    TextureBuilder::Registrar installNormalBuffer("normal-buffer", new GBufferBuilder(Effect::NORMAL_BUFFER));
+    TextureBuilder::Registrar installDiffuseBuffer("diffuse-buffer", new GBufferBuilder(Effect::DIFFUSE_BUFFER));
+    TextureBuilder::Registrar installSpecularBuffer("specular-buffer", new GBufferBuilder(Effect::SPECULAR_BUFFER));
+    TextureBuilder::Registrar installEmissionBuffer("emission-buffer", new GBufferBuilder(Effect::EMISSION_BUFFER));
+    TextureBuilder::Registrar installLightingBuffer("lighting-buffer", new GBufferBuilder(Effect::LIGHTING_BUFFER));
 }
 
 }