• A lathe tool
    27 replies, posted
After reading [url=https://facepunch.com/showthread.php?t=1557294]Anyone good with ceilings?[/url] and discussing precision problems in Hammer and the compile tools with GiGaBiTe, I wanted to try something... When generating a brush with a program, I have complete control over the vertices that make up the defining triangles of its sides. I thought if I could place those very carefully, I might end up with a kind of organic shape that doesn't corrupt a compile process. [url=https://twitter.com/Shrinker42/status/846790578272681984][img]https://pbs.twimg.com/media/C8BnciMXUAASYLX.jpg:orig[/img][/url] And that worked (longer snail with two added wall pieces): [url=https://twitter.com/Shrinker42/status/846795973892476928][img]https://pbs.twimg.com/media/C8BsCB3X0AUKuhJ.jpg[/img][/url] [url=https://twitter.com/Shrinker42/status/846795973892476928][img]https://pbs.twimg.com/media/C8BsbiXX0AEUl4L.jpg[/img][/url] The map had no leaks and I think if these brushes are moved around, their internal representation won't fall apart. So I'm trying to build a tool from here. My plan is that there is a (textual) format to define the flat contour of something to be lathed like this, and parameters like the varying radii and stuff. Then, and that is the most difficult part for me, I want to texture this thing seamlessly, i.e. have the floor follow the curve precisely without any discontinuities. It's possible with sheared texture projections and splitting up the quads into cake pieces. Maybe this could be useful to some later on - curved hallways to accompany their straight-angled peers. :) (The pictures are temporary Twitter cache hotlinks and will probably break sometime, but their Tweet links will continue to work) *edit: Last of this evening: [url=https://twitter.com/Shrinker42/status/846843044477505537][img]https://pbs.twimg.com/media/C8CXO5xWsAU64rz.jpg:orig[/img][/url]
Got the last shape computed without jagged edges by making triangle cuts which are also needed for seamless texturing. As seen here, this computation can guarantee that all vertices are on the grid... I am confident* that this can be compiled without problems, as a func_detail at least. [url=https://twitter.com/Shrinker42/status/847577717788864512][img]https://pbs.twimg.com/media/C8Mzby6XUAAvRbn.jpg:orig[/img][/url] (*I just hope it will work.) If this works out as planned, I must look at displacements too for this.
So this is an external tool that generates a .vmf file?
Yeah.
Ok so I finally understood the math in Source's texture alignment and it's pretty interesting. I can now go from my projected UV spanning vectors to the parameters Source dotproducts with vertices to get texture lookup coordinates. [url=https://twitter.com/Shrinker42/status/849392939667206145][img]https://pbs.twimg.com/media/C8mmC1aW0AEuYQ0.jpg:orig[/img][/url]
[QUOTE=Shrinker42;52059725]Ok so I finally understood the math in Source's texture alignment and it's pretty interesting. I can now go from my projected UV spanning vectors to the parameters Source dotproducts with vertices to get texture lookup coordinates. [url=https://twitter.com/Shrinker42/status/849392939667206145][img]https://pbs.twimg.com/media/C8mmC1aW0AEuYQ0.jpg:orig[/img][/url][/QUOTE] Wow! Did your tool do that or is it manually aligned ?
That test scene was created fully by the program to adjust the texture math.
Awesome work, I'm creating a highway map and this will make my life easier for sure! Keep up!
Makes me feel bad for telling that guy he was using the wrong engine to build his roof. If you actually succeed with this tool this could be a massive step in the right direction for source games. I do have a question though: Can you solve the problem with applying clipping brushes on spiral staircases? EDIT: Example of this - [url]https://youtu.be/d5B9ytF6gas?t=4m30s[/url]
A smooth spiral staircase wouldn't be possible to represent in Hammer because of the limitations of the VMF format. Due to the way that brushes are represented, no face on a brush can be coplanar (ie. brush faces cannot have more than one plane.) Even assuming you could hack something together, collision detection would be pretty bad on the inside part of the staircase since the slope approaches 90 degrees straight up nearly instantly. Players stop being able to walk on brushes above 45 degrees and would just slip down the stairs, or off to the sides where the angles aren't as steep. The debate on spiral staircases is nothing new, I remember back in the heyday of Half-Life where multi-page forum threads were started on how to solve the problem of the spiral staircase and it was deemed impossible with how the engine worked.
What about an invisible displacement? [URL=https://developer.valvesoftware.com/wiki/Twister]twister[/URL] can generate a pretty good result.
Stairs and clip brushes for them could be another application in future that should work well when the inner radius isn't too small. I'll keep that feature request in mind.
My head hurts... so much math this weekend. Got one side done. This could also be a wall inside of a corridor. [url=https://twitter.com/Shrinker42/status/851188909186928641][img]https://pbs.twimg.com/media/C9AHuhgXgAAMay2.jpg:orig[/img][/url]
Sooo... this following texture alignment is why I've started developing this tool in the first place: [url=https://twitter.com/Shrinker42/status/851537484722917378][img]https://pbs.twimg.com/media/C9FElZjXcAA4lWX.jpg:orig[/img][/url] Once I've figured out the rest, I'll have to find a (graphic) way to explain how to set this up.
[QUOTE=Shrinker42;52085958] Once I've figured out the rest, I'll have to find a (graphic) way to explain how to set this up.[/QUOTE] If you need any help on user interfaces or something related let me know!
It's pretty much done now. :) [url=https://twitter.com/Shrinker42/status/852899623219990528][img]https://pbs.twimg.com/media/C9YbqaYXgAEaMeq.jpg:orig[/img][/url] [url=https://twitter.com/Shrinker42/status/852901701124337664][img]https://pbs.twimg.com/media/C9Ydi1zXcAI-whv.jpg:orig[/img][/url] [url=https://twitter.com/Shrinker42/status/852901796670517249][img]https://pbs.twimg.com/media/C9YdotLXoAI1WYW.jpg:orig[/img][/url] [url=https://twitter.com/Shrinker42/status/852902396355334147][img]https://pbs.twimg.com/media/C9YeI_gWsAE-Sn2.jpg:orig[/img][/url] [url=https://twitter.com/Shrinker42/status/852904033836834816][img]https://pbs.twimg.com/media/C9YfrkJW0AMUAo_.jpg:orig[/img][/url]
But... displacement can do the same thing with less brushes (9 brushes on my pic) [t]https://pp.userapi.com/c836134/v836134814/3630d/vFYa7sVFTaI.jpg[/t]
I'm not discounting what you can do with displacements, it's just not what I've developed so far. There may be situations where you need brushes, e.g. when targeting Half-Life 1 or when you need this in a brush model or entity setup that's incompatible with them. :)
Oh my god. Please, when you're done, release this. It's all so goddamn curvy, and I must have it.
I said it was pretty much done now... but then I've added extrusion along cubic splines. :) [url=https://twitter.com/Shrinker42/status/853380917271949316][img]https://pbs.twimg.com/media/C9fRaHtXUAIHxDb.jpg:orig[/img][/url] [url=https://twitter.com/Shrinker42/status/853398339202813953][img]https://pbs.twimg.com/media/C9fhPJvXoAAaz02.jpg:orig[/img][/url] [url=https://twitter.com/Shrinker42/status/853398604513501185][img]https://pbs.twimg.com/media/C9fhe7OWAAASUtL.jpg:orig[/img][/url]
Oh god, i love it! Please continue with your work.
My development resources are very limited, so this ends up being a command-line tool for the time being. There is a solid concept behind it and a user gets to edit stuff in well-structured config files. Because the process of starting a command-line tool alone can already be a challenge for an uninitiated user, and working with coordinates and the like in text form is difficult, I will accompany this tool with a proper textual guide explaining all the concepts and every little setting so that hopefully a (patient) user without prior knowledge can use it too. It'll be available when I'm done writing that guide.
I think you should see if you could get such a feature incorporated into the Not-GMod2 editor thread.
Shrinker let me test the tool, I must say it's really useful and powerful, a lit bit confusing at first but once you got the hand of it, it can go really far. I made this acess ramp, imposible to do precisely with displacements or vertex editor (manual would take forever) [t]http://i.imgur.com/vkelgiv.png[/t] The texture is aligned perfectly, but there're some bugs, if you invert/rotate the brushes, the 'Uvs' get all messy. And here's part of the text/config that makes this possible: [t]http://i.imgur.com/Pgtvnnb.png[/t] Really useful! Thanks Shrinker!
[QUOTE=Shrinker42;52104757]There may be situations where you need brushes, e.g. when targeting Half-Life 1[/QUOTE] The Goldsrc engine doesn't have the brush corruption issues that source does because brushes are stored differently in a binary format with far more decimal precision.
Any further developments on this?
After walking a few people through it, I've figured the acceptance would be too little for what is at the moment a text only tool. But after realizing that I can now tackle more difficult topics using Haskell, I've decided to migrate completely to it. My big goal now is to port Microbrush from C++/C#/OpenGL to Haskell/Vulkan.
Update: I'm still working on this. What the lathe tool did, and more, should be available sometime in a handy programming system for procedural stuff. I've cut back on my job hours so I could put more time into this. I'm convinced it'll be great.
Sorry, you need to Log In to post a reply to this thread.