1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-09 03:39:14 +00:00

Add more comments to handleBSGeometry

This commit is contained in:
Alexei Kotov 2023-10-02 21:12:08 +03:00
parent 1da9038b35
commit 79e6c9a92a

View File

@ -1574,7 +1574,11 @@ namespace NifOsg
osg::ref_ptr<osg::Drawable> drawable = geometry;
// Some input geometry may not be used as is so it needs to be converted.
// Normals, tangents and bitangents use a special normal map-like format not equivalent to snorm8 or unorm8
auto normbyteToFloat = [](uint8_t value) { return value / 255.f * 2.f - 1.f; };
// Vertices and UV sets may be half-precision.
// OSG doesn't have a way to pass half-precision data at the moment.
auto halfToFloat = [](uint16_t value) {
uint32_t bits = static_cast<uint32_t>(value & 0x8000) << 16;
@ -1641,6 +1645,8 @@ namespace NifOsg
geometry->setTexCoordArray(
0, new osg::Vec2Array(uvlist.size(), uvlist.data()), osg::Array::BIND_PER_VERTEX);
// This is the skinning data Fallout 4 provides
// TODO: support Skyrim SE skinning data
if (!bsTriShape->mSkin.empty() && bsTriShape->mSkin->recType == Nif::RC_BSSkinInstance
&& bsTriShape->mVertDesc.mFlags & Nif::BSVertexDesc::VertexAttribute::Skinned)
{