Here’s my first attempt at a decent water tool - with editor gizmos and all :). Should work with w/e you feel like making it (roads, etc.). Not sure if I did things the best way or not - but feel free to offer criticism and (better!) suggestions.
Only thing you edit in the editor right now after adding the component is the nodes along the blue spline in the middle. (Move/Rotate or Scale to affect width and depth)
First screenie is the designed river. Second and third include the generated mesh (during play in editor and game views) with a basic water material and script applied (I could have done pro but figure basic is what most ppl will use)
NEW
*Added ability to use a texture on a node which overrides the non-local texture.
*Meshes are now an easy way of selecting nodes (when in scene mode).
*Now mesh is only updated when gizmos are drawn OR updateMesh is called (if you want to kick off a custom update).
*A prefab is used for instantiation of nodes (RibbonTool prefab is used if none is dragged into the prefab spot in the script).
*Mesh detail controls how many triangle strips are in between each node, default is 1 - set at 5-10 to get smooth curves.
Licensing:
Free to use for anything and do whatever you want with it: I do ask for you to give me credit somewhere and let me know what it’s being used for… although neither one is strictly necessary
Todo:
Clean up some of the operations (would be nice to reduce some calcs/list ops)?
Check for nulls in more places (which would add support for deleting nodes)
Make adding/deleting nodes better (adding at a custom location/deleting at all)
Make frame that’s shown into a collider
Snap to terrain option
As far as more to-dos, my suggestion would be road intersections. They haven’t been figured out yet with the few road editors on the forum. That is a much needed feature.
It is and it isn’t hard to do intersections - right now on the generated mesh I’m giving it a straight-forward uv map. Easiest ways to do an intersection by my thoughts are:
1: use a shader/script on the mesh that applies edging to the mesh after it’s generated
2: generate a material and handle overlapping uv’s by applying an intersection texture to that part instead of the full road texture
3: let the user set portions where a different texture (or different transparency) should be applied
Nice thing is for railroad type thing as above you can just use a bump-mapped transparency shader to apply gravel and raised rails/slats - or you could have rails/slats and transparent on the rest so you see the ground below it.
Edit: I’ll post a sample of a railroad pic as soon as I fix up some of the UV mapping scaling.
Fixed uvs, added detail level. Posted a transparent bumped diffuse railroad pic - I’m no artist though :). Doesn’t work too well for the edges - not sure how to fix that. I’ll work on intersections and then see about posting some of the code - Right now my code is in one script and it uses two others (SplineInterpolator and TangentSolver).
How the code works or how the tool itself works? Just posted a link to a vid tutorial of setting up the basics.
Edit: Nm, reread your post :p. At some point I’ll write up a tut on how the parts work.