Commits

Frederic De Groef committed e676e2b

removed NPR code & data, renamed the SSAOApp

  • Participants
  • Parent commits 17437d6

Comments (0)

Files changed (16)

File Dependencies/OgreCommon/ExampleApplication.h

         createCamera();
         createViewports();
 
-        // Set default mipmap level (NB some APIs ignore this)
-        TextureManager::getSingleton().setDefaultNumMipmaps(5);
 
 		// Create any resource listeners (for loading screens)
 		createResourceListener();

File Dependencies/npr/EdgeGeometryBuilder.cpp

-#include "precompiled.h"
-#include "EdgeGeometryBuilder.hpp"
-
-
-//-----------------------------------------------------------------------------
-EdgeGeometryBuilder::EdgeGeometryBuilder(const Ogre::String &_name, Ogre::Log *_log, Ogre::SceneManager *_sceneMgr)
-    :mName(_name)
-    ,mLog(_log)
-    ,mSceneMgr(_sceneMgr)
-    ,mIsBuilding(false)
-    ,mEdges(NULL)
-    ,mRidgeThreshold(40.0f)
-{
-}
-//-----------------------------------------------------------------------------
-EdgeGeometryBuilder::~EdgeGeometryBuilder()
-{
-}
-//-----------------------------------------------------------------------------
-void EdgeGeometryBuilder::attachToSceneNode(Ogre::SceneNode *_node)
-{
-    _node->attachObject(mEdges);
-}
-//-----------------------------------------------------------------------------
-void EdgeGeometryBuilder::setVisible(bool _visible)
-{
-#ifdef _DEBUG
-    assert(mEdges);
-#endif
-
-    mEdges->setVisible(_visible);
-}
-//-----------------------------------------------------------------------------
-void EdgeGeometryBuilder::begin()
-{
-    mIsBuilding = true;
-
-    mEdges = mSceneMgr->createManualObject(mName);
-    mEdges->begin("NPR/EdgeOutliner", Ogre::RenderOperation::OT_TRIANGLE_LIST);
-    mIndex = 0;
-
-}
-//-----------------------------------------------------------------------------
-void EdgeGeometryBuilder::end()
-{
-    mEdges->end();
-    mIsBuilding = false;
-}
-//-----------------------------------------------------------------------------
-void EdgeGeometryBuilder::addEdgesForEntity(Ogre::Entity *_ent)
-{
-    if(mIsBuilding)
-    {
-
-        mLog->logMessage("Creating edges for entity : " + _ent->getName());
-        Ogre::MeshPtr mesh = _ent->getMesh();
-
-        {
-            boost::format fmt("Mesh has %d submeshes");
-            fmt % mesh->getNumSubMeshes();
-            mLog->logMessage(fmt.str());
-        }
-
-        mesh->buildEdgeList();
-
-        Ogre::EdgeData *edgeData = mesh->getEdgeList();
-
-        {
-            boost::format fmt("Generating %d edgegroups");
-            fmt % edgeData->edgeGroups.size();
-            mLog->logMessage(fmt.str());
-        }
-    
-        for(int edgeGroupIdx = 0 ; edgeGroupIdx < edgeData->edgeGroups.size() ; edgeGroupIdx++)
-        {
-            {
-                boost::format fmt("Adding edges for edgegroup[%d]");
-                fmt % edgeGroupIdx ;
-                mLog->logMessage(fmt.str());
-            }
-
-            Ogre::EdgeData::EdgeGroup &currentEdgeGroup = edgeData->edgeGroups[edgeGroupIdx];
-            _addEdgesForEdgeGroup(currentEdgeGroup, *edgeData);
-
-            {
-                boost::format fmt("%s : Added %d edges (%d tris, %d vertices)");
-                fmt % mEdges->getName() % (mIndex/6) % (mIndex/3) % (mIndex);
-                mLog->logMessage(fmt.str());
-            }
-
-        }
-    }
-    else
-    {
-        OGRE_EXCEPT(Ogre::Exception::ERR_NOT_IMPLEMENTED, "Your card does not support vertex and fragment programs, so cannot "
-            "run this application. Sorry!", 
-            "createScene");
-
-
-        OGRE_EXCEPT(Ogre::Exception::ERR_RT_ASSERTION_FAILED
-            , "EdgeGeometryBuilder::addEdgesForEntity() was called before EdgeGeometryBuilder::begin() was"
-            , "EdgeGeometryBuilder::addEdgesForEntity()");
-    }
-}
-//-----------------------------------------------------------------------------
-void EdgeGeometryBuilder::_addEdgesForEdgeGroup(const Ogre::EdgeData::EdgeGroup &_edgeGroup, const Ogre::EdgeData &edgeData)
-{
-    std::vector<Ogre::Vector3> vertices;
-    vertices.resize(_edgeGroup.vertexData->vertexCount);
-
-    const Ogre::VertexElement* posElem =
-        _edgeGroup.vertexData->vertexDeclaration->findElementBySemantic(Ogre::VES_POSITION);
-
-    Ogre::HardwareVertexBufferSharedPtr vbuf =
-        _edgeGroup.vertexData->vertexBufferBinding->getBuffer(posElem->getSource());
-
-    unsigned char* vertex =
-        static_cast<unsigned char*>(vbuf->lock(Ogre::HardwareBuffer::HBL_READ_ONLY));
-
-    // There is _no_ baseVertexPointerToElement() which takes an Ogre::Real or a double
-    //  as second argument. So make it float, to avoid trouble when Ogre::Real will
-    //  be comiled/typedefed as double:
-    //      Ogre::Real* pReal;
-    float* pReal;
-
-    for( size_t j = 0; j < _edgeGroup.vertexData->vertexCount; ++j, vertex += vbuf->getVertexSize())
-    {
-        posElem->baseVertexPointerToElement(vertex, &pReal);
-
-        Ogre::Vector3 pt(pReal[0], pReal[1], pReal[2]);
-
-        vertices[j] = pt;
-    }
-    vbuf->unlock();
-
-
-
-
-
-
-    int edgeCount = _edgeGroup.edges.size();
-                                                            
-    for(int i=0; i<edgeCount ; i++)
-    {
-        Ogre::EdgeData::Edge e = _edgeGroup.edges[i];
-
-        Ogre::Vector3 v0, v1;
-        Ogre::Vector4 nA, nB ;
-        Ogre::Real markedEdge;
-
-        if(e.degenerate)
-        {
-            
-            v0 =  vertices[e.vertIndex[0]];
-            v1 =  vertices[e.vertIndex[1]];
-
-            nA = edgeData.triangleFaceNormals[e.triIndex[0]];
-            nB = -nA;
-            markedEdge = 2.0f;
-        }
-        else
-        {
-            v0 =  vertices[e.vertIndex[0]];
-            v1 =  vertices[e.vertIndex[1]];
-
-            nA = edgeData.triangleFaceNormals[e.triIndex[0]];
-            nB = edgeData.triangleFaceNormals[e.triIndex[1]];
-
-            Ogre::Real ridgeThreshold = Ogre::Degree(mRidgeThreshold).valueRadians();
-            Ogre::Real valleyThreshold = Ogre::Degree(mRidgeThreshold).valueRadians();
-
-
-            bool isRidge = _isEdgeARidge(Ogre::Vector3(nA.x, nA.y, nA.z)
-                                        ,Ogre::Vector3(nB.x, nB.y, nB.z)
-                                        ,ridgeThreshold);
-
-            bool isValley = _isEdgeAValley(Ogre::Vector3(nA.x, nA.y, nA.z)
-                                          ,Ogre::Vector3(nB.x, nB.y, nB.z)
-                                          ,valleyThreshold);
-
-            markedEdge = (isRidge || isValley) ? 1.0f : 0.0f;
-        }
-
-        {
-            boost::format fmt("Adding new edge for position : (%.2f, %.2f, %.2f)  (%.2f, %.2f, %.2f)");
-            fmt % v0.x % v0.y % v0.z % v1.x % v1.y % v0.z; 
-            mLog->logMessage(fmt.str());
-        }
-
-        _buildEdgeQuad(v0, v1, nA, nB, markedEdge, mIndex);
-        mIndex += 6;
-    }
-}
-//-----------------------------------------------------------------------------
-void EdgeGeometryBuilder::_buildEdgeQuad(  const Ogre::Vector3 &_v0, const Ogre::Vector3 &_v1
-                                         , const Ogre::Vector4 &_nA,const Ogre::Vector4 &_nB
-                                         , const Ogre::Real _markedEdge,unsigned int _idx)
-{
-    Ogre::Vector3 nA = Ogre::Vector3(_nA.x, _nA.y, _nA.z).normalisedCopy();
-    Ogre::Vector3 nB = Ogre::Vector3(_nB.x, _nB.y, _nB.z).normalisedCopy();
-
-    /* 1st tri
-    1 __ 2
-    | /
-    |/
-    3
-    */
-    mEdges->position(_v0);
-    mEdges->normal(nA);
-    mEdges->textureCoord(nB);
-    mEdges->textureCoord(_markedEdge);
-
-    mEdges->index(_idx++);
-
-    mEdges->position(_v0);
-    mEdges->normal(nB);
-    mEdges->textureCoord(nA);
-    mEdges->textureCoord(_markedEdge);
-
-    mEdges->index(_idx++);
-
-    mEdges->position(_v1);
-    mEdges->normal(nA);
-    mEdges->textureCoord(nB);
-    mEdges->textureCoord(_markedEdge);
-
-    mEdges->index(_idx++);
-
-    /* 2nd tri
-       6
-      /|
-     /_|
-    4   5
-    */
-    mEdges->position(_v1);
-    mEdges->normal(nA);
-    mEdges->textureCoord(nB);
-    mEdges->textureCoord(_markedEdge);
-
-    mEdges->index(_idx++);
-
-    mEdges->position(_v0);
-    mEdges->normal(nB);
-    mEdges->textureCoord(nA);
-    mEdges->textureCoord(_markedEdge);
-
-    mEdges->index(_idx++);
-
-    mEdges->position(_v1);
-    mEdges->normal(nB);
-    mEdges->textureCoord(nA);
-    mEdges->textureCoord(_markedEdge);
-
-    mEdges->index(_idx++);
-}
-
-//-----------------------------------------------------------------------------
-bool EdgeGeometryBuilder::_isEdgeARidge(const Ogre::Vector3 &_nA, const Ogre::Vector3 &_nB, const Ogre::Real &_threshold)
-{
-    Ogre::Vector3 nA_norm = Ogre::Vector3(_nA.x, _nA.y, _nA.z).normalisedCopy();
-    Ogre::Vector3 nB_norm = Ogre::Vector3(_nB.x, _nB.y, _nB.z).normalisedCopy();
-
-    return nA_norm.dotProduct(nB_norm) < Ogre::Math::Cos(_threshold);
-}
-//-----------------------------------------------------------------------------
-bool EdgeGeometryBuilder::_isEdgeAValley(const Ogre::Vector3 &_nA, const Ogre::Vector3 &_nB, const Ogre::Real &_threshold)
-{
-    Ogre::Vector3 nA_norm = Ogre::Vector3(_nA.x, _nA.y, _nA.z).normalisedCopy();
-    Ogre::Vector3 nB_norm = Ogre::Vector3(_nB.x, _nB.y, _nB.z).normalisedCopy();
-
-    return nA_norm.dotProduct(nB_norm) < Ogre::Math::Cos(_threshold);
-}

