Terrain blocks not working

Your forum for all discussions around Modding.
bgehres
Posts: 3
Joined: Mon Dec 31, 2018 1:24 am

Terrain blocks not working

Post by bgehres »

After updating to version 1.10 the terrain on my map now displays these blocks. It also looks this way in the editor version 9.0.4. Everything was fine in version 1.9 and editor 9.0.3. Any idea what's causing this?

Image
Eische
Posts: 3806
Joined: Thu Oct 18, 2018 5:17 pm

Re: Terrain blocks not working

Post by Eische »

Your map is using its own terrain shader. This needs to be updated.
Did you add more terrain angles to your map? If not, you can simply reference to the default terrainshader.xml of the base game.

If you are using a modified terrainshader.xml, you need to open it and search for this block:

Code: Select all

float2 getPatchCoords(VS_INPUT In, ObjectParameters& object)
{
    float4 instanceData = object.terrainInstanceData;
    float2 pos = In.position.xy;
    uint deltaRaw = floatBitsToUint(instanceData.z);
    uint4 deltas = unpackUint4x8(deltaRaw);
    if (pos.x == 0) {
        uint levelDelta = deltas.x;
        pos.y = float(((int)pos.y >> levelDelta) << levelDelta);
    } else if (pos.x >= object.terrainPatchOffset.x-1) {
        uint levelDelta = deltas.y;
        pos.y = float(((int)pos.y >> levelDelta) << levelDelta);
    } else if (pos.y == 0) {
        uint levelDelta = deltas.z;
        pos.x = float(((int)pos.x >> levelDelta) << levelDelta);
    } else if (pos.y >= object.terrainPatchOffset.x-1) {
        uint levelDelta = deltas.w;
        pos.x = float(((int)pos.x >> levelDelta) << levelDelta);
    }
	pos *= instanceData.w;
    return pos + instanceData.xy;
The second last line pos *= instanceData.w; needs to be added. Save the file, open your map in GE and save it right away.
It should be fine in game and GE now.
Playing on PC - Win10
Ryzen 3600
RX 5500XT
16GB Ram
How to post log file
How to upload pictures
Please report bugs for FS22 using the bugtracker
Post Reply