you are viewing a single comment's thread
view the rest of the comments
[–] [S] 1 point 2 weeks ago (1 child)

Hey!

Thank you for sharing your project details with us. I like it. If you make this available to the public, please share it with us. I do have a question though, how fast is it rendering an image (for example the desk fan)?

It doesn’t yet support textures, normals, normal maps, armatures, morph targets, animations, etc but all of that is planned to happen at some point. This. I'm hyped to see this!

I'm impressed tbh, and 100% a future user of your software. You wouldn't believe me if I tell you this but a couple of weeks ago I had a similar idea but I never worked on it. There must be a reason why I crossed your path (and vice versa). I tried to create a CGI video project, and I thought it would be way faster and easier to create it with code than manually creating it

Out of curiosity, what is your personal opinion on Blender?

  • source
  • parent
  • hideshow 2 child comments
  • [–] 3 points 2 weeks ago

    I do have a question though, how fast is it rendering an image (for example the desk fan)?

    Great question!

    First off, keep in mind this is interpreted and I haven't really had performance that front-and-centered in my mind so far. As I mentioned, I intend to implement transpilation to Go, and I expect way better performance when that's an option. (I do want to keep the interpreter, though, just because I don't want the Go runtime to be a hard dependency for users.)

    Second, when I first saw your response, I happened to be on a Raspberry Pi 4 (8GB model), so I figured why not test out performance there.

    Oh, and one other thing. The images I've been posting are screenshots of an OpenGL 3d viewer built into the program. If you call util.Display(...) from the DSL it pops up a window with the model you passed to it displayed in it and you can rotate it, zoom in or out, turn on edge highlighting ("wireframe"-like) and such.

    So, I did a quick, completely unscientific benchmark. For this benchmark, I edited the desk fan script in a couple of ways. First, I removed the command that displays the fan. (That display command hangs the program until exit it, so if I benchmarked that, it'd only really be benchmarking my reflex speed -- how fast I could close the viewer.) Second, just to give you an idea of how big/detailed/complex the model was, I printed the number of vertices. This test also doesn't try to save the model to a file or anything, but does fully generate the geometry in memory. Here's the result, again on a Raspberry Pi 4:

    $ time ./modelgen run examples/deskfan/deskfan.mg
    1343
    
    real    0m0.880s
    user    0m0.260s
    sys     0m0.051s
    

    That script was written with a "smoothness factor" parameter. Higher produces a model with more faces (a "smoother" model, if you will) and lower produces a model with fewer. The above test was with a smoothness of 1.0. I tried with 8.0 and here are the results:

    $ time ./modelgen run examples/deskfan/deskfan.mg
    70031
    
    real    0m2.941s
    user    0m3.318s
    sys     0m0.185s
    

    So, more than 50x the number of vertices, about 3.3x the amount of time required.

    Oh, and in case you're curious, here's what the 8.0-smoothness desk fan looks like:

    Smoother desk fan model.

    Here are the same two tests on my much beefier desktop system with a 3.4GHZ AMD Ryzen 3 1300X Quad-Core Processor.

    $ time ./modelgen run examples/deskfan/deskfan.mg
    1343
    
    real    0m0.203s
    user    0m0.091s
    sys     0m0.009s
    

    And with smoothness factor of 8.0:

    $ time ./modelgen run examples/deskfan/deskfan.mg
    70031
    
    real    0m0.810s
    user    0m0.915s
    sys     0m0.045s
    

    So, there you go. That's roughly the performance one could expect. At least until Go transpilation is completed.

    Out of curiosity, what is your personal opinion on Blender?

    My experience with Blender is just that I find it super frustrating. (And that likely says a lot more about me than about Blender, and totally no shade on Blender fans. A lot of what people do with Blender is extremely impressive.) Every time I have occasion to use it, I learn enough to do whatever I'm trying to do, but I definitely don't like it, and that kind of information just doesn't stick in my brain. ("Press such-and-such key and then such-and-such key and select such-and-such from the menu and then drag this there... etc" just slips out. Anything I've done in code, I can refer back to easily. I suppose I could make a video for my future self every time I learn how to do some particular thing in Blender, but with code, you get the ability to just see how you did something later for free.)

    Plus it feels inefficient to tweak models after the fact. If I decide I wish I'd done some step 5 steps ago differently, it can be very difficult to make that change in a precise, perfect sort of way. What do you do, undo 5 times, do the step you wanted to do differently, and then re apply the other 4 steps? Can you reapply the other 4 steps on top of an altered fifth-back step? For right-brained artist types (respect!), I suspect such a thing mostly doesn't matter. They'd tweak until it looked right, and the route they took to get there wouldn't really bother them any. They're not going for perfection. Perfection (or at least the... perhaps imperceptible, high-effort-low-payoff sort of mathematical precision I'm talking about) may be antithetical to their process and methods. But my brain very much rebels against any attempts to force it into the proper shape to be ok with that.

    I do quite a lot of work in OpenSCAD. (I've got a 3d printing addiction and most of what I print is stuff I design myself in OpenSCAD.) I don't intend for my DSL to change that. OpenSCAD is great for what OpenSCAD is great at, and what I'm building is for something different. OpenSCAD fits my brain very well, and was definitely a big source of inspiration for my DSL.

    Also, I should definitely admit I haven't used Blender very much. I've made a few rudimentary models. (Like... two or so?) I fixed up a model once for 3d printing. But that's about it. I haven't even gotten into texturing or rigging or anything in Blender.

  • source
  • parent