Home Coding, Scripting, Shaders

Tech Artist - What are you working on: FOREVER Edition!

Replies

  • onionhead_o
    Offline / Send Message
    onionhead_o polycounter lvl 12
    Puncture Hole Script

    I had to do a lot of manual Hole punching on spaceships so. I got Lazy and decided to make a script to automate the process. Just wish I had the time to build this tool when I actually needed it. Not the most realistic, but Its a good base to start.




  • malcolm
    Online / Send Message
    malcolm Polycount Sponsor
    Wow, that's interesting. Would you be willing to share what's going on under the hood conceptually. I see you're doing an extrude, but how are you randomly deleting faces and getting the smaller jaggy edges.
  • onionhead_o
    Offline / Send Message
    onionhead_o polycounter lvl 12
    Its not actually randomly deleting faces its just deleting the original faces that was selected at the end after most of the operation is done, the jaggy edges come from the Random attribute of the transform Components.
  • malcolm
    Online / Send Message
    malcolm Polycount Sponsor
    Oh cool, that makes sense.
  • PolyHertz
    Offline / Send Message
    PolyHertz ngon master
    Posted to Gumroad my old vert-to-quad script (F2MAX), as well as a new script that connects selected verts to all others on their selected face (FanConnect).




  • PolyHertz
    Offline / Send Message
    PolyHertz ngon master
    Made a simple script for moving selected objects into a grid layout:

    https://www.dropbox.com/s/p2px8v4yxqiidv8/spaceSelObjs.ms



    EDIT: Also made this script today which selects all faces in a Unwrap_UVW that have no area in UV space (for fixing meshs with bad UVs): https://www.dropbox.com/s/rimir0n2ivg734s/selZeroAreaUVFaces.ms
  • malcolm
    Online / Send Message
    malcolm Polycount Sponsor
    That looks fun.
  • Klunk
    Offline / Send Message
    Klunk greentooth
    snippet of code added to the composite texture map in max.....

    struct VNormal : public BlendMode< VNormal > {
          enum { NameResourceID = IDS_BLENDMODE_VNORMAL };
          ::Color operator()( const ::Color& fg, const ::Color& bg ) const
          {
                return ::Color(Normalize(fg + bg));
          }
       };
    and
    VNormal::i()
    added to

    const BaseBlendMode* const ModeArray[]

    enables the "correct" blending of normal maps with the map.


    from....








    would be nice to add something similar to photoshop but I don't know enough about it's sdk to know if it's possible

    correction, forgetting my shader tech :/

    struct VNormal : public BlendMode< VNormal > {
          enum { NameResourceID = IDS_BLENDMODE_VNORMAL };
          ::Color operator()( const ::Color& fg, const ::Color& bg ) const
          {
                Point3 fgn = 2.0f * (Point3(fg.r, fg.g, fg.b) - 0.5f);
                Point3 bgn = 2.0f * (Point3(bg.r, bg.g, bg.b) - 0.5f);
                ::Color res(Normalize(fgn + bgn)/2.0f + 0.5f);
                return res;
          }
       };



  • malcolm
    Online / Send Message
    malcolm Polycount Sponsor
    That's cool. In Photoshop I've been using a script which sets up a layer rig to blend the normal maps correctly, it's part of the normally blue panel. https://gumroad.com/l/NormallyPanel I beleive the NM Blue2 button blends them correctly like the old Quixel tools did. I set a hotkey for the script so I can toggle the normal layer from default to blended correctly.

  • malcolm
    Online / Send Message
    malcolm Polycount Sponsor
    Finished this one a couple weeks ago, create primitive at selection aligned to component normal or average normal of multiple components.

  • Klunk
    Offline / Send Message
    Klunk greentooth
    a quick face layering mod....


    though it's not what it was for you could use it for old school "fur"

    add offset option to the mapping w coord


  • malcolm
    Online / Send Message
    malcolm Polycount Sponsor
    This would be incredibly handy for damaged edge trims, it was a real pain in Maya duplicating and floating damage edges trims in front of the model because Maya doesn't offer any parametric way to offset the geometry without skewing the shape as it gets farther away from the surface.
  • poopipe
    Offline / Send Message
    poopipe polycount lvl 666
    there's the transform component tool - that pushes things along their normals 
  • malcolm
    Online / Send Message
    malcolm Polycount Sponsor
    Yes, but it skews the shape of the trim as I mentioned above as it gets farther away from the model. The only clean way I've found to do this is with extrude face since it will stay straight, but that's time consuming and the rout I took which was painful.
  • poopipe
    Offline / Send Message
    poopipe polycount lvl 666
    If you harden the normals /set to face  it should project straight out. 

     I tested it recently after the same point was raised by an artist at the office and didn't see it behaving wrongly (not that I'd put it past Maya to have special cases)
  • malcolm
    Online / Send Message
    malcolm Polycount Sponsor
    Unfortunately no, I just tried that with all hard normals and the same problem occurs, everything skews because transform component only really works in one axis at a time if you want to keep it flat, unless I'm doing something wrong and feel free to correct me. You could of course move the top faces up manually along Y, then use transform component to do the side faces, but that's the same amount of work as just extruding the faces and then deleting the excess which is how I've been doing it in the past.



  • Klaudio2U
    Offline / Send Message
    Klaudio2U polycounter lvl 6
    malcolm said:
    Unfortunately no, I just tried that with all hard normals and the same problem occurs, everything skews because transform component only really works in one axis at a time if you want to keep it flat, unless I'm doing something wrong and feel free to correct me. You could of course move the top faces up manually along Y, then use transform component to do the side faces, but that's the same amount of work as just extruding the faces and then deleting the excess which is how I've been doing it in the past.


    Why are you using "Offset" only and not "Local Translate Z" on this gif example? I think you can get a better results using "Local Translate Z" first and then you can fiddle with Offset to try to fix things a bit if you are going very far out.
  • malcolm
    Online / Send Message
    malcolm Polycount Sponsor
    Because offset is much better than dragging the manpulator, and in most cases offset will actually create perfectly aligned faces just like the extrude tool, I've tried both since posting the .gif and I also tried selecting edges, but there's no way to do this as far as I can tell unless you do it in two steps which is not parametric. Local translate Z actually creates an even worse bubble looking skew.
  • Klunk
    Offline / Send Message
    Klunk greentooth
    more tweaking of blending normals....

    static void normal_basis(Point3& z, Matrix3& tm)
    {
        Point3 y(0.0f,1.0f,0.0f);
        Point3 x = Normalize(CrossProd(y,z));
        y = Normalize(CrossProd(z, x));
        tm.Set(x, y, z, Point3(0.0f,0.0f,0.0f));
    }

     struct VNormal : public BlendMode< VNormal > {
          enum { NameResourceID = IDS_BLENDMODE_VNORMAL };
          ::Color operator()(const ::Color& fg, const ::Color& bg ) const
          {
                Point3 fgn = 2.0f * (Point3(fg.r, fg.g, fg.b) - 0.5f);
                Point3 bgn = 2.0f * (Point3(bg.r, bg.g, bg.b) - 0.5f);
                Matrix3 tm;
                normal_basis(bgn, tm);
                fgn = tm.VectorTransform(fgn);
                ::Color res(Normalize(fgn + bgn)/2.0f + 0.5f);
                return res;
          }
       };




  • malcolm
    Online / Send Message
    malcolm Polycount Sponsor
    Furthermore to our discussion above about broken edges trims, I figured out how to do this parametricly without any fiddling. Or at least I think I did until someone tells me it doesn't work, but it works on the shapes I need it for. The trick is to select edges and translate on x using the component move mode setting in the move tool. I wish I figured this out back when I was working on Gears 5!
  • Klunk
    Offline / Send Message
    Klunk greentooth
    a select intersecting faces mod for max.....

    operates on faces/polys/element with the option to hide "valid" faces/polys/elements... at the end I'm setting the min spacing of the emitter that generates the points that the mesh is created from. Have to say the trickiest part was finding a "decent" robust  tri vs tri c code on the interweb (there are some real shockers about) in the end had to implement my own.

    cylinder with nasty noise on it (while adjusting the seed and roughness)

  • Klunk
    Offline / Send Message
    Klunk greentooth
    added the ability to adjust the transition point in the uv to the texture and matched the "blend" geometry to the shape more as opposed the the circular version as it distorts the map less.

  • malcolm
    Online / Send Message
    malcolm Polycount Sponsor
    Wow that's super impressive.
  • Klunk
    Offline / Send Message
    Klunk greentooth
    ported stumpy to the sdk, so it also now works as an outline so it can be used as a cutter....

  • radiancef0rge
  • Klunk
    Offline / Send Message
    Klunk greentooth
    some performance gains on the tree generator....

Sign In or Register to comment.