By default samplers in 2.1 are set to CLAMP, whereas here you likely want it to set to WRAP.
In JSON materials you can set them by simply setting the samplers to wrap:
Code: Select all
"sampler_name" :
{
"min" : "linear",
"mag" : "linear",
"mip" : "linear",
"u" : "wrap",
"v" : "wrap",
"w" : "wrap",
"miplodbias" : 0,
"max_anisotropic" : 1,
"compare_function" : "disabled",
"border" : [1, 1, 1, 1],
"min_lod" : -3.40282347E+38,
"max_lod" : 3.40282347E+38
}
See that both u,v,w were set to "wrap"
If you're not using JSON materials, the old material system won't let you modify the samplers via script, so you would have to do it via C++. The PbsMaterials sample is actually doing that:
Code: Select all
//Change the addressing mode of the roughness map to wrap via code.
//Detail maps default to wrap, but the rest to clamp.
assert( dynamic_cast<Ogre::HlmsPbsDatablock*>( item->getSubItem(0)->getDatablock() ) );
Ogre::HlmsPbsDatablock *datablock = static_cast<Ogre::HlmsPbsDatablock*>( item->getSubItem(0)->getDatablock() );
//Make a hard copy of the sampler block
Ogre::HlmsSamplerblock samplerblock( *datablock->getSamplerblock( Ogre::PBSM_ROUGHNESS ) );
samplerblock.mU = Ogre::TAM_WRAP;
samplerblock.mV = Ogre::TAM_WRAP;
samplerblock.mW = Ogre::TAM_WRAP;
//Set the new samplerblock. The Hlms system will
//automatically create the API block if necessary
datablock->setSamplerblock( Ogre::PBSM_ROUGHNESS, samplerblock );
In this case it's changing the roughness map's sampler to wrap.
Cheers
Matías