Difference between revisions of "CellShadingNotes"

From SfzWiki
Jump to: navigation, search
(other stuff about shaders)
(other stuff about shaders)
Line 37: Line 37:
 
* http://www.terathon.com/index.html
 
* http://www.terathon.com/index.html
 
* http://www.gamasutra.com/features/19981009/multitexturing_01.htm  specular (light) map
 
* http://www.gamasutra.com/features/19981009/multitexturing_01.htm  specular (light) map
 +
 +
generate mesh tangent vectors by code
 +
<pre>
 +
void CEntity::SetGenerateTangents(const STRING &meshType)
 +
  {
 +
      MeshPtr pMesh = MeshManager::getSingleton().load(meshType,
 +
        ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, 
 +
        HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY,
 +
        HardwareBuffer::HBU_STATIC_WRITE_ONLY,
 +
        true, true);
 +
 +
      unsigned short src, dest;
 +
      if (!pMesh->suggestTangentVectorBuildParams(src, dest))
 +
      {
 +
        pMesh->buildTangentVectors(src, dest);
 +
      } 
 +
  }
 +
</pre>

Revision as of 18:33, 7 September 2007

a few notes about cellshading experiments.

discussion in our forum : http://freegamer.schattenkind.net/index.php?t=msg&th=209

links about celshading

other stuff about shaders

generate mesh tangent vectors by code

 void CEntity::SetGenerateTangents(const STRING &meshType)
   {
      MeshPtr pMesh = MeshManager::getSingleton().load(meshType,
         ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,   
         HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY,
         HardwareBuffer::HBU_STATIC_WRITE_ONLY,
         true, true);

      unsigned short src, dest;
      if (!pMesh->suggestTangentVectorBuildParams(src, dest))
      {
         pMesh->buildTangentVectors(src, dest);
      }   
   }