Basic Terrain

If you are interested, I have just added some basic terrain code and shader to my repo. It generates it’s own splat map basses on a given seed.




Might change it later so you can paint the splat map and even the (terrain) height map too.

Oh and the height maps were generated using terrain.party

Hope you find it useful.

4 Likes

Not much time right now, just did a quick try and could not start all projects. I tried the postprocessing project and I got an error:

The terrain samples are working fine, good work :slight_smile:

Ahh OK ill have a look, looks like a missing asset :confused:

Sorry, ill sort it as soon as I can :slight_smile:

Can you tell me what the value is for modelName there, it all seems to be working fine for me here :confused: Odd that it can’t find the content type reader :frowning:

It’s fine, thank you for providing examples for the community :slight_smile:

1 Like

Oh, OK, you have it working now then?

No I meant its fine that there are still some things to improve.

Maybe I can check later or tomorrow but no guarantee for that, not so much time. Maybe somebody else can check the solution in the meantime? I am on mobile right now, not at home…

Others have cloned and ran it. I may have broke it on last update I guess…

modelName is Models/bunny

Ok, well looking at the repo, it’s there, can you look at how it’s set up in the content pipeline?

Thanks for this by the way :slight_smile:

This may have todo something with my installation or system settings, I don’t have another machine to check on. I can open the pipeline tool and click on build rebuild or anything but nothing happens. I thought everything was working, so I uninstaled all previous installations of Visual Studio and I only have Visual Studio 2019 Community right now.

I found this thread here: MonoGame Content Pipeline Tool Doesn't Build XNBs

and I have the same symptoms and the same issue I think…

I changed the preffered language in my system settings and tried again and then when I click on rebuild in the pipeline tool I get an “Choose Just-In-Time Debugger” window. If I cancel it or choose Visual Studio as a debugger and click “continue execution” after that in the new instance of Visual Studio the content gets build.

I use community too. This is not an issue with VS I dont think. Open the content manager and see how bunny.obj is set up.



I checked and I do get XNB files produced by the pipeline tool here:
\Randomchaos-MonoGame-Samples-master\Sandboxs\RandomchaosMGPostProcessingSandBox\Content\bin\Windows\Models\bunny.xnb etc.

So I think there is something wrong with my mono game setup and maybe the model loading fails for another reason. Don’t know if it is helpful what I provided here because maybe it isn’t related.

Yea, I am not sure how I can help with that.

If the other model’s render OK, you could swap the bunny model for cube, and see if you can then run it?

Sorry I can’t be of more help…

I commented out the “bunny code” and it runs fine after that.

// Game1.cs in PostProcessingSandBox Line 91 and following:
...
            skyBox = new BaseSkyBox(this, "Textures/SkyBox/NebulaBlue");
            Components.Add(skyBox);

            //bunny = new Base3DObject(this, "Models/bunny");
            //bunny.NoTangentData = true;
            //bunny.NoTexCoords = true;
            //bunny.Position = new Vector3(2, -1.5f, -20);
            //bunny.LightPosition = LightPosition;
            //Components.Add(bunny);

            cube = new Base3DObject(this, "Models/cube");
            cube.Position = new Vector3(0, 0, -10);
            cube.ColorAsset = "Textures/h2mcpCube";
            cube.BumpAsset = "Textures/h2mcpCubeNormal";
            cube.LightPosition = LightPosition;
            Components.Add(cube);

            //bunnies = new Base3DObject[10];
            //for (int s = 0; s < 10; s++)
            //{
            //    bunnies[s] = new Base3DObject(this, "Models/Bunny");
            //    bunnies[s].Position = new Vector3(20 + (s * 12), -1.5f, -10 - (s * 12));
            //    bunnies[s].ColorAsset = "Textures/WindmillTopColor";
            //    bunnies[s].BumpAsset = "Textures/WindmillTopNormal";
            //    bunnies[s].LightPosition = LightPosition;
            //    Components.Add(bunnies[s]);
            //}

            landShark = new Base3DObject(this, "Models/landShark");
            landShark.Position = new Vector3(-20, 0, -10);
...

I found the solution:

Change the Importer of the bunny.obj to Fbx Importer:

This also applies to the RayPicking sample!

I remember I had this issue before with an *.x model, I should have remembered earlier :sweat_smile:

I guess the thing with the pipeline tool is either something on my machine that is not setup correctly or something that is not yet fixed.

Ahh glad you sorted it, but that’s odd, as that importer works fine for me, maybe we are on different versions of MonoGame?

I downloaded the installer and reinstalled yesterday, so that is version 3.7.1.189 for me.

I think that’s the same version I am using, how odd…