Code: Select all
if( usesNormalMap )
{
TextureGpu *norma0lMapTex = datablock->getTexture( PBSM_NORMAL );
Code: Select all
if( usesNormalMap )
{
TextureGpu *norma0lMapTex = datablock->getTexture( PBSM_NORMAL );
Detailed normals maps without normal maps is supported by the math. See the shader code:
Code: Select all
/// If there is no normal map, the first iteration must
/// initialize pixelData.normal instead of try to merge with it.
@property( normal_map_tex )
@piece( detail_nm_op_sum )+=@end
@piece( detail_nm_op_mul )*=@end
@else
@piece( detail_nm_op_sum )=@end
@piece( detail_nm_op_mul )=@end
@end
Code: Select all
void HlmsPbs::calculateHashFor( Renderable *renderable, uint32 &outHash, uint32 &outCasterHash )
{
assert( dynamic_cast<HlmsPbsDatablock*>( renderable->getDatablock() ) );
HlmsPbsDatablock *datablock = static_cast<HlmsPbsDatablock*>( renderable->getDatablock() );
if( datablock->getDirtyFlags() & (DirtyTextures|DirtySamplers) )
{
//Delay hash generation for later, when we have the final (or temporary) descriptor sets.
outHash = 0;
outCasterHash = 0;
}
else
{
Hlms::calculateHashFor( renderable, outHash, outCasterHash );
}
datablock->loadAllTextures();
}