Jump to content

Is there a vegetation studio integration with gena spline?


Abdalla
Go to solution Solved by Abdalla,

Recommended Posts

Hi,

I am using vegetation studio pro and wanted to make roads. I tried R.A.M. because it has a built in feature with vegetation studio pro for creating biome mask, but R.A.M itself didn't work well with my requirements. Gena road system is great and works cool with my requirements, but there doesn't seem to be an extension that creates a biome mask for vegetation studio. Please correct me if there's one.

And which extension code should I start from when coding my own vegetation studio biome mask extension if I have to?

Thanks for advance.

Link to comment
Share on other sites

Hi @Manny

I am working on the extension right now and I figured a lot of things out, but the main problem now is that I am not sure how to parse the spline in a logical way that makes sense.

This is the spline.

spacer.png

It has 4 meshes and 2 intersections. Below are the 4 meshes.

spacer.png

I think the simplest approach would be to create 4 biome masks for each mesh. It should be relatively simple if I can sample each of those meshes independently.

However, going through Spline.Nodes is very random. For example 1 node is at the top right of the map (mesh 1), the next node is in mesh 3 or 4, so I can't reliably just go through nodes and create biome mask vertices depending on that.

GetSampleAtDistance go through the whole spline 1 generated mesh at a time, but I am not sure how to check if a sample is in which mesh. Ideally I would need a member variable in GeNaSample that has the index of the mesh.

I am not sure how Spline.GetSampleAtTime is working, so any help with that is appreciated.

 

Link to comment
Share on other sites

Also, the spline.GetTrees() method returns a Dictionary<int, List<GeNaCurve>>.

This returns a list of curves for each spline segment from intersection to intersection (or dead ends).

Link to comment
Share on other sites

4 hours ago, Manny said:

If I understand correctly, you're trying to create biome masks with your extension with Gena right?

Exactly that's what I was trying to do.

4 hours ago, Manny said:

If that's what you're looking for, you can actually get all of this as one texture by generating a 'TerrainEntity' which contains data from the spline using certain configurations.

Looks promising but what @Clyde pointed out seem to be more practical.

3 hours ago, Clyde said:

Also, the spline.GetTrees() method returns a Dictionary<int, List<GeNaCurve>>.

This returns a list of curves for each spline segment from intersection to intersection (or dead ends).

That's exactly what I was looking for. It parses each road independently so I can create a different biome mask for each road and can relatively easily place the mask's position in order.

foreach (var tree in Spline.GetTrees())
{
	//create a new biome mask per road
    var curves = tree.Value;
    for (int j = 0; j < curves.Count; j ++)
    {
        var curve = curves[j];
        float length = curve.Length;
        for (int k = 0; k < curve.Samples.Count; k++) {
			//create positions for the biome mask
		}
	}
}

Even though that road seem promising, I am not sure if I will continue to develop this because I hate getting caught up in subtasks and leaving the game itself. The map is not that complicated so I will just create the masks manually or use ram just to create the mask then delete it.

If someone come across this post, the code above seems to be promising, just make sure that k increments in some kind of resolution because the samples tend to be too much.

Edited by Abdalla
fixed a type in the code
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

×
×
  • Create New...