Short version, importing a 16bit png with a min alt of -120.269997 and max of 251.649994 and it gives me a terrain that looks like it's using flat shading.
I used L3DT 12.0 Pro to create my terrain and export it as a mesh. I then used XSI to optimize the mesh and I put some simple splatting on it. The mesh was also modified to fit gameplay and missions. So it no longer mirrors the original mesh from L3DT. I did several mission using this method and the game has been released, all was fine. I mention this because I have now decided to do chunked LOD. So I wrote a tool that did a raycast along a regular grid (2049x2049) to generate the heightmap. All was fine and the people rejoiced. CLOD is working in the game. Now I want to import the heightmap into L3DT to generate new splat info and lighting as it does a great job.
I have imported the heightmap, changed the horizontal scale to 1m and set the vertical range Min. alt -120.27 and Max .alt 251.65. Heightfield image looks correct. It actually looks very close to the original one made by L3DT as the geometry didn't change that much. In fact if I export the original heightmap from L3DT and added it as a layer to Photoshop using difference mode and it's pretty much black. I tried to resize it to 2048 with no luck. Also tried to do a merge using replace.
I have a pretty height degree of confidence that the heightmap isn't the issue. Below is a rough idea as how I encode the heightmap.
- Code: Select all
float fRangeZ = fMaxZ - fMinZ;
float fScaleZ = 65535.0f / fRangeZ;
float fPixel = (fHeight - fMinZ) * fScaleZ;