File Dependencies/npr/EdgeGeometryBuilder.hpp

-#pragma once
-#ifndef __041010_EDGEGEOMETRYBUILDER_HPP__
-#define __041010_EDGEGEOMETRYBUILDER_HPP__
-
-#include <Ogre.h>
-
-class EdgeGeometryBuilder
-{
-public:
-    EdgeGeometryBuilder(const Ogre::String &_name, Ogre::Log *_log, Ogre::SceneManager *_sceneMgr);
-    ~EdgeGeometryBuilder();
-    void begin();
-    void addEdgesForEntity(Ogre::Entity *_ent);
-    void end();
-    void attachToSceneNode(Ogre::SceneNode*);
-    void setVisible(bool _visible);
-    bool isVisible(){return mEdges->isVisible();};
-
-
-protected:
-    void _addEdgesForEdgeGroup(const Ogre::EdgeData::EdgeGroup &_edgeGroup
-                              ,const Ogre::EdgeData &edgeData);
-    void _buildEdgeQuad(const Ogre::Vector3 &_v0, const Ogre::Vector3 &_v1
-                       ,const Ogre::Vector4 &_nA, const Ogre::Vector4 &_nB
-                       ,const Ogre::Real _markedEdge, unsigned int _idx);
-
-    inline bool _isEdgeARidge(const Ogre::Vector3&, const Ogre::Vector3&, const Ogre::Real&);
-    inline bool _isEdgeAValley(const Ogre::Vector3&, const Ogre::Vector3&, const Ogre::Real&);
-
-
-private:
-    EdgeGeometryBuilder(){};
-
-
-protected:
-    Ogre::String mName;
-    bool mIsBuilding;
-    Ogre::ManualObject *mEdges;
-    Ogre::Log *mLog;
-    Ogre::SceneManager *mSceneMgr;
-    Ogre::Real mRidgeThreshold;
-
-    int mIndex;
-};
-
-#endif 

