Home Technical Talk

Screws/screwholes normalmaps - minimizing work

1
polycounter lvl 18
Offline / Send Message
Chai polycounter lvl 18
On a recent weapon I'm making, the stage of screws and their holes came up.
Originally, I used to model them straight on the highpoly (subd) model, but I find that very time consuming.

Below is a solution I'm currently trying out, which ID Software used on doom3 to cut down production time.
Basically you model the screw hole as a floating piece of geometry in front of the actual highpoly - due to the baking process the final result would seem as if the hole/idents were attached to the actual model.

screwsholes01iz3.jpg

I've also tried doing the screws via normalmap painting, but the results were pretty subpar - anyone had good results with that solution ?

Replies

  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    Yep, using floating geometry is a standard and well-accepted practice for this sort of thing.
    It's even better to build up a "library" of common pieces (screws, bolts, rivets, generic detail) that you can use again and again - just import into your scene and make "instance" copies of them wherever needed, so if you change one you change them all.
  • Chai
    Offline / Send Message
    Chai polycounter lvl 18
    That was great advice, thanks MoP.
  • diminished_Self
    Offline / Send Message
    diminished_Self polycounter lvl 12
    its also easy to build a library of normals for things like that to overlay directly on you PSD.
  • Joshua Stubbles
    Offline / Send Message
    Joshua Stubbles polycounter lvl 19
    [ QUOTE ]
    its also easy to build a library of normals for things like that to overlay directly on you PSD.

    [/ QUOTE ]

    Only useful if you're using tangentspace maps, though.

    Having a library of actual model pieces is best overall I think. Since you can apply those to any model you're using for objectSpace maps as well.
  • Archanex
    Offline / Send Message
    Archanex polycounter lvl 18
    hey thanks for the tip on modeling screws chai, one question though: How do you keep the pieces from intersecting the base gun? you've got that part of the screw piece that dips in past where it seems like the polygon for the base gun is... so how do you keep it from intersecting?
  • jgarland
    I was curious about that, too. I assume the screw geometry is floating slightly above the mesh, and it just isn't evident in those screenshots. That would be why it's necessary to increase the distance at which the projection cage can find the geometry.

    Some clarification from someone else more knowledgeable on the subject would be really great, though.
  • poopinmymouth
    Offline / Send Message
    poopinmymouth polycounter lvl 19
    Indents just need to be floated even higher to make sure they don't indent.

    normal_float.jpg

    poop.gif
  • EarthQuake
    Compositing in photoshop is generally a bad idea, for a number of reasons. One big one is that if your uvs arent perfect, your details will get distorted, so while it may work on a flat level texture, if you have a more complicated unwrap you're likely to not have perfect uvs, and you'll likely not have perfect texel distributuion, so a screw thats 4px4px somewhere on the map might not be the same size. If you take into consideration you'll have to deal with all of this bullshit its much easier just to model these things. Also if you only have pre-generated images, you couldnt do something like rotate a screw around, as the normals would be fucked.
  • Jesse Moody
    Offline / Send Message
    Jesse Moody polycounter lvl 18
    [ QUOTE ]
    Compositing in photoshop is generally a bad idea, for a number of reasons. One big one is that if your uvs arent perfect, your details will get distorted, so while it may work on a flat level texture, if you have a more complicated unwrap you're likely to not have perfect uvs, and you'll likely not have perfect texel distributuion, so a screw thats 4px4px somewhere on the map might not be the same size. If you take into consideration you'll have to deal with all of this bullshit its much easier just to model these things. Also if you only have pre-generated images, you couldnt do something like rotate a screw around, as the normals would be fucked.

    [/ QUOTE ]


    EXACTLY. Thats why I have always just had multiple files with screws, bolts, other details.

    Kind of anal but I went through the hassle of putting a small document together that showed what each one looked like so I could just grab it quickly when neeeded. Makes things much quicker.
  • Ryan Clark
    Offline / Send Message
    Ryan Clark polycounter lvl 18
    [ QUOTE ]
    you couldnt do something like rotate a screw around, as the normals would be fucked.

    [/ QUOTE ]

    It's not much, but you can rotate normalmaps in 90 degree increments.

    I made some photoshop actions for that: http://zarria.net/PhotoshopNormalTransforms.zip
  • j_bradford
    Offline / Send Message
    j_bradford polycounter lvl 17
    Any of you guy have a solution for getting rid of the AO problem with floaters? Specifically the shadow it creates around a floater's edge?
  • Ryan Clark
    Offline / Send Message
    Ryan Clark polycounter lvl 18
    You could bake your normalmap using floaters, then use CrazyBump to render a displacement map from the normalmap. Then discard the floaters and bake AO from just your model & displacement map.

    I haven't tried this, mind you. It just seems like something that might work.
  • Archanex
    Offline / Send Message
    Archanex polycounter lvl 18
    So I just did a little test to try out this workflow and I'm happy to report it works pretty well! Thanks guys =D
  • EarthQuake
    [ QUOTE ]
    Any of you guy have a solution for getting rid of the AO problem with floaters? Specifically the shadow it creates around a floater's edge?

    [/ QUOTE ]

    I came up with a bit of a hack for this. I personally dont think its really worth the time spend to do this, but here goes(much easier to paint out the wierdness, takes like 10 minutes max). Create a mesh that has the highres and the floating bits each with a different color, like black and white, either by uving or material system in max. Render that map onto your lowpoly as a diffuse map. Seperate Floating bits from highres bits. Render 2 ambocc maps, one with from the highres, the other from JUST the floating bits. At first the floating bit map will look fucked up, but you use the first diffuse map you generated as a mask for this texture, and multiply it onto the ambocc generated from the highres mesh. You may want to blur the mask a little or something, iirc.
  • Ghostscape
    Offline / Send Message
    Ghostscape polycounter lvl 13
    Chiming in to say get the Advanced Painter script.

    http://www.scriptspot.com/3ds-max/advanced-painter

    It works in Max 9, I use it at work all the time. It lets you select a piece of geometry as a "brush" and then paint it onto another piece of geometry - so now those 20 screws you wanted to put around are all properly aligned to the surface normals of whatever you're modeling - makes it very easy when the floater needs to sit on top of a face that isn't axis-aligned.

    I just paint out the amb-occ errors, myself. You could group all your floaters together and hide them for your ambocc bake, but then you won't get the shadows in the divots - its really easy to paint out of your ambocc bake.
  • peppi
    Offline / Send Message
    peppi polycounter lvl 18
    [ QUOTE ]
    You could group all your floaters together and hide them for your ambocc bake, but then you won't get the shadows in the divots - its really easy to paint out of your ambocc bake.

    [/ QUOTE ]

    You could do a separate AO pass on the floaters and merge everything in Photoshop, though it's probably not a big speed gain over fixing things manually.
  • Ryan Clark
    Offline / Send Message
    Ryan Clark polycounter lvl 18
    Surely rendering displacement from your normalmap and baking AO from the displacement is easier than manually painting out errors?

    If not then I must find a way to make it so... 'cause a workflow that involves painting out errors around every rivet just can't be the best answer.
  • JordanW
    Offline / Send Message
    JordanW polycounter lvl 19
    If you're using light tracer you can just turn off shadow casting for the screw objects. If you're using mental ray just exempt it using the object ID.
  • Slum
    Offline / Send Message
    Slum polycounter lvl 18
    For this sort of thing, ben cloward's normal map shader works really well. http://www.bencloward.com/shaders_NormalMapMaker.shtml

    Good for things like screws and bolts when you dont want to render out a normal map. Has the same limitations as EQ pointed out, though.
  • JKMakowka
    Offline / Send Message
    JKMakowka polycounter lvl 18
    [ QUOTE ]
    It's even better to build up a "library" of common pieces (screws, bolts, rivets, generic detail) that you can use again and again

    [/ QUOTE ]

    Just as a thought: What about releasing such a library under a creative commons license (as little restrictions as possible would be probably best, e.g. CCA), so that it can be improved and enlarged by a big group of people?

    (I would be happy to host it on our FGA page btw)
  • EarthQuake
    [ QUOTE ]
    Surely rendering displacement from your normalmap and baking AO from the displacement is easier than manually painting out errors?

    If not then I must find a way to make it so... 'cause a workflow that involves painting out errors around every rivet just can't be the best answer.

    [/ QUOTE ]

    The baking displacement option dosent really seem to be very good, atleast it wouldnt work in my workflow. If you're using something like xnormal to render your maps, which doesn't support applying a displacement map. Not to mention if you have an object space map, crazybump wouldn't support that either. And at the same time that seems to be on par with rendering 2 maps, in terms of just being a hassle to have to do. Now i havent actually tried, so i'm just playing devils advocate here.
  • EarthQuake
    [ QUOTE ]
    [ QUOTE ]
    It's even better to build up a "library" of common pieces (screws, bolts, rivets, generic detail) that you can use again and again

    [/ QUOTE ]

    Just as a thought: What about releasing such a library under a creative commons license (as little restrictions as possible would be probably best, e.g. CCA), so that it can be improved and enlarged by a big group of people?

    (I would be happy to host it on our FGA page btw)

    [/ QUOTE ]

    Thats a great idea, and i would definately contribute. The only snag i could see is with many people having contracts with the companies they work for that would make this impossible to do(places that say EVERYTHING you do is thiers).
  • Ryan Clark
    Offline / Send Message
    Ryan Clark polycounter lvl 18
    [ QUOTE ]
    The only snag i could see is with many people having contracts with the companies they work for that would make this impossible to do(places that say EVERYTHING you do is thiers).

    [/ QUOTE ]

    This is a bit off-topic but needs to be said:

    Those things are abusive. Never sign them. When an employer asks you to sign something, read it first and strike any words that give them more than they're paying for. If they aren't paying for a 168-hour work week, don't give them one.

    Scan the contract to your PC, remove the evil clause, and print a nice new contract for your employer. I've done this myself and never had an employer object.
  • thnom
    Offline / Send Message
    thnom polycounter lvl 18
    Wouldn't the idea of the work being submitted without credits just get round this? Who said the work has to be associated with any one person? Just have it as an open library with no links to any one person, just previews and the work in different file formats.
  • JKMakowka
    Offline / Send Message
    JKMakowka polycounter lvl 18
    Glad to see there is some interest.

    You could probably have a library with all works donated to the public domain and thus basicly have no credits. But this would be a legal gray area for those donating work (and have such a contract).
    In addition it would also be less ideal for those using the models for (commercial) work as the legal status of these works in the public domain can be not as precisely defined as with a creative commons license.

    But does such a contract really affect that many people around here?
  • Ryan Clark
    Offline / Send Message
    Ryan Clark polycounter lvl 18
    There's no gray area. You can't donate work that doesn't belong to you. An artist under that sort of contract doesn't own her work. She can't contribute to a community project unless her employer grants permission.

    I suppose she could hide weekend projects behind a pseudonym. Seems like a degrading position to be in, though... unable to claim her work or put it on her resume.

    Amusingly, those contracts hurt employers most of all. They scare away the best talent.


    edited in light of Vassago's good point about asking an employer's permission.
  • Joshua Stubbles
    Offline / Send Message
    Joshua Stubbles polycounter lvl 19
    Honestly though, a lot of studios are open to these things if you talk to them about it. Both studios I've worked for (albeit small) said they didn't mind what I was working on off-hours, as long as it wasn't a competing retail product.
    Though the contract I signed stated that ANY art I created, on or off hours, was theirs. It's really a person to person deal. You have to talk to them about it.
  • Ryan Clark
    Offline / Send Message
    Ryan Clark polycounter lvl 18
    If your work is valuable, be sure the permission is in writing. At my last job, their standard contract said "any representations to the contrary... made to me in the future are of no force and effect unless set out in writing..."

    Studios won't usually mind changing a contract to keep an employee happy. But still, the easiest time to change it is before signing ;)
  • poopinmymouth
    Offline / Send Message
    poopinmymouth polycounter lvl 19
    I agree with Ryan. Don't assume a contract is set in stone. Alter it or add to it as you see fit, since the agreement is 2 ways. Just don't get too crazy. :-)

    Ryan, painting out errors seems to be a necessary step no matter what your workflow, so hitting the AO corrections just adds a minute or two, it's really just a quick step that I don't foresee having to go away anytime soon. Sometimes there aren't even any errors, just things you want to manually adjust to look better, even if it makes the lighting or normals "wrong".

    poop.gif
  • EarthQuake
    Since we've been coving some much on AO, i'll explain my workflow a little bit. I do this on FPV weapons atleast.

    Model highres,
    Model Lowres/uv

    Seperate highres and lowres so there arent any intersecting meshes that should be, so the maps render out clean.

    Render AO/Normals

    Put the lowpoly back together, or generally i have a saved copy before i took it apart. And Render the AO just from this low poly mesh.

    Combine these 2 maps so you get all the fine detail AO, as well as the large detail AO from parts intersecting and whatnot.

    And then paint out the sections on the 2nd AO map where there will be moving parts and baked in shadows would look strange.

    Finally bake a little bit of a gradient, usually darkening up the ends towards the barrel and the buttstock to give the place that will be closest to the view the focus.
  • coldwolf
    Offline / Send Message
    coldwolf polycounter lvl 18
    I just want to throw in my spoken support for a library of mundane objects such as screws/bolts/etc distributed directly to the public domain.

    The idea would gain more traction if a reputable site such as Polycount hosted the library.

    If that isn't possible, we can all chip in some code and webspace to throw together a distributed, interconnected repository. In other words, if we each build a page on our sites dedicated to the idea and link to everyone else's pages (sticky the post that holds everyone's links), I'm certain we can build quite an indispensable resource.

    It'd be a good idea to settle on a standard format to make organization uniform and simple across the board.

    (Or one person could host all kinds of screws, another bolts, another switches, etc..) Thoughts?
  • EarthQuake
    standard format, OBJ!
  • Jesse Moody
    Offline / Send Message
    Jesse Moody polycounter lvl 18
    [ QUOTE ]
    Since we've been coving some much on AO, i'll explain my workflow a little bit. I do this on FPV weapons atleast.

    Model highres,
    Model Lowres/uv

    Seperate highres and lowres so there arent any intersecting meshes that should be, so the maps render out clean.

    Render AO/Normals

    Put the lowpoly back together, or generally i have a saved copy before i took it apart. And Render the AO just from this low poly mesh.

    Combine these 2 maps so you get all the fine detail AO, as well as the large detail AO from parts intersecting and whatnot.

    And then paint out the sections on the 2nd AO map where there will be moving parts and baked in shadows would look strange.

    Finally bake a little bit of a gradient, usually darkening up the ends towards the barrel and the buttstock to give the place that will be closest to the view the focus.

    [/ QUOTE ]

    Yep that pretty much sounds like my work flow for recent fpv weapons i have been working on. Haven't really got much to add to that as it's the easiest flow i have found that works good for me.
  • JKMakowka
    Offline / Send Message
    JKMakowka polycounter lvl 18
    Well someone has to start such a library by donating some... I would, but I honestly don't have any "floaters" to start with frown.gif
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    Model some then, doesn't take long smile.gif
  • Ryan Clark
    Offline / Send Message
    Ryan Clark polycounter lvl 18
    I'd be glad to provide webspace for such a project if someone wants to maintain a page ;)

    The space would be on a dreamhost server. PHP is available so it could be a wiki or something like that. The project could use its own domain, or it could use whatever.zarria.net or whatever.crazybump.com

    I'm not volunteering to run the site or anything, but I'm happy to provide space if it would be of use.
  • JKMakowka
    Offline / Send Message
    JKMakowka polycounter lvl 18
    [ QUOTE ]
    Model some then, doesn't take long smile.gif

    [/ QUOTE ]

    But, but, "I don't have time"^TM smile.gif

    Btw does it really need an entire website? Seems a bit like overkill.
    I guess it should be enough to simply start a new thread in this forum (sticky would be best) and regulary compile all the contributions into a single archive, which is then mirrored on several sites (including FGA) to prevent loss of data.

    Edit: Besides, if someone already has a bunch of basic screws and bolts why should I duplicate his work, instead of improving upon. Isn't that the basic idea of it all anyways? Yeah sound a bit like: "why should I work if someone else is doing it already"; but that is really too short sighted smile.gif
  • Ruz
    Offline / Send Message
    Ruz polycount lvl 666
    can someone answer this for me please. I am making belt loops as floating geometry, so yeah can i just make one and duplicate the normal map for this in pshop or do I have to project each belt loop seperately arund the waist of my characters belt.
    I am guessing that because each loop would be at a slightly different angle then the first method would not work.
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    If you're making belt loops as floating geometry, surely it's much much easier and more accurate to project all the belt loops as geometry, rather than manually doing anything in photoshop?
    instance the geometry, space it along a spline if you need a lot of them, use advance painter script if you're using max to place them by hand, or simply the align to normal tool.
  • Rob Galanakis
    As far as a library of bolts and whatnot, I came up with a pretty nifty system I'm using for modder units at www.twcenter.net, a unit repository of sorts.

    Basically, someone will email me a zip file with whatever necessary files (in this case it'd just be an obj), along with a render. I upload the file to an http location (so, www.repo.robg3d.com/files/screw.zip ). I make a post in a forum or thread (since this is simple it could just be a locked thread), and in the post is the render, the http link, and keywords from a keywords list (flathead, phillips, rivet, screw, bolt, hex, etc.). This keywords list is in the first post or another thread, so people can just look for certain keywords, then search the forum for those keywords and they will return matching posts and can easily see via the screenshot if its what they are looking for.

    It may be simpler to just upload and download all the files en masse in this case because they are going to be so small. But some sort of standardization and organization is always nice.

    I too can offer space, as I too am on dreamhost, and they have huge bandwidth and space allottments and have good uptime, but of course, they are slow (which doesn't matter much for small files like this though).
  • Ruz
    Offline / Send Message
    Ruz polycount lvl 666
    actually mop I just wanted to know if it was technically correct to duplicate them in pshop. the problem with projecting stuff is that the result is always slightly distorted which pains me a lot
    For small piddly stuff I like to keep control of what i am doing in pshop.
    I will post some images tomorow
    I am using tangent space normal maps BTW, thanks for the tips anyway MOP
  • Ryan Clark
    Offline / Send Message
    Ryan Clark polycounter lvl 18
    With tangent space maps, copying & pasting in Photoshop is fine. Just don't rotate anything!
  • Ruz
    Offline / Send Message
    Ruz polycount lvl 666
    cool, cheers ryan,just wanted to make sure it would not look inside out when it came to the belt loops on his back.

    the belt loops do parallax little but other wise fine.

    BTW loving crazy bump.I got the environment guys at my last place using it too
  • poopinmymouth
    Offline / Send Message
    poopinmymouth polycounter lvl 19
    Why doesn't everyone go back through any personal projects that had bolts or rivets and just detach them and submit them here? I'll do that tonight on my high poly models. I've been needing to do that anyway, so I'll go first.

    poop.gif
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    For objects which are subdivided, I imagine it makes sense to just post the control cage mesh as a .OBJ?
    Then end-users can subdivide them to whatever level they want.
  • poopinmymouth
    Offline / Send Message
    poopinmymouth polycounter lvl 19
    I have more at home, but this is just what I whipped up real quick. Click to download the obj file.

    bits_bobs.jpg

    poop.gif
  • Joshua Stubbles
    Offline / Send Message
    Joshua Stubbles polycounter lvl 19
    great start, poop
  • Ruz
    Offline / Send Message
    Ruz polycount lvl 666
    good stuff poop. those parts loook a bit like my 'dyson'
  • Ghostscape
    Offline / Send Message
    Ghostscape polycounter lvl 13
    I just went looking through the stuff that I have at home, but it's really not very useful. Unfortunately the stuff I've made at work I can't share.
  • Rob Galanakis
    Alright I've started to set up a thread in my unit repository. In a couple weeks the forum will be open to the public but for now, the thread is here:
    http://www.twcenter.net/forums/showthread.php?t=113650

    The password to the forum is warden

    I'll add the hardware for the lorica segmentata I've been working on tonight or tommorrow.
    Feel free to upload your obj's or send them to robg@robg3d.com

    I hope everyone is alright with my doing this, if not, speak up.

    BTW if anyone has other generic high-poly objects or bits, feel free to send them over.
1
Sign In or Register to comment.