Exemple #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 );
}
Exemple #2
0
void DeferredBumpFeatHLSL::processVert(   Vector<ShaderComponent*> &componentList, 
                                          const MaterialFeatureData &fd )
{
   if( fd.features[MFT_PrePassConditioner] )
   {
      // There is an output conditioner active, so we need to supply a transform
      // to the pixel shader. 
      MultiLine *meta = new MultiLine;

      // We need the view to tangent space transform in the pixel shader.
      getOutViewToTangent( componentList, meta, fd );

      // Make sure there are texcoords
      if( !fd.features[MFT_Parallax] && !fd.features[MFT_DiffuseMap] )
      {
         const bool useTexAnim = fd.features[MFT_TexAnim];

         getOutTexCoord(   "texCoord", 
                           "float2", 
                           true, 
                           useTexAnim, 
                           meta, 
                           componentList );

         if ( fd.features.hasFeature( MFT_DetailNormalMap ) )
            addOutDetailTexCoord( componentList, 
                                  meta,
                                  useTexAnim );
      }

      output = meta;
   }
   else if (   fd.materialFeatures[MFT_NormalsOut] || 
               fd.features[MFT_ForwardShading] || 
            //start jc
               fd.features[MFT_IsObjectSpaceNormals] || 
            // end jc
               !fd.features[MFT_RTLighting] )
   {
      Parent::processVert( componentList, fd );
      return;
   }
   else
   {
      output = NULL;
   }
}