File bin/Debug/resources.cfg

 [General]
 FileSystem=../../media/
 FileSystem=../../media/Grid
-FileSystem=../../media/npr
 FileSystem=../../media/ssao
 FileSystem=../../media/ssao/ogre
 FileSystem=../../media/ssao/shanmugam

File bin/Release/resources.cfg

 [General]
 FileSystem=../../media/
 FileSystem=../../media/Grid
-FileSystem=../../media/npr
 FileSystem=../../media/ssao
 FileSystem=../../media/ssao/ogre
 FileSystem=../../media/ssao/shanmugam

File media/npr/NPR.cg

-//------------------------------------------------------------------------------
-struct AppData
-{
-    float3 position   : POSITION;
-    float3 normal     : NORMAL;
-    float3 tangent    : TEXCOORD0;
-    float  markedEdge : TEXCOORD1;
-};
-
-struct VertexOutput
-{
-    float4 position : POSITION;
-    float4 color    : COLOR;
-};
-//------------------------------------------------------------------------------
-VertexOutput main_vp( AppData IN,
-                      // parameters
-                      uniform float3   eyePosition,   // object space
-                      uniform float4x4 worldViewProj)
-{
-    VertexOutput OUT;
-
-    float3 P = IN.position;
-    float3 N = IN.normal;
-    float3 T = IN.tangent;
-    float3 E = P - eyePosition.xyz;
-
-    OUT.color = 0.0f;
-
-	float EdotN = dot(E,N);
-	float EdotT = dot(E,T);
- 
-	float extend =  0.1 * (length(E)/75.0f);
-    float3 newPos;
-
-    // extend everything by default
-    newPos = IN.position + IN.normal * extend; 
-
-	if ( ( EdotN * EdotT ) < 0 )	// silhouette detection : one triangle
-                                    // facing, one triangle backfacing
-	{
-		OUT.color.a = 1;	// make this visible
-		if ( EdotN > 0 )	// extend only the front facing vertices
-		{
-            // back facing vertices are extended in the other direction
-            // disabled culling will make the edge appear
-            newPos = IN.position - IN.normal * extend ;
-		}        
-	}
-    
-    // ridge or valley
-    if(IN.markedEdge == 1.0f)
-    {
-        OUT.color.a = 1.0f;
-    }
-    // boundary edge
-    else if(IN.markedEdge == 2.0f)
-    {
-        newPos = IN.position - IN.normal * extend;
-        OUT.color.a = 1;
-    }
-
-
-    OUT.position = mul(worldViewProj, float4(newPos, 1)); 
-    return OUT;
-}
-//------------------------------------------------------------------------------
-void main_fp(float4 color      : COLOR,
-             out float4 oColor : COLOR	 
-)
-{
-	oColor = color;
-}
-//------------------------------------------------------------------------------
-			 
-			 

