This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Random notes/code snippets for using the Realtime Mesh Component plugin for Unreal Engine. | |
I could not find many working examples for this. May create a repo for this later. | |
/////////////////////////////////////////////////////////////////////////////////////////////// | |
// Code for Normal and Tangent calculation to make stuff less flat since it's just a flat plane with a height map projected | |
FVector3f left = x > 0 ? VertexPositions[(y * TerrainGeneratorParameters.TerrainSizeVertices) + (x - 1)] : VertexPositions[i]; | |
FVector3f right = x < TerrainGeneratorParameters.TerrainSizeVertices - 1 ? VertexPositions[(y * TerrainGeneratorParameters.TerrainSizeVertices) + (x + 1)] : VertexPositions[i]; | |
FVector3f bottom = y > 0 ? VertexPositions[((y - 1) * TerrainGeneratorParameters.TerrainSizeVertices) + x] : VertexPositions[i]; |