Я сначала попытался просто повысить или снизить координаты текстуры, но я получаю удивительные результаты.
для этой карты < /strong>
< /p>
Сторона процессора мои координаты текстуры вычисляются следующим образом:
// coefs - это просто барицентрические веса. < /p>
Код: Выделить всё
inline Math::Vec2 BaseMaterial::interpolateTexCoordinates(const Math::Vec2& t1, const Math::Vec2& t2, const Math::Vec2& t3, const Math::Vec3& coefs) const
{
Math::Vec2 texCoord = (t1 * coefs.x) + (t2 * coefs.y) + (t3 * coefs.z);
texCoord.s = std::abs(texCoord.s);
texCoord.t = std::abs(texCoord.t);
double dummy;
if (texCoord.s > 1.0f)
texCoord.s = (float)std::modf(texCoord.s, &dummy);
if (texCoord.t > 1.0f)
texCoord.t = (float)std::modf(texCoord.t, &dummy);
return texCoord;
}
< /code>
Здесь, как отображаются мои текстуры: < /p>
inline RGBFColor Image::getPixelFromRatio(const Math::Vec2& ratio) const
{
const uint32_t widthMinusOne = getWidth() - 1u;
const uint32_t heightMinusOne = getHeight() - 1u;
// Point sampling.
const Math::Vec2 C00 = Math::Vec2(ratio.x * (float)widthMinusOne, ratio.y * (float)heightMinusOne);
return getPixelFromPosition(Math::Uvec2((uint32_t)C00.x, (uint32_t)C00.y));
}
Я создаю свои пробоотборники при инициализации подписи корневой подписи. Тогда Шуд выглядит так: < /p>
Код: Выделить всё
CD3DX12_STATIC_SAMPLER_DESC wrapLinearSampler(0, D3D12_FILTER_MIN_MAG_MIP_LINEAR);
wrapLinearSampler.ShaderVisibility = D3D12_SHADER_VISIBILITY_PIXEL;
// Here initialize sampler to use repeat mode. How?
createRootSignature(rootParameters, _countof(rootParameters), &wrapLinearSampler, 1u);
Подробнее здесь: https://stackoverflow.com/questions/796 ... g-software
Мобильная версия