File media/npr/NPR.material

-material NPR/Face
-{
-	technique
-	{
-		pass
-		{	
-			cull_hardware	none
-			ambient		0.5 0.5 0.5 1.0
-			diffuse		0.5 0.5 0.5
-			//specular	0.3 0.3 0.5 15.5
-		}
-	}  
-}
-//------------------------------------------------------------------------------
-vertex_program NPR/EdgeOutlinerVP cg
-{
-	source		NPR.cg
-	entry_point	main_vp
-	profiles	vs_1_1 arbvp1
-
-	default_params
-	{ 
-		param_named_auto   eyePosition	  camera_position_object_space
-		param_named_auto   worldViewProj  worldviewproj_matrix
-	}
-}
-//------------------------------------------------------------------------------
-fragment_program NPR/EdgeOutlinerFP cg
-{
-	source		 NPR.cg
-	entry_point	 main_fp
-	profiles	 ps_1_1 arbfp1 fp20
-}
-//------------------------------------------------------------------------------
-material NPR/EdgeOutliner
-{
-	technique
-	{
-		pass
-		{
-			alpha_rejection		greater_equal 1
-			depth_bias          1
-			cull_hardware		none
-
-			vertex_program_ref NPR/EdgeOutlinerVP
-			{				
-			}
-			fragment_program_ref NPR/EdgeOutlinerFP
-			{
-			}
-		}
-	}
-}
-//------------------------------------------------------------------------------

