Jump to content
Casseburne

Applying textures to a polyline/spline

Recommended Posts

Hello,
I would like to know if there was a solution to apply a texture to a polyline/spline, that would make the work easier

Share this post


Link to post
Share on other sites
Posted (edited)

I cannot think of a way to do it dynamically. Afterwards, however, (after you've made your trails) I believe you can click "Export Geographic data" at the top toolbar. Export it as an SVG (scalable vector graphics) file. Then take that New file into Inkscape/Photoshop/etc... (hopefully) and add a thick pink stroke to all your trail vectors on black background. Have the editor export the SVG as .png raster format. Back in World Editor click the Terrain Tool and in the Paint tab, import the .png as a mask which should follow the contours of your trails and walking paths. To the mask apply the material of your desires.

Edited by JU5TlN

Share this post


Link to post
Share on other sites

Yes it's a bypass but it's more a waste of time I think

Share this post


Link to post
Share on other sites

It works well, and is much faster than painting all my walking paths, trails and rivers by hand. As a test I got it to work with my river system. I discovered you must make sure that you have the ["river"/"trail"/"walking path"] splines selected before you export your SVG, otherwise the World Editor will generate an empty SVG file containing no vectors.

Share this post


Link to post
Share on other sites

Here is something I was able to achieve by exporting the forested areas of my map as SVG and importing them as a surface mask. No hand painting required 👍. Couple caveats are the hard-and-fast 5 texture limit on your individual blocks and the generated SVG will be flipped vertically so flip the .png vertically (back to normal) before importing it into World Editor.

 

H8HKXzj.png

  • Like 1

Share this post


Link to post
Share on other sites

I can't offer a YouTube tutorial. I can attempt to explain. Essentially what is needed is a Black & White PNG-8 of the mask of your desires.

 

I use Inkscape and Photoshop CS to achieve this; neither of which I am proficient enough to teach about in a video.

 

In World Editor, highlight all the vectors of one type (Dirt road type for example). Export as SVG (in the top toolbar). Open the vectors using Inkscape.

 

In Inkscape one must take all paths group them. Then to that group apply a white stroke of, say, 5 pixels. Click File>Export as .png. Click the Page tab. Ensure it's the entire resolution of your original (1024 × 1024 or whatever). Click Export to create a new .png file. Open the .png file in Photoshop.

 

In Photoshop you should see a white mask with a transparent checkered background. Add a new Layer. Click Layer>Fill. Fill with black. Drag it to the bottom of the Layer stack. You now should have a black square with a white mask you desire.

 

crv9QeQ.png

 

Click File>Export for Web. Export as Black and White in PNG-8 format. No transparency.

 

Ensure it is the correct orientation. If it is not correct, flip it so that it is. Name it after one of your materials (Pebbles_01.png).

 

In World Editor click the Terrain Tool then click the Paint tab and at the bottom choose a directory. Click Export.

 

In Windows Explorer (WinKey + E) navigate into this export directory. There should be .png files with names of all materials on your map. Write over the appropriate .png with the one you made in Photoshop.

 

Back in World Editor>Terrain Tool>Paint click "Import" and it will re-import the mask your new changes.

 

Then you may replace the material at your leisure.

  • Like 2

Share this post


Link to post
Share on other sites

Here is an example showing different stroke widths effect in game. Sidewalks and trails are set at 4 wide and stroked at 4px, dirt roads are default width and stroked at 9px, Regular roads are 10px wide stroke and the River spline is stroked at 11px.

 

The dirt trail on the lower-right is set to 4-wide road with a 9px stroke.

 

e8xio8i.png

 

3qbt0ZP.png

 

  • Like 1

Share this post


Link to post
Share on other sites

I can't export to please, how do you do it?
I wasn't asking for a YouTube tutorial ahah ^^ no just a step by step tutorial with screenshots, it helps to keep track

Share this post


Link to post
Share on other sites

The file will be called "export.svg" and it will be in your Arma Reforger profile directory. I hope you've been grouping your road types into different layers because it's going to make it a lot easier. In your hierarchy make sure you have selected the vector entities you wish to export. You can right click on the layer and hit "Select all entities". Then in the top toolbar there is a button that says "Export Geographic data". In the dropdown, select SVG. Click Export. Again, it will be in your My Documents\My Games\ArmaReforger\profile folder.

Share this post


Link to post
Share on other sites

@JU5TlN

It works very well, indeed with polylines you have to rotate the mirror vertically, but with roads there is no need to change the width, the svg format takes into account the difference between an asphalt road and a dirt road

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×