From: Frederic Bouvier Date: Sat, 14 Jan 2012 12:35:33 +0000 (+0100) Subject: Create new buffer type : emission X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c9a80caff5b8bd3bebd77b397ecc8159afeaf082;p=simgear.git Create new buffer type : emission --- diff --git a/simgear/scene/material/Effect.hxx b/simgear/scene/material/Effect.hxx index 5187c5bb..34ab62a0 100644 --- a/simgear/scene/material/Effect.hxx +++ b/simgear/scene/material/Effect.hxx @@ -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 { diff --git a/simgear/scene/material/TextureBuilder.cxx b/simgear/scene/material/TextureBuilder.cxx index d9ee8308..ef1d6c1d 100644 --- a/simgear/scene/material/TextureBuilder.cxx +++ b/simgear/scene/material/TextureBuilder.cxx @@ -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)); } }