File media/npr/gooch.cg

-
-struct AppData
-{
-    float4 position : POSITION;
-    float3 normal	: NORMAL;
-};
-
-struct VertexOutput
-{
-    float4 position  : POSITION;
-    float4 color     : COLOR;
-};
-
-
-//------------------------------------------------------------------------------
-void gooch_shading(float3 N, float3 L, float3 V, float3 kc, float3 kw
-                   , float shininess, float3 lightColor, float3 Ks
-                   ,out float3 oDiffuse
-                   ,out float3 oSpecular)
-{
-    float3 LdotN =  max(dot(L, N), 0);
-    //oDiffuse = (1 + LdotN) * kc * 0.5  +  (1 - LdotN) * kw * 0.5;
-    float3 goochFactor  = (1.0+LdotN) / 2.0;
-    oDiffuse = lerp(kw, kc, goochFactor);
-
-
-    float3 H = normalize(L+V);
-    float HdotN = dot(H, N);
-    float4 litV = lit(LdotN,HdotN,shininess);
-
-    float spec = litV.y * litV.z;
-    oSpecular = Ks * lightColor * spec;
-}
-
-//------------------------------------------------------------------------------
-VertexOutput main_vp(AppData IN
-                     ,uniform float4x4 modelViewProj
-                     ,uniform float3 globalAmbient
-                     ,uniform float3 lightColor
-                     ,uniform float3 lightPosition
-                     ,uniform float3 eyePosition
-                     ,uniform float3 KCool
-                     ,uniform float3 KWarm
-                     ,uniform float3 Ks
-                     ,uniform float ns)
-{
-    VertexOutput OUT;
-    OUT.position = mul(modelViewProj, IN.position);
-    
-    float3 N = normalize(IN.normal);
-    float3 L = normalize(lightPosition);
-    float3 V = normalize(eyePosition);
-
-    
-    float3 goochDiffuse, goochSpecular;
-    gooch_shading(N, L, V, KCool, KWarm, ns, lightColor, Ks
-                  , goochDiffuse, goochSpecular);
-    
-    OUT.color.rgb = goochDiffuse + goochSpecular;
-    OUT.color.a = 1;
-    
-    return OUT;
-}
-//------------------------------------------------------------------------------
-void main_fp(float4 iColor       : COLOR
-            ,out float4 oColor   : COLOR)
-{
-    oColor = iColor;
-}
-//------------------------------------------------------------------------------

File media/npr/gooch.material

-//------------------------------------------------------------------------------
-vertex_program Shading/PerVertex/GoochVP cg
-{
-	source		gooch.cg
-	entry_point	main_vp
-	profiles	vs_2_0
-	
-	default_params
-	{ 
-		param_named_auto   modelViewProj    worldviewproj_matrix
-		param_named_auto globalAmbient      ambient_light_colour
-        	param_named_auto lightColor	        light_diffuse_colour 0
-        	param_named_auto lightPosition 	    light_position_object_space 0
-        	param_named_auto eyePosition	    camera_position_object_space
-
-	    	
-	}
-}
-//------------------------------------------------------------------------------
-fragment_program Shading/PerVertex/GoochFP cg
-{
-	source		 gooch.cg
-	entry_point	 main_fp
-	profiles	 ps_2_0
-}
-//------------------------------------------------------------------------------
-material Shading/PerVertex/Gooch
-{
-	technique
-	{
-		
-		pass
-		{
-			vertex_program_ref Shading/PerVertex/GoochVP
-			{
-				param_named KCool float3	1.0   1.0   1.0
-				param_named KWarm float3 	0.0   0.0   0.5
-				param_named Ks 	  float3 	0.5   0.5   0.5
-	    		param_named ns 	  float 	50.0
-			}
-			fragment_program_ref Shading/PerVertex/GoochFP
-			{
-		
-			}
-		}
-	}
-}
-//------------------------------------------------------------------------------
-material Shading/PerVertex/Gooch_noculling
-{
-	technique
-	{
-		
-		pass
-		{
-            depth_bias 1
-            cull_hardware none
-			vertex_program_ref Shading/PerVertex/GoochVP
-			{
-				param_named KCool float3	1.0   1.0   1.0
-				param_named KWarm float3 	0.0   0.0   0.5
-				param_named Ks 	  float3 	0.5   0.5   0.5
-	    		param_named ns 	  float 	50.0
-			}
-			fragment_program_ref Shading/PerVertex/GoochFP
-			{
-		
-			}
-		}
-	}
-}
-//------------------------------------------------------------------------------
-vertex_program Shading/PerPixel/GoochVP cg
-{
-	source		gooch_pp.cg
-	entry_point	main_vp
-	profiles	vs_2_0
-
-	default_params		
-	{ 
-		param_named_auto   modelViewProj    worldviewproj_matrix
-	}
-	
-}
-//------------------------------------------------------------------------------
-fragment_program Shading/PerPixel/GoochFP cg
-{
-	source		 gooch_pp.cg
-	entry_point	 main_fp
-	profiles	 ps_2_0
-
-	default_params
-	{ 
-		param_named_auto   modelViewProj    worldviewproj_matrix
-		param_named_auto globalAmbient      ambient_light_colour
-        	param_named_auto lightColor	        light_diffuse_colour 0
-        	param_named_auto lightPosition 	    light_position_object_space 0
-        	param_named_auto eyePosition	    camera_position_object_space    	
-	}
-}
-//------------------------------------------------------------------------------
-material Shading/PerPixel/Gooch
-{
-	technique
-	{
-		
-		pass
-		{
-			vertex_program_ref Shading/PerPixel/GoochVP
-			{
-			}
-			fragment_program_ref Shading/PerPixel/GoochFP
-			{
-				param_named KCool float3	1.0   1.0   1.0
-				param_named KWarm float3 	0.0   0.0   0.5
-				param_named Ks 	  float3 	0.0  0.0   0.0
-	    			param_named ns 	  float 	50.0
-			}
-		}
-	}
-}

