x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Question regarding performance and texturing of generated hex-field-terrain

Hello there,

I am currently working on a HexGrid based Terrain system, for a civlization type game. Instead of using a separate mesh for each hex, I tried to precdurally generate each hex separatly and combine it into one single mesh, using my own Component in C++. For starters, I have generated a simple square grid, where each square is extruded separatly, to sort of simulate what happens when I generate the terrain for my game. I am currently testing stuff with a 512x512 grid, and even though it takes a few seconds to intially build the mesh, it runs sort of smooth. However, I allready am getting some performance concerns and wonder what I could do to improve performance.

I thought about splitting the mesh up into separate smaller meshes, which each reside in their own component. I wonder if this will improve performance, when only a small porting of the overall grid is displayed. I am very new to this topic, so any tip regarding perfomance optimization of any sort would be highly appreciated.

Also I wonder how I would approach texturing the grid. Currently I am using a plain white Material, however, for my game I need to texture each hex individually. I thought that layered materials might be the way to go, but for this i sort of need to generate a map, that tells my material which texture to put where on the mesh. How can I generate such a texture map out of my existing grid data, so I can use it to feed a texture parameter on a metrial instance to texture my mesh?

Any hints would be highly appreciated.

Thank you very much

Product Version: Not Selected
Tags:
more ▼

asked Nov 11 '14 at 01:34 PM in Rendering

avatar image

Brainshack
103 20 26 48

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Hey Brainshack -

Without knowing the exact look you are going for there are some generic suggestions I can give you. The Engine renders items in batches based on shared shaders (materials). So you would definitely want to make use of a Master Material setup with Instances of the Material used for variation. Also keep in mind you will want to setup a LOD (Level of Detail) system which is probably the one performance boosting mechanism that many people do not do. This will mean looking at reducing vertex counts in the distance but also looking at ways to remove unnecessary detail from materials at a distance. We have many materials in Starter Content with this Camera Distance LOD setup in place.

Ultimately I think it be beneficial to give yourself a series of hex units already completely textures which are also tileable with each other and have your hex grid calculations pull instances of those units and apply them to your world. Assuming that you are using instances and a master material setup you should get reasonable performance.

Hopefully this gives you a start -

Eric Ketchum

more ▼

answered Nov 26 '14 at 05:13 PM

avatar image

Lovecraft_K ♦♦ STAFF
36.8k 702 256 733

avatar image Brainshack Dec 01 '14 at 02:32 PM

Hi Ash,

thanks for the tipps. I started looking into instanced mesh, and the results so far seem promising. I wonder if there is a way to assign a material per instance, or do I have to have an instanced mesh instance for each mesh with each individual material?

avatar image Lovecraft_K ♦♦ STAFF Dec 01 '14 at 09:12 PM

Hey -

You would need to do a new grouping of instances for each new material. I would even go so far as to do a series of parented blueprints with each instance its own blueprint actor that is then spawned from a parent blueprint.

Pika Pika

Eric Ketchum

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question