Home Coding, Scripting, Shaders

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

Replies

  • malcolm
    Offline / 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
    Online / Send Message
    Klunk ngon master
    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
    Offline / 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
    Online / Send Message
    Klunk ngon master
    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
    Online / Send Message
    Klunk ngon master
    prototyping stumpy


    with added uv's....and more noise options....

  • Klunk
    Online / Send Message
    Klunk ngon master
    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
    Offline / Send Message
    malcolm polycount sponsor
    Wow that's super impressive.
  • Klunk
    Online / Send Message
    Klunk ngon master
    thanks, though it basically a cylinder that relies on code by Mr Perlin and the wave functions from graphic gems V circa 1993 ;)

    the "regular" shapes are  interesting (think theres probably another application for them).....


  • Klunk
    Online / Send Message
    Klunk ngon master
    ported stumpy to the sdk, so it also now works as an outline so it can be used as a cutter....

  • radiancef0rge
  • Klunk
    Online / Send Message
    Klunk ngon master
    some performance gains on the tree generator....

  • Klunk
    Online / Send Message
    Klunk ngon master
    a fun one, normal mapped camera facing billboard shader

    this shows the limitations better....


  • Klunk
    Online / Send Message
    Klunk ngon master
    rewritten the tree generator to separate out the trunk from the branches... which had a surprising effect...
    mature to ancient grandad. just don't look too close at the mesh :/ criminal amount of overdraw



  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    I'm starting on a set of UV visualisation / analysis / manipulation tools for fbx files using standalone python with a view to being able grab stats and find possible optimisations on big libraries of assets

    step 1 is obviously to visualise some UVs 



    Step 2 will probably be determining coverage and other obvious stats but it's bedtime soon so I'm quitting for the evening

    Technically step 1 was actually building the fbx SDK bindings for python 3.8 .
    Actual, effective instructions for doing this are here if anyone's interested:
    https://www.ralphminderhoud.com/blog/build-fbx-python-sdk-for-windows/

  • malcolm
    Offline / Send Message
    malcolm polycount sponsor
    Neat, what would be the use case for this. We tried to check the UVs from the outsourcing team before we approved them to go on to the texturing stage to avoid costly re-texturing if they had created wasteful UVs. We used the Maya %UV wasted HUD to make sure everything hit at least 70% unless it was something funky where the shells couldn't be packed tightly.
  • malcolm
    Offline / Send Message
    malcolm polycount sponsor
    So I created this Maya tool for someone that had a really specific workflow. They wanted to group UV shells and then pack the shells based on a scale they assigned to each group, I thought this was a really interesting idea and a neat challenge, but once I finished the tool I realized I'd never use it for anything, but the person that wanted it was happy. So I haven't released the tool yet because I'm not sure it's useful, but I'll share it here because I think it's neat. The worst part of the tool is there's no way to visually colour the UV shells to show which group they're in, or at least no way I could figure out how to do it in mel.


  • Sage
    Offline / Send Message
    Sage polycounter lvl 19
    Some awesome work here!!!.
  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    malcolm said:
    Neat, what would be the use case for this. We tried to check the UVs from the outsourcing team before we approved them to go on to the texturing stage to avoid costly re-texturing if they had created wasteful UVs. We used the Maya %UV wasted HUD to make sure everything hit at least 70% unless it was something funky where the shells couldn't be packed tightly.
    That's one use case, texel density checking is another. I should also be able to use image analysis / computer vision stuff to compare lod UVs and suggest optimisations in the form of shell overlapping and so on too 

    The main thing is that it's not in Maya so it's fast and not crippled by python 2.7
  • malcolm
    Offline / Send Message
    malcolm polycount sponsor
    Oh interesting, yeah we needed to do A LOT of lod optimizations to get Gears 5 to run at 60fps all the time. The tech art guys would use view mode in unreal to identify problems and send us huge lists of things that needed to be adjusted in certain ways.
  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    My general philosophy is that  reactive optimisation of this kind is the result of you not beating your art team severely enough at the beginning the project ;)
  • malcolm
    Offline / Send Message
    malcolm polycount sponsor
    Ha ha, I can guarantee 100% we were beat into pulp at the beginning of the project with the most harsh budgets you've ever encountered for any AAA game and stuck to them, then further dried out and ground into dust near the end of the project to get a solid 60fps @4k especially in the open world sections.
  • mihail.lupu
    Offline / Send Message
    mihail.lupu polycounter lvl 11
    I started to upgrade my old hair card tool. A wip demo video: https://www.youtube.com/watch?v=sahmdIRfLrI
  • malcolm
    Offline / Send Message
    malcolm polycount sponsor
  • HiernauxNicolas
    Offline / Send Message
    HiernauxNicolas polycounter lvl 10
    Hi there !  
    After the detail albedo shader, I finished a new shader : the 'Sticker & Detail Albedo map Shader'. This shader for TB3 allows to add a sticker on top of an existing material and includes the previous 'detail albedo' module. I hope you enjoy ! 
    https://www.youtube.com/watch?v=JjzaSo5vkwI
  • onionhead_o
    Offline / Send Message
    onionhead_o polycounter lvl 16
    (MAYA) interactive quad cylinder primitive


  • malcolm
    Offline / Send Message
    malcolm polycount sponsor
    Wow that's cool, did you write that in the API or Mel, or Python?
  • onionhead_o
    Offline / Send Message
    onionhead_o polycounter lvl 16
    Thanks malcolm, its all mel. its a mix of using dragAttrCtx and scriptJobs to mimic interactive creation
  • malcolm
    Offline / Send Message
    malcolm polycount sponsor
    Nice, thanks for the info.
  • Fansub
    Offline / Send Message
    Fansub sublime tool
    Interactive tools are the best!

    Here's how you'd write one with GraphN:


    The nodes responsible for interactivity are Viewport Event and Viewport Event Meta. Viewport Event allows you to run any piece of code on mouse move, press, release or modifier press. Viewport Event Meta is there to give you data about your viewport, like the mouse's screen space position, for example :) it's pretty much a wrapper around dragAttrCtx but beefed up a little.

    The rest of the graph is just querying where your mouse currently is in screen space, running a ray intersection to see which face/position your mouse would hit, which is then used to set the position of the object.
    For rotation, I'm using Get Components Data, which takes a face or list of faces and their mesh, and returns the position, normal and rotation of that face. Here I'm setting the rotation of my torus with that nod's output.

    Execute basically allows you to chain a sequence of operations: in this case we first set the position, then set the rotation :)



  • malcolm
    Offline / Send Message
    malcolm polycount sponsor
    I didn't think graphN was available to try yet?
  • Fansub
    Offline / Send Message
    Fansub sublime tool
    Not yet yeah :) still got a bunch of nodes to complete (like being able to create custom manipulators) before we ship it
  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    I'm making substance designer do things it wasn't designed for again. 
    For this experiment I decided to encode arrays into images and use those to drive fx maps. 
     
    The example given dumps UV coords from an fbx sequentially into a small texture (64x64 in this case) - this bit is python.
    The fx map uses nested iterators to sample pixels sequentially and position shapes according to whatever is stored . 

    The only really irritating limitation is that you can't detect input image size in a graph so you have to tell it how big the incoming image is. 

    If anyone can think of a use for it outside of making non-perlin based distributions I'd love to hear about it. 


  • malcolm
    Offline / Send Message
    malcolm polycount sponsor
    In Maya I figured out how to layout and stack UV shells based on user grouping. This was the most requested feature people were always asking me for so I'm pretty happy it worked out. At first I thought it was impossible in Mel, but I figured out a hack way to do it.

  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    I got up early so I thought I'd see if I could generate an fbx full of fitted alpha cards directly from a texture. 

     it's pretty configurable in terms of how complex the geometry can be and how much padding you get. 

    Triangulation is a job for another day - I'll probably go for an ear clipping algorithm unless anyone has any more cunning suggestions


  • malcolm
    Offline / Send Message
    malcolm polycount sponsor
    Wow, that's amazing, that would actually be really helpful.
  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    couldn't sleep so triangulation happened. I tried ear clipping but it's either unsuited for this sort of shape or I implemented it wrong. I fell back to using the triangle module for python  which is a binding to a 2d delauney implementation by Jonathan Richard Shewchuk.
    I'm not 100% happy with every choice it makes but it's pretty good considering it has no information fed into it beyond a list of points.

    next job - spend 2 hours digging though the fbx SDK docs trying to work out how to flip those faces - you'll note everything has mirrored since last time...
     


  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    and now it works mostly properly - everything points in the right direction etc. at least

    It wont open the meshes in paint3d for some reason but I don't care yet - might be because im writing ASCII fbx out or possibly just some meta data I haven't bothered adding. They open in max so i assume they'll work in maya .

    You can affect how dense the mesh is and affect how much padding is around the shapes but the difference is limited (57tris on the left to 88 on the far right)  since the outline generation is pretty minimalist and you can only pad as far as the texture lets you. 

    It needs a UI so I'll give that a poke next.


  • onionhead_o
    Offline / Send Message
    onionhead_o polycounter lvl 16
    working on a Quad Primitive Toolset

    Was finally able to create tweaking Cap Insets where it will update realtime.

  • malcolm
    Offline / Send Message
    malcolm polycount sponsor
    Wow, that's cool. What did you write this in?
  • onionhead_o
    Offline / Send Message
    onionhead_o polycounter lvl 16
    still mel with the mix of some nodes and deformers hacked together
  • malcolm
    Offline / Send Message
    malcolm polycount sponsor
    Wow that's cool, I write all my stuff in mel, haven't learned any other languages yet.
  • Klunk
    Online / Send Message
    Klunk ngon master
    inspired by the above.... implemented a quad sphere scripted max simple object.....

    it basically an mxs version of max box object "morphed" into a sphere



  • malcolm
    Offline / Send Message
    malcolm polycount sponsor
  • onionhead_o
    Offline / Send Message
    onionhead_o polycounter lvl 16
    ah nice Klunk.The Quad sphere that i did used the polyPlatonic as base and the Sculpt deformer to keep it sphere.

    I wish i could do half the stuff that you can Klunk, but in maya
  • Klunk
    Online / Send Message
    Klunk ngon master
    Thanks, just  copied some code from here and applied it to max's box obj code, the tricky part/ painful bit is porting the sdk 0  based indexing to mxs 1 based indexing and not running out of the room screaming when everything is a spaghettified mess :D I'll get round to implementing a c++ version sometime.
  • onionhead_o
    Offline / Send Message
    onionhead_o polycounter lvl 16
    ah i was referring to your other tools Klunk, but thanks for the link as well.
  • Klunk
    Online / Send Message
    Klunk ngon master
    this is quite an interesting article on spheres with code.... (i implemented selective edge turning on my code before reading it) probably get around to implementing a variation on the "normalized" version sometime.

    added the "normalized" as a bias on the original script also has the option of flipping the edge to improve edge flow in the sphere




  • Klunk
    Online / Send Message
    Klunk ngon master
    auto smooth spline for max, turns corner knots into  smooth or bezier knots


    based on the in out vector angles, you can have balanced (equal length in out) and uniform (same length for all) options and a scaling factor. It was designed as a precursor for the resample plugin where the starting spline is made from mostly corner knots (it still worked but not if you want to maintain specific knots). So i'll be adding it to the resample upload (once i've fixed a couple of bugs in the resampler) 
  • Klunk
    Online / Send Message
    Klunk ngon master
    this is a bit whacky, unintended single click bezier creation.... if you have the mod at the top of the stack then create the spline underneath in single click corner fashion....



    dunno if it has much application but a bit of fun none the less ;D
  • Klunk
    Online / Send Message
    Klunk ngon master
    I needed to port some shapes back in time to check some issues/bugs in my code in earlier versions of max, couldn't really find a good reliable method with the built in stuff so wrote a quick and dirty scripted xml shape exporter and importer with quite a neat file format if i do say so myself ;) ,  So it got me thinking, As we've been using photoshops ai exporter and max's ai import to transfer  shapes from photoshop to max for a while and it's never been ideal. So I wrote a really dirty javascript xml shape exporter  for photoshop. It was easier than i expected.

    a ps shape

    to a max shape....



Sign In or Register to comment.