File media/npr/gooch_pp.cg

-
-struct AppData{
-    float4 position : POSITION;
-    float3 normal	: NORMAL;
-};
-
-struct VertexOutput{
-    float4 position  : POSITION;
-    float3 objectPos : TEXCOORD0;
-    float3 normal    : TEXCOORD1;
-};
-
-struct FragmentInput{
-    float3 position  : TEXCOORD0;
-    float3 normal    : TEXCOORD1;
-};
-
-
-//------------------------------------------------------------------------------
-void gooch_shading(float3 N, float3 L, float3 V, float3 kc, float3 kw
-                   , float shininess, float3 lightColor, float3 Ks
-                   ,out float3 oDiffuse
-                   ,out float3 oSpecular)
-{
-    float3 LdotN =  max(dot(L, N), 0);
-    //oDiffuse = (1 + LdotN) * kc * 0.5  +  (1 - LdotN) * kw * 0.5;
-    float3 goochFactor  = (1.0+LdotN) / 2.0;
-    oDiffuse = lerp(kw, kc, goochFactor);
-
-
-    float3 H = normalize(L+V);
-    float HdotN = dot(H, N);
-    float4 litV = lit(LdotN,HdotN,shininess);
-
-    float spec = litV.y * litV.z;
-    oSpecular = Ks * lightColor * spec;
-}
-
-//------------------------------------------------------------------------------
-VertexOutput main_vp(AppData IN
-                     ,uniform float4x4 modelViewProj)
-
-{
-    VertexOutput OUT;
-    OUT.position = mul(modelViewProj, IN.position);
-    OUT.objectPos = IN.position.xyz;
-    OUT.normal = IN.normal;
-    
-    return OUT;
-
-}
-//------------------------------------------------------------------------------
-void main_fp(FragmentInput IN
-             ,uniform float3 globalAmbient
-             ,uniform float3 lightColor
-             ,uniform float3 lightPosition
-             ,uniform float3 eyePosition
-             ,uniform float3 KCool
-             ,uniform float3 KWarm
-             ,uniform float3 Ks
-             ,uniform float ns
-             ,out float4 oColor   : COLOR)
-{
-
-    float3 N = normalize(IN.normal);
-    float3 L = normalize(lightPosition);
-    float3 V = normalize(eyePosition);
-    
-    float3 goochDiffuse, goochSpecular;
-    gooch_shading(N, L, V, KCool, KWarm, ns, lightColor, Ks
-                  , goochDiffuse, goochSpecular);
-    
-    oColor.rgb = goochDiffuse + goochSpecular;
-    oColor.a = 1;
-}
-//------------------------------------------------------------------------------

File ogre-ssao/OgreApplication.cpp

     createCamera();
     createViewports();
 
