Home Technical Talk

Gnome 3D scan + Technical Writeup

P6241840.jpg

Hey guys, I’ve been wanting to try out 3D scanning for a while, here is my first attempt! It’s actually more like my third attempt, the first two sets of photos I took didn’t work. I tried putting the camera in a fixed position and moving Mr. Gnome around for each shot but the stitch process failed, I think it may have been due to the fact that I had an even white backdrop, so there wasn’t enough detail for the stitching software to recognize.

After trying (and failing) with a studio lighting/backdrop setup, I took Mr. Gnome outside and sat him on a box in the shade where there was ambient lighting, and took photos from multiple angles, making sure to get shots of any overlapping or overhanging geometry. I took one series of shots 360 degrees around him looking slightly up, and then another series of shots angled down at him. For a more complex asset, you would probably want to take some detail shots of various areas. The set of shots looked like this:

gnomebridge.jpg

Camera stuff:

The camera I used is an Olympus EM1 with 12-40/2.8 lens, though the camera really isn’t that important (I've read that some people use cell phone cameras for this sort of thing). All you really need is something that gives you full manual control, and ideally can shoot raw with a lens that takes screw on filters. I used a circular polarizer to reduce specular reflections. I shot in manual mode to make sure each shot was evenly exposed, and I shot in raw so that I could correct the white balance for each shot in Lightroom later. I also shot at F11 to make sure the depth of field was wide enough that he was in focus for each shot, and ISO 200 (which is the base ISO for my camera) to limit noise. F11 at ISO 200 meant using slow shutter speeds, so I used a tripod with a 2 second delay to gaurd against motion blur. The exact settings will vary depending on your camera.

After the photos were processed, I brought them into Agisoft Photoscan to stitch them. This worked rather well, I tried Autodesk 123D Catch, which is easier to use but doesn’t appear to have the ability to create dense geometry and high resolution textures like Photoscan does. In the next shot you can see the pattern of the photos I took:

gnomeagi.jpg

Here is the high resolution mesh in Agisoft Photoscan:

gnomeagi2.jpg

For the most part it looks good, there are some random chunks here (looks like it got confused by some background elements). You can mask your shots which would probably help, but for me it was easier to clean this up in Modo/Zbrush than to mask all 37 shots.

In addition to creating 3D geometry, Photoscan can create a uv map and bake out a diffuse texture from your photos. From a tutorial I watched, you might want to make copies of your reference textures and process them to remove lighting information before you bake out your diffuse map. I didn’t do that here but it’s something I may do next time. I baked out a texture at 16K because the auto-uvs are very inefficient.

After I had the highpoly and texture data, I cleaned up some of the issues mentioned before, deleted the base section Mr. Gnome was standing on, decimated the mesh in zbrush to get my lowpoly, and then redid the UVs in modo. At that point, I baked the highpoly content down to normal and diffuse maps:

gnomediffuse.jpg
gnomenormal.jpg

Then, I loaded the model and textures into Marmoset Toolbag, set the reflectivity to 0.04 (because I don’t have a spec map) and eyeballed the gloss value, 0.326 seemed to look about right.

showthread.php?p=2316129#post2316129gnometoolbag.jpg

From there, I exported a Marmoset Viewer file, and uploaded him to ArtStation, which you can see in full 3D glory here:

https://www.artstation.com/artwork/gnome-scan-marmoset-viewer

Replies

  • tungerz
    Options
    Offline / Send Message
    tungerz polygon
    Great work Joe :)
    Thanks for sharing the process.
    Looks awesome
  • HAWK12HT
    Options
    Offline / Send Message
    HAWK12HT polycounter lvl 12
    As always pretty awesome to see your work mate. Just curious as to why there is border like that stretched out on texture?
  • EarthQuake
    Options
    Offline / Send Message
    Thanks! The stretched border is pixel padding applied in Xnormal, it helps to reduce mipmapping artifacts in game engines/real time renders.
  • BlvdNights
    Options
    Offline / Send Message
    BlvdNights polycounter lvl 8
    Epic at GDC showed off how they captured the lighting conditions on 2 spheres, one matte and one gloss, translated that into Maya to recreate the lighting situations and baked a map off of that that helped to eliminate lighting information in the diffuse. How they did that I'm not 100% sure but they might have used HDR shop in some capacity. Something I personally want to explore.

    This looks cool Joe! Hope it inspires more people to explore this. Really great time saver when there's a solid pipeline and you cant argue with the results.
  • Tits
    Options
    Offline / Send Message
    Tits mod
    I wish my cats where static enough I could 3dscan them
  • Joost
    Options
    Offline / Send Message
    Joost polycount sponsor
    Great results Joe, thanks for sharing!

    The hdri thing is pretty straight forward actually, as far as I understand it. They've published some pretty in depth slides and videos on it. I've done a bit of research on this and I've just bought some extra gear to do it. So I'll hopefully post some results soon. Might be wrong about this though. the chrome and matte balls are only for reference and aligning the HDRi to the mesh. Then they render the aligned lighting map in maya and use something like difference in photoshop to get rid of the shadows. They developed their own custom tools for this though so I don't know exactly what the process was.
  • .nL
    Options
    Offline / Send Message
    .nL polycounter lvl 3
    Tits wrote: »
    I wish my cats where static enough I could 3dscan them

    There are ways...

    cat_scan_gone_wrong.jpg

    More seriously, excellent write-up. Thanks for sharing.
  • OutOfMyMind
    Options
    Offline / Send Message
    OutOfMyMind polycounter lvl 5
    R.I.P. 3D artists :]
  • rv_el
    Options
    Offline / Send Message
    rv_el polycounter lvl 18
    Nice! Cool to see it all laid out. Also how detailed the normal map is.

    I have tried some 123D Catch stuff (like my shoe hanging from string in garage) but the results were pretty bad. I wasn't too good at it.
  • Norron
    Options
    Offline / Send Message
    Norron polycounter lvl 13
    But can you make it modular? Let's get some tiled gnome textures up in here.

    This is making me want to try to go some crappy camera phone photgrammetry now. I wonder how possible it would be to get a usable heightmap from a wall for a tile or trim.
  • LMP
    Options
    Offline / Send Message
    LMP polycounter lvl 13
    I literally went out and started actually screwing around with the Agisoft demo I downloaded 2 days ago after I saw your post. I'm not going to start the trial until I'm happy with my capture technique and I know exactly what I hope to make.
    h7NnGmW.jpg
  • Mant1k0re
    Options
    Offline / Send Message
    Mant1k0re polycounter lvl 8
    Very nice, just out of curiosity what is the polycount on the final mesh?
  • Bek
    Options
    Offline / Send Message
    Bek interpolator
    Clearly you should've sold this tutorial to gnomon workshop. Gnome matter, there's always next time.

    @Mant1k0re: Marmoset viewer tells you that when you view single channels.

    Triangles: 46,152
    Vertices: 23,601
  • Mant1k0re
    Options
    Offline / Send Message
    Mant1k0re polycounter lvl 8
    Bek wrote: »
    Clearly you should've sold this tutorial to gnomon workshop. Gnome matter, there's always next time.

    @Mant1k0re: Marmoset viewer tells you that when you view single channels.

    Triangles: 46,152
    Vertices: 23,601

    Thanks, I thought it was sketchfab.
  • Goshi
    Options
    Offline / Send Message
    Goshi polycounter lvl 5
    EarthQuake wrote: »
    In addition to creating 3D geometry, Photoscan can create a uv map and bake out a diffuse texture from your photos. From a tutorial I watched, you might want to make copies of your reference textures and process them to remove lighting information before you bake out your diffuse map. I didn’t do that here but it’s something I may do next time. I baked out a texture at 16K because the auto-uvs are very inefficient.

    After I had the highpoly and texture data, I cleaned up some of the issues mentioned before, deleted the base section Mr. Gnome was standing on, decimated the mesh in zbrush to get my lowpoly, and then redid the UVs in modo. At that point, I baked the highpoly content down to normal and diffuse maps:

    Hi Joe, can you tell us a bit more on how you get the diffuse texture from the highpoly in Photoscan onto the low poly you made within ZBrush?
    Like UV´s will not be the same on high and low, right?!

    Would like to know about how you made that happen...

    kind regards
  • EarthQuake
    Options
    Offline / Send Message
    Mant1k0re: Definately not sketchfab =P As Bek pointed out, the tricount is about 45K. I quickly decimated it in zbrush, the source was about 10 million, the triangle count can be whatever you like really, or you could manually retopo it too if you have special requirements for deformation.

    Goshi: Getting the texture content out is pretty straight forward, Photoscan has a feature that will create auto uvs for the dense mesh and project the texture onto it, which looks like this:

    gnometextagi.jpg

    Theoretically you could use this as is, but the uvs are really bad and there is no pixel padding, so you'll see a lot of mip-mapping errors. I wanted to drop the poly count of the model anyway, which meant redoing the uvs. Once you have your low/uvs done, you can load the highpoly into xnormal, and load the Photoscan generated texture map into the diffuse slot, then in XN, make sure to bake both normals and diffuse - that's it!

    You can also load the lowpoly back into Photoscan and project the texture directly on it, I did both and didn't really see much difference in quality (both had some minor stretching/errors that needed be cleaned up).
  • MarkBTomlinson
    Options
    Offline / Send Message
    MarkBTomlinson polycounter lvl 9
    This is a nice tutorial I was wondering why my cloud seems to be generated upside down. -Y seems odd did you have any issues like that?
  • EarthQuake
    Options
    Offline / Send Message
    Yeah, I had to re-orientate the mesh, it came in not just off axis but randomly rotated. Not sure if that's a common issue.
  • Goshi
    Options
    Offline / Send Message
    Goshi polycounter lvl 5
    Thanks a lot Joe - so you just baked the diffuse from highpoly to lowpoly, just like the same process, when baking high to low (for normal, AO, ..) in general, right?

    No UV copy/transfer was made - is that correct?

    (Just want to understand this process and save this in my brain, you know) ^^


    Kind Regards
  • EarthQuake
    Options
    Offline / Send Message
    Yes that is correct, I just baked the diffuse the same way you would bake any other map. The UVs for the highpoly were auto generated in Photoscan, so there's nothing special you need to do.
  • Mant1k0re
    Options
    Offline / Send Message
    Mant1k0re polycounter lvl 8
    Wow, I didn't expect it would be so straightforward. Not polished like your work EQ but the plan was to make it as fast as possible from a raw scan to an in-engine screenshot. It probably took me less than two hours shooting included and I never even opened photoscan before. I used my Note 4 at max quality settings for camera - that is to say, total crap. I did a very quick cleaning in Zbrush then decimated the high poly with Polygon Cruncher. Used Xnormal for the bake - thanks for the diffuse bake hint EQ, this is pure gold.

    Here's the original item and its in game cousin (2,305 vertices and 3,933 tris in UE4). Pretty decent for the amount of work involved!

    I' m suddenly itching to buy 40+ cameras and set up a rig in my garage :p

    LgAGQWF.jpg

    ukG7Gh3.jpg
  • tynew
    Options
    Offline / Send Message
    tynew polycounter lvl 9
    This is really awesome. So Earthquake, do you think you saved any time doing this (if so how much?) instead of manually making the Gnome?
  • gnoop
    Options
    Offline / Send Message
    gnoop polycounter
    I use Photoscan for a few years already and still can't figure out why it sometimes does very clean and nice result with even small cracks and even fabric fibers with one camera/lighting and then too noisy geometry with other one.

    Regardless of the camera/optic price. Looks like less bokeh , vignetting soft corners etc, all that photographers seems so fond off, is better .

    So I guess cheaper camera may work better or no worse at least than expensive one.

    Still not sure if image stabilizer helps or not. Sometimes it looks like it works better with IS off . Then no difference or other way around.


    in my experience it's not a huge time saver but rather a way to get very realistic textures since you just can't compete with Mother Nature really whatever time you spend on .
  • Sakey
    Options
    Offline / Send Message
    EarthQuake wrote: »
    Yeah, I had to re-orientate the mesh, it came in not just off axis but randomly rotated. Not sure if that's a common issue.

    Agisoft uses an arbitrary value and scale as it has no reference when building the alignment. You can only scale and use a script to set orientation it in the pro version.
  • gnoop
    Options
    Offline / Send Message
    gnoop polycounter
    You can orient in cheap version too (manually) . It has opto mode and buttons on the top to rotate model and then do the same with bounding box . That box is useful also for clipping the model and output in parts since Zbrush looks like having problems with importing more than 15mil obj from Photoscan
  • gnoop
    Options
    Offline / Send Message
    gnoop polycounter
    https://www.dropbox.com/s/ivi1bh1e8exh8cl/coble.jpg?dl=0


    coble.jpg?dl=0


    it's what i get from Lumia phone. Also on my end Photoscan does make padding. No necessity to do it elsewhere
    coble.jpg?dl=0
  • tadpole3159
    Options
    Offline / Send Message
    tadpole3159 polycounter lvl 12
    This looked way to much fun for me just to sit back and watch, I recently went on holiday to the new forest and amongst the holiday snaps are wierd photos of me spinning around rocks and trees and stuff. Here's what I got using an awful automatic camera and jpegs

    First off I went to the beach
    xhZS9fa.jpg
    peIJGR3.jpg


    This came out really well, If you look closely you can even see its caught things like shells, seaweed and pebbles on the sand. Sadly it's completely useless due to the lighting but like I said I was on holiday and who would go to the beach on a cloudy day?


    zmorDnk.jpg
    BKQhIyM.jpg

    My second test was on a tree, beach got too hot

    trBlIID.jpg
    VUBgfpO.jpg

    This came out great so I did some work on it and turned it into a bit of a model. you can download it on turbosquid for free and poke around it a bit.

    http://www.turbosquid.com/FullPreview/Index.cfm/ID/943340

    I never thought about it until I started to process it but you get these really awesome tiled textures when you completely scan an object, you go right around to the start in a perfect loop, its awesome. Plus you get a height map for free :)

    My next job is to get a DSLR camera and take raw pictures. Gotta get some high quality source, I can see the camera's noise in the models and its getting on my nerves

    after this tiny experiment I'm even trying to convince my bosses to use this in production at work, its amazing what you can capture with a few photos
  • tadpole3159
    Options
    Offline / Send Message
    tadpole3159 polycounter lvl 12
    One more, Came out rather nice too. I missed some of the back of the model though so it isn't perfect but I could clean that up in mudbox in minutes. or I could just take another batch of pictures in about 4 minutes and re calculate

    nJsePVH.jpg
  • gnoop
    Options
    Offline / Send Message
    gnoop polycounter
    In my experience the amount of geometric noise has no connection with picture noise at all. At least until it would degrade crispness a lot.


    Still can't find a proper answer how to get rid of it. Sometimes it's better lighting, other time just proper paralax and overlapping. Looks like anything vivid green and red colored also produces more noise.

    Wonder if somebody uses pro (expensive) version and how it differs in regards of noise?
  • tadpole3159
    Options
    Offline / Send Message
    tadpole3159 polycounter lvl 12
    That horse one above is a fine example of the odd noise it makes. That table in the horse picture above is perfectly smooth.
    I'm assuming like with ndo when you convert a texture to a normal map it's getting some detail from the wood grain texture of the table and making it bumpy.

    Also if your camera has burst mode try using that, I'm getting really good results with it
  • gnoop
    Options
    Offline / Send Message
    gnoop polycounter
    I think the table noise is rather because of not enough well distinguished details to match like those on the horse. Photogrammetry works not very well without a well pronounced texture/pattern.
  • tadpole3159
    Options
    Offline / Send Message
    tadpole3159 polycounter lvl 12
    One last update I swear, This is just to much fun to do! I'm even buying a DSLR to do it properly. For now all i have in my lame compact

    I have a replica terracotta solider in my house and I knew I had scan him eventually so I spent my weekend doing just that. I wanted to make him in the style and quality of one of the chess pieces from one of my earlier projects pure chess
    [ame]https://www.youtube.com/watch?v=YmJNRP_iYio[/ame]

    Like the game I have a polycount of around 8 thousand, a texture res of 2048 and a physically based material system. Here's the final low poly model rendered in marmoset 2.

    I'll upload it to turbosquid during the week, for free of course so people can get a good close up look at photogrammetry in a production. This stuff should be much bigger that it currently is. Were literately capturing reality!

    Now for the best part. This took about 5 hours from start to finish. For reference the chess sculptures in pure chess took about 3-5 days each. A huge saving of time and a huge boost in realism.
    sSFtmPU.jpg

    I've even convinced my boss of its quality and were going to use it in production of VooFoo studios next title :) Thanks so much for the introduction to this earthquake!
  • dorodo
    Options
    Offline / Send Message
    dorodo polycounter lvl 3
    Hey guys! Sorry to bump this thread, but I was just wondering if do you have any clues on how to get a roughness map from the albedo created by photoscan (or if you just make it from scratch).

    Thanks!
  • EarthQuake
    Options
    Offline / Send Message
    There is no real way to automate this, unless you have super awesome material scanning tech like the guys at Quixel. Otherwise, you'll have to make one yourself.
Sign In or Register to comment.