Пример #1
0
void BumpFeatGLSL::processVert(  Vector<ShaderComponent*> &componentList, 
                                 const MaterialFeatureData &fd )
{
   MultiLine *meta = new MultiLine;
	output = meta;
	
	const bool useTexAnim = fd.features[MFT_TexAnim];

   // Output the texture coord.
   getOutTexCoord(   "texCoord", 
                     "vec2", 
                     true, 
                     useTexAnim, 
                     meta, 
                     componentList );

	if ( fd.features.hasFeature( MFT_DetailNormalMap ) )
      addOutDetailTexCoord( componentList, 
										meta,
										useTexAnim );
	
   // Also output the worldToTanget transform which
   // we use to create the world space normal.
   getOutWorldToTangent( componentList, meta, fd );
}
Пример #2
0
void BumpFeatHLSL::processVert(  Vector<ShaderComponent*> &componentList, 
                                 const MaterialFeatureData &fd )
{
   MultiLine *meta = new MultiLine;

   // Output the texture coord.
   getOutTexCoord(   "texCoord", 
                     "float2", 
                     true, 
                     fd.features[MFT_TexAnim], 
                     meta, 
                     componentList );

   // Also output the worldToTanget transform which
   // we use to create the world space normal.
   getOutWorldToTangent( componentList, meta );


   // TODO: Restore this!
   /*
   // Check to see if we're rendering world space normals.
   if ( fd.materialFeatures[MFT_NormalsOut] )
   {
      Var *inNormal = (Var*)LangElement::find( "normal" );

      Var *outNormal = connectComp->getElement( RT_TEXCOORD );
      outNormal->setName( "normal" );
      outNormal->setStructName( "OUT" );
      outNormal->setType( "float3" );
      outNormal->mapsToSampler = false;

      meta->addStatement( new GenOp( "   @ = @; // MFT_NormalsOut\r\n", outNormal, inNormal ) );      
      output = meta;
      return;
   }
   */

   output = meta;
}