-    // Set default mipmap level (NB some APIs ignore this)
-    TextureManager::getSingleton().setDefaultNumMipmaps(5);
-
     // Create any resource listeners (for loading screens)
     createResourceListener();
 
 
     mSSAOCompositor->setEnabled(false);
     mSSAOCompositor->addListener(this);
-
-
-    mSSAOLog  = Ogre::LogManager::getSingleton().createLog("SSAO.log");
 }
-
-
 //-----------------------------------------------------------------------------
 void OgreApplication::notifyMaterialRender(Ogre::uint32 pass_id, Ogre::MaterialPtr &mat)
 {

File ogre-ssao/OgreApplication.h

    virtual bool frameStarted(const Ogre::FrameEvent& evt); 
    virtual bool frameEnded(const Ogre::FrameEvent& evt); 
 
-   // OIS crap
-   //virtual bool keyPressed( const OIS::KeyEvent &e );
-   //virtual bool keyReleased( const OIS::KeyEvent &e );
-
-   //virtual bool mouseMoved( const OIS::MouseEvent &e );
-   //virtual bool mousePressed( const OIS::MouseEvent &e, OIS::MouseButtonID id );
-   //virtual bool mouseReleased( const OIS::MouseEvent &e, OIS::MouseButtonID id );
-
-
 
     void _processKeyboardInput();
     void _processMouseInput();
 
 
     Ogre::CompositorInstance *mSSAOCompositor;
-    Ogre::Log *mSSAOLog ;
     int mImageCounter;
 
 

File ogre-ssao/SSAOApp.cpp

 
 #include "precompiled.h"
 
-#include "ULBBuildingApp.h"
+#include "SSAOApp.h"
 
 #include <sstream>
 #include <boost/foreach.hpp>
 #include <boost/format.hpp>
 
 //-----------------------------------------------------------------------------
-ULBBuildingApp::ULBBuildingApp()
+SSAOApp::SSAOApp()
     :OgreApplication("ULB_Building_viz", CT_MOUSE)
     ,mBBset(NULL)
     ,mLightFlare(NULL)
 {
 }
 //-----------------------------------------------------------------------------
-void ULBBuildingApp::createScene()
+void SSAOApp::createScene()
 {
-    mLog  = Ogre::LogManager::getSingleton().createLog("NPR.log");
+    mLog  = Ogre::LogManager::getSingleton().createLog("SSAO.log");
 
 
     const Ogre::RenderSystemCapabilities* caps = Ogre::Root::getSingleton().getRenderSystem()->getCapabilities();
     _createDebugOverlay();
 }
 //-----------------------------------------------------------------------------
-bool ULBBuildingApp::frameStarted(const Ogre::FrameEvent& evt)
+bool SSAOApp::frameStarted(const Ogre::FrameEvent& evt)
 {
     bool cont = OgreApplication::frameStarted(evt);
 
     return cont;
 }
 //-----------------------------------------------------------------------------
-void ULBBuildingApp::_populate()
+void SSAOApp::_populate()
 {   using namespace Ogre;
 
 
 
 }
 //-----------------------------------------------------------------------------
-Ogre::SceneNode* ULBBuildingApp::_loadMesh(const Ogre::String &_name, const Ogre::Vector3 &_pos)
+Ogre::SceneNode* SSAOApp::_loadMesh(const Ogre::String &_name, const Ogre::Vector3 &_pos)
 {
     std::string entityName = _name+Ogre::StringConverter::toString(mScenePairs.size());
 
     ent->setMaterialName("SSAO/DiffuseLight_GBuffer");
     node->attachObject(ent);
 
-    mScenePairs.push_back(ULBBuildingApp::ScenePair(ent, node));
+    mScenePairs.push_back(SSAOApp::ScenePair(ent, node));
 
     return node;
 }
 //-----------------------------------------------------------------------------
-void ULBBuildingApp::_createLight()
+void SSAOApp::_createLight()
 {
     //mBBset = mSceneMgr->createBillboardSet("Light BB");
     //mBBset->setMaterialName("Objects/Flare");

File ogre-ssao/SSAOApp.h

 * To Public License, Version 2, as published by Sam Hocevar. See
 * http://sam.zoy.org/wtfpl/COPYING for more details. */
 
-#ifndef _ULBBUILDINGAPP__H_
-#define _ULBBUILDINGAPP__H_
+#ifndef _SSAOAPP__H_
+#define _SSAOAPP__H_
 
 #include <vector>
 #include <list>
 
 
 
-class ULBBuildingApp : public OgreApplication
+class SSAOApp : public OgreApplication
 {
 protected:
     typedef std::pair<Ogre::Entity*, Ogre::SceneNode*> ScenePair;
     typedef std::vector<ScenePair> ScenePairs;
 public:
-    ULBBuildingApp();
+    SSAOApp();
     void createScene();
 
     bool frameStarted(const Ogre::FrameEvent& evt);
 };
 
 
-#endif _ULBBUILDINGAPP__H_
+#endif _SSAOAPP__H_

File ogre-ssao/ogre-ssao.cpp

 #include "precompiled.h"
 
 #include <Ogre.h>
-#include "ULBBuildingApp.h"
+#include "SSAOApp.h"
 
 
 
 #endif
 {
    // Create application object
-   ULBBuildingApp app;
+   SSAOApp app;
 
    try
    {

File ogre-ssao/ogre-ssao.vcproj

 				Name="VCCLCompilerTool"
 				AdditionalOptions="-Zm200"
 				Optimization="0"
-				AdditionalIncludeDirectories="&quot;$(BOOST136_HOME)&quot;;&quot;$(OGRE16_MH_SRCHOME)\Dependencies\include&quot;;&quot;$(OGRE16_MH_SRCHOME)\OgreMain\include&quot;;..\Dependencies\OgreCommon;..\Dependencies\npr"
+				AdditionalIncludeDirectories="&quot;$(BOOST144_HOME)&quot;;&quot;$(OGRE16_MH_SRCHOME)\Dependencies\include&quot;;&quot;$(OGRE16_MH_SRCHOME)\OgreMain\include&quot;;..\Dependencies\OgreCommon;..\Dependencies\npr"
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
 				AdditionalOptions="-Zm200"
 				Optimization="2"
 				EnableIntrinsicFunctions="true"
-				AdditionalIncludeDirectories="&quot;$(BOOST136_HOME)&quot;;&quot;$(OGRE16_MH_SRCHOME)\Dependencies\include&quot;;&quot;$(OGRE16_MH_SRCHOME)\OgreMain\include&quot;;..\Dependencies\OgreCommon;..\Dependencies\npr"
+				AdditionalIncludeDirectories="&quot;$(BOOST144_HOME)&quot;;&quot;$(OGRE16_MH_SRCHOME)\Dependencies\include&quot;;&quot;$(OGRE16_MH_SRCHOME)\OgreMain\include&quot;;..\Dependencies\OgreCommon;..\Dependencies\npr"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
 				RuntimeLibrary="2"
 				EnableFunctionLevelLinking="true"
 				>
 			</File>
 			<File
+				RelativePath=".\ogre-ssao.cpp"
+				>
+			</File>
+			<File
 				RelativePath=".\OgreApplication.cpp"
 				>
 			</File>
 				</FileConfiguration>
 			</File>
 			<File
-				RelativePath=".\TextRenderer.cpp"
+				RelativePath=".\SSAOApp.cpp"
 				>
 			</File>
 			<File
-				RelativePath=".\ogre-ssao.cpp"
-				>
-			</File>
-			<File
-				RelativePath=".\SSAOApp.cpp"
+				RelativePath=".\TextRenderer.cpp"
 				>
 			</File>
 		</Filter>
 				>
 			</File>
 			<File
-				RelativePath=".\TextRenderer.h"
+				RelativePath=".\SSAOApp.h"
 				>
 			</File>
 			<File
-				RelativePath=".\SSAOApp.h"
+				RelativePath=".\TextRenderer.h"
 				>
 			</File>
 		</Filter>
 				Name="SSAO"
 				>
 			</Filter>
-			<Filter
-				Name="NPR"
-				>
-				<File
-					RelativePath="..\media\npr\gooch.cg"
-					>
-				</File>
-				<File
-					RelativePath="..\media\npr\gooch.material"
-					>
-				</File>
-				<File
-					RelativePath="..\media\npr\gooch_pp.cg"
-					>
-				</File>
-				<File
-					RelativePath="..\media\npr\NPR.cg"
-					>
-				</File>
-				<File
-					RelativePath="..\media\npr\NPR.material"
-					>
-				</File>
-			</Filter>
-		</Filter>
-		<Filter
-			Name="Dep/NPR"
-			>
-			<File
-				RelativePath="..\Dependencies\npr\EdgeGeometryBuilder.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\Dependencies\npr\EdgeGeometryBuilder.hpp"
-				>
-			</File>
 		</Filter>
 		<Filter
 			Name="Dep/OgreCommon"