Add tangent generation to stride dynamic mesh

If you use a material with normal mapping (AKA bump mapping) the mesh needs to have tangent data otherwise it will be black.

As reported here .

Stride has a built in tangent calculation, which it uses on primitive meshes.

Feature request is to add the same calculation as an option on DynamicMesh nodes
It’s not too complex, code looks like this

AddTangentToDynamicMesh.zip (3.5 MB)

Here’s a working patch demonstraton. Its a modification of the ‘dynamic model from noise’ helppatch with UV coordinates and the tangent fix.
Note that it references directly Stride.Graphics.dll
Includes textures for a test material for normal mapping

If it’s working it should look like this
BumpMappedNoiseMesh

Texture source https://freepbr.com/materials/orbed-plastic/

4 Likes

Yes, very good point. I’ve already added a few things regarding tangents for a project in this branch: GitHub - studiobruell/VL.StandardLibs at feature-merge-compiled

2 Likes

Nice, hope to see it in the StandardLib soon.

In case any future VL.PolyTools user stumbles across this thread in future I added a hidden ‘Calculate Tangents’ option to the PolygonPlane and PolygonExtrude nodes. And new helppatches about the entire topic of texturing these 3D poly things.

2 Likes