_dahu_ Posted May 25, 2022 Share Posted May 25, 2022 (edited) These components let your create a road and also carve the terrain under it like in Unreal or Unity. spline_tool.zip 1. Import the road tool constructor into your project. 2. Attach BuildRoad.cs to your camera. 3. Press play.0 4. You should see a red dot on your terrain, if not that's mean the ray don't collide with the terrain ( check terrain intersection ). 5. Create your road by clicking on the terrain, F to preview to road, R to delete last point, once you finished the road press G to save it. 6. Close the window, now in the editor, create a new splinegraph, and place it at 0.0.0 position, select the spline you just saved, you can press edit to see it ( there is a view distance limit so you might not see it ) 7. Now it's time to carve the terrain, but it will only work for normalized terrain, and I don't think the normalized button will actually normalize the terrain, so the terrain should be normalized before the import in Unigine. For example, in Gaea, you can export your terrain with normalized option. 8. Create a mesh that will guide the terrain carving: Create a 32x20 plane, intersection should be enabled by default, change intersection mask from 0 to 1, place the node at 0.0.0 position, then drag and drop this mesh into the asset browser to create a .node. 9. Add this node as segment to the WorldSplineGraph ( click and drag the mouse to select all segments at once, push the edit spline button to see segment option ). 9.1 To actually see the road you have to add the LoadGraph.cs component to WorldSplineGraph and press play. WorldSplineGraph sometime take time to load... 9.2 If you still don't see any road your node wasn't positioned at 0.0.0. 10. Deactivate BuildRoad.cs component on your camera, and add CarveTerrain.cs to the WorldSplineGraph. 11. Configure the component, I like to have a resolution of 2k for a 10k terrain, it mean 2k*2k ray will be performed. 11.1 I like to move the SplineGraph down like 1m to have a better carving of the terrain ( position of the splinegraph = 0.0.-1). 12. Now click play and press F to start the process. 13. Close the windows, Create a new terrain with the exact same size and the same height scale ( the created lmap doesn't work yet ). Add the newHeight and the newMask to the terrain. 14. Now you can add your the road node. 15. It look bad ! Yes, because I can only create 8 bit image for terrain heightmap. If you know how to create a 16 bit pixel please help me and the terrain will fit the road perfectly. This is the end, next images won't delete. Edited May 25, 2022 by _dahu_ 4 Link to comment
Recommended Posts