Game Development Community

dev|Pro Game Development Curriculum

Photogrammetry and Torque 3D: Week 3 -First Results!

by Ron Kapaun · 11/25/2014 (4:34 pm) · 32 comments

Photogrammetry and Torque 3D: Week 3 -First Results!

As many of you already know, I have been experimenting with a different way of producing models for game engines. I started off working with laser scanning and have since moved over to Photogrammetry. What is photogrammetry you might ask. Well, according to wikipedia photogrammetry is the science of taking measurements from photos and extracting exact positions for surface points. Sounds complicated and well, you would be correct in that assumption.

I was first introduced to this method of modeling when I purchased and played 'The Vanishing of Ethan Carter' created by 'The Astronauts'. They are a group of Polish game developers who split from Epic Games Poland aka 'People Can Fly' whom you may know from titles like 'Bulletstorm' and 'Painkiller' as well as ports for Gears of War. I enjoyed many of those games but, I can not ever recall being 'floored' by the visuals.

After playing the game, I started doing what I always do. Researching methods for how I could 'incorporate' more of the real world into my virtual worlds. Like I said, I already own the David Laser scanning system and it does really well for certain things. However, giant boulders and crazy dead trees and large areas of 'nature' are just not suited for scanning (at my price range anyway.)

ENTER PHOTOGRAMMETRY

The system that The Astronauts used to create most of the game assets in TVoEC was Agisoft PhotoScan. This is a neat little piece of software from a developer in Russia. I initially checked it out but, I was a tad 'sticker shocked' by the 'Pro' edition price. So I left and went back to my laser scans. I got involved in a conversation on one of my blogs here and found out I was mistaken. I did not need the 'pro' edition for what I wanted to do. I am not planning on measuring archeology sites or documenting the flow of rivers or any of that other crazy stuff. So I returned and found the Standard Edition for around $180 US Dollars. I tried it before I purchased it using a 30 day trial. I did 2 sets of 'scans' and I was SOLD.

So, I am currently learning Agisoft PhotoScan Standard Edition. You can see more about this nifty piece of software by following this link; www.agisoft.com. The concept is pretty simple, you take a series of photos of an object. Put those photos in the software and magically it produces a 3D model. Sounds simple, alas there is much more to it.

I started out with just my trusty 14 megapixel GE400X camera, a crap load of batteries and a dream. Needless to say, the equipment has grown a tad. I am still using the same camera but, now I drag along a bag with 'markers', tape, a solid tripod, a crap load+ of batteries, my trusty laptop and a bunch of SD cards, tape measure and laser line level and pointer (don't ask).

I had to re-learn photography. The closest I can compare photo-scan photography to would be texture photography. No harsh shadows (I live for cloudy days now), low ISO, no distance blur, no digital zoom, cut back on the Monsters (gotta have steady hands) etc. Then you have to walk around in circles taking photos (I mean that literally.... circles.) Some of the images below took anywhere between 50 and 120 individual shots, and I should have done more on many of them. At 14 megapixels per picture that is a TON of visual data. All those images eat up 16 gigs of ram on my development machine FAST. It's no joke, the software chews up ram like crazy, also I HIGHLY recommend a Geforce video card. They incorporated CUDA into the point cloud analyzing segment of the process and the GPU helps speed up the processing time GREATLY.

So, my first couple of simple experiments went ok. You can see some of the results below. These are all rendered in Blender using the Cycles Renderer.

3tdstudios.com/images/blogs/treeRock_01.jpg.
3tdstudios.com/images/blogs/Boulders_01.jpg.
3tdstudios.com/images/blogs/GoundRock_02.jpg.
Not bad but, how the heck do I get these high poly models into Torque? (Some of these are over 1/2 million polys ALONE.) Not only that but, I uninstalled 3D Studio Max and now I am ONLY using Blender. Well, BACK to the research. I have been experimenting and working out a solid workflow in order to make this happen. Alas, I have some results I am happy to show. Keep in mind these are experimental images and I just tossed them into my current build of T3D. The only major things I did to my build was incorporate Verve, the DirectX 9 Refactor, and a bunch of other little 'fixes and tweeks'. For the most part, it's stock T3D.

3tdstudios.com/images/blogs/screenshot_01.jpg.
3tdstudios.com/images/blogs/screenshot_02.jpg.
3tdstudios.com/images/blogs/screenshot_03.jpg.
3tdstudios.com/images/blogs/screenshot_04.jpg.
So, using NOTHING but Blender, Meshlab, and a TON of photos I am now able to produce these simple shots. (basically just to test the lighting and performance.) Heck, I even used the default tree just for leaf shadows. The maximum poly count is 2K for one model (that would be that little model with the dead tree growing out of the rock.) The lowest poly count is 250 (the path pieces) All of the models are also HEAVILY LODed. I am pleased so far with the results. It sort of reminds me of Crysis (the original) on Max setting for PC. The textures are still a bit muddy but, that is my workflow, NOT the system. Heck the original textures on the high poly models are actually true 4K images. You can zoom in and count grains of sand on those. So the texture problem is in my workflow. You will note some spots where they look almost 'smeared'. I think that is a bad "Object Cage' when baking the diffuse in Blender.

SO, WHAT IS NEXT?

Like I said, I am not thrilled with the texture quality on the low poly versions of these models. They could be better and once I get my brain more wrapped around Blender's 'cage' system for baking textures I am sure I can improve them even more. I am able to make really nice normal maps from the high poly models and project them onto the low poly model properly so, it has to be something with sample sizes or the cage is not properly aligned.

I started small, little rocks, twigs, ect. I moved up to objects (most are in the screen shots) that are slightly bigger than cars. Therefore, my next step is buildings. I think I have a system planned out that will allow me photo-scan the exterior and the interior of a building and merge them together. I will start with exteriors and interiors alone first, then move on from there. I also intend on mocking up a small interior project for testing with the Rift.

People/Humans, yep I am going to try photo-scanning a person. I am in the process of building a neat little rig that will allow for overlapping photos that can take photos from a set point on a set of outer rings that encircle the subject. This way I can use one camera to take the photo set. (Many large studios use multiple cameras and a geo-dome looking rig but, I am not that wealthy so, gotta make do.)

Basically, I need to build a HUGE library of this stuff. Thankfully, between my laptops, and my desktops I can have machines grinding on this stuff pretty much 24/7 for awhile.


IN CONCLUSION

Overall, I think this system of working will become my new 'norm'. Since the higher quality meshes are faster to produce, look better in the engine (in my opinion) and add the level of realism I have been after, I can't see going back to my old methods. Once I get a solid flexible work flow in Blender outlined, I will post it for everyone to read and review. (I may do a series of video tutorials on this whole process as well...I don't know yet. I am still pretty 'clunky' in Blender but, I should get more efficient as I go).

The last stage will be building a demo level in T3D/UnReal and Unity and video to show off what can be done. More to follow on this grand adventure. Thanks for reading and if you have any questions feel free to ask. I am by no means an expert but, I will try and help.

Ron
Page «Previous 1 2
#1
11/25/2014 (6:07 pm)
That's looking fantastic already! Blurry textures aside you've got a really good thing going. Can't wait to see what you do with it!
#2
11/25/2014 (6:37 pm)
Can you get an even closer zoom? Is there a worm under the rock or what. I bet you can make pretty convincing veggies for catapillars to eat up.
#3
11/25/2014 (6:52 pm)
Did not expect it to look that good in Torque almost like real, maybe too blurry in close view.
But I wonder how you want to build complete scenes out of that, to me it sounds like a lot of work and thousands of photos.
#4
11/25/2014 (8:14 pm)
Wow that looks great! How easy is it to get the models geometry properly optimized from this process?
#5
11/25/2014 (9:13 pm)
amazing work Ron! but yea as i have mentioned this as a let down in presenting content and scenes, there's that torque haziness signature render to it. just saying..

anyway, nice experiment and keep it up. you're still doing great!
#6
11/26/2014 (2:01 am)
It looks very nice already Ron, nice work.
#7
11/26/2014 (5:15 am)


Ron, This is quite astonishingly good stuff. I'll have to check out this software for my science work. The models it produces are super realistic...
#8
11/26/2014 (7:07 am)
impressive beauty and detail, but a very large ...
#9
11/26/2014 (7:14 am)
i.imgur.com/U7Fod.jpg
That's some pretty impressive stuff right there! Nice work, Ron.
#10
11/26/2014 (7:17 am)
Some sweet-lookin' stuff Ron - as usual.
Quote:
I am in the process of building a neat little rig that will allow for overlapping photos that can take photos from a set point on a set of outer rings that encircle the subject.
Why not make a "lazy Susan" and just turn the subject? Have them stand in a good root pose and just spin them around. That way you don't have to do anything crazy with the rest of the room - just put it next to an empty white wall and shoot away.
#11
11/26/2014 (7:26 am)
C'mon that's not T3D you gotta be using unreal 5 or cryengine 3.. ;) J/K
but seriously those are some amazing screenshots and in T3D too!! :D
I can't wait to here more about the process. My brother and I will be publish our first game soon and have been looking for another method for creating models, this maybe it! Again really good looking models...
#12
11/26/2014 (8:18 am)
Actually Ron, if you have the time, could you post a pic showing the wire polys in Blender (post reduction for exporter to Torque) for these models. Interesting to see what they look like.
#13
11/26/2014 (9:28 am)
Quote:
Why not make a "lazy Susan" and just turn the subject? Have them stand in a good root pose and just spin them around. That way you don't have to do anything crazy with the rest of the room - just put it next to an empty white wall and shoot away.

The problem is, photogrammetry uses the background to tell the software where the camera is in relation to the model being scanned.

So if you have a totally blank background, or the object moves but the background doesn't, the software can't figure out where the images are placed in world space, so it can't reconstruct it.


@Ron
Looking good on the results! I haven't been able to do much on my side with this as the weather's been pretty garbage recently(windy, snowy, etc).

What resolution are the textures for the in-game models currently?

I'd also suggest, when you get the cage issues figured out, to try and bake height/displacement data and set your t3d mats to use parallax. I'm curious how much of an impact it'd make for the small surface details(like those little rocks and pebbles). It could add even more to the results.
#14
11/26/2014 (1:20 pm)
Can't it do reconstruction from points on the object itself?
#15
11/26/2014 (1:40 pm)
Yeah, then they're doing differently now - the last time I saw software for this all you needed was an object of known size in the picture (like a yardstick - especially good because it provides size and orientation) and a relatively crisp image. But that was 15 years ago....

So, option 2: build a circular model train track at about waist height around the subject location and place the camera on it. Use that cool sport-rapid-snap mode to take a bajillion pics as the train circles the subject. Probably not steady enough....
#16
11/26/2014 (3:20 pm)
Thanks everyone. Glad to see people are interested in this process.

@Steve ;-) Here, I did ya one better. This shot is a comparison between the 'master mesh' and the low poly game version. As you can tell, the normals and everything make a huge difference in the detail. This is one of the 'ground' models. Around 200 polys total.

3tdstudios.com/images/blogs/Decimate1.jpg
@Jeff, Currently the 'master texture' is 6240 X 6240 (HUGE), I think the issue is the 'cage' that I use to bake the textures. The in-game texture is scaled down to either 1024X1024 or 2048X2048. I LOVE your idea for baking in the depth. Should really add to the detail. Thanks.

@TurnTable Peeps,
I have a 'lazy Susan' system in place and working. You MUST add markers (in my case I have fancy grids that I 'borrowed' from my laser scan system. So it is possible. However, this system REALLY seems to work 10X better when the camera moves around the subject. Hence my rig work. I will post WAY more images and stuff concerning all of this stuff.

Richard.... LOVE the train idea but, a bit of overkill ;-) I basically just built a circular pipe on an expandable set of legs. The pipe has screws mounted in it at measured distances. The camera mounts to the screws and I have calculated the proper overlap. It's 30 pictures to get a good model. Simple but it works. I also spaced the rig out so that I can do an entire body in 2 to 3 sets (depending on how tall the subject is). So, 60 to 90 shots total. About 10-15 minutes of the model standing around. For NON-humans... I can expand on that number of shots. Humans tend to want to move and stuff :-)

@GamerX, I agree, T3D has a certain 'look' however, this was not a test for 'photoreal' Basically. I set the light color, and that was it. To compare, in my Conifer Forest Pack, I worked for almost 20 hours to get the light correct. Africa Pack was a couple hours longer. T3D can do what you need. You just need to know what all the 'widgets' do. As an example (to the group, not pointing fingers at GamerX) what does rayleighScattering truly do? Or, logWeight (shadows)?, or what happens when you adjust the attenuationRatio?

These are all important values and I REALLY need to do a proper article/ tutorial concerning the light and shadows in T3D. YES, Daniel! I am working on one. These Steering Committee guys... LOL (j/k). (Oh, and from one artist to another 'hint', Check out the source code... there are SO many variables associated with lighting that do not have direct exposure through the tools interface.) It takes a HUGE amount of time to work this stuff out. I started work on a 'new' interface for those tools before I left the steering committee but alas, UBER models and 3D keep dragging me back. Wow, sorry.

GamerX, I agree with your initial assessment. It looks like 'Torque'. That was intentional. (aka WTF... Ron can make WAY better trees...why is he showing the default?) For this community, this is a very 'new' process and completely odd. So, I wanted to ensure everyone knew this is 'pure' T3D. Heck, if I wanted to, I could have used my 'CinemaT3D' build to show off ;-)

@Duion, It's really NOT that bad. The software compensates for a lot of stuff. Here is the one simple and true key to developing for this system, If the camera can't see it, then the model will have a hole in it. Trust me, I have plenty of models that show that off. In Fact here is a GREAT example of one of my F*** ups:
.
3tdstudios.com/images/blogs/HOLES.jpg.
It sounds like a TON of pictures but, when you have a plan, and a system worked out. Its FUN. Yep.... FUN! I actually look forward to cloudy/crappy days... because I grab my camera bag... with all the extra gear, and head out to 'make 3D stuff'. This tech has 're-launched' me actually. If I had to sit through one more session of 'sculpting' a damn rock, I would have just died. Keep in mind I have been doing this crap since 1998 and well, the techniques have not changed much over the years. We added normals, depth maps, etc but the models... still simple 'representations' of what we want to convey. Now, I am getting a feeling of 'reality' and I really think with a bit more time, I can produce 'game art' that is equal to my high poly (aka this is a freakin movie) art.
@Matthew
Highly recommend this software. Not only am I able to produce this stuff but, if I HAD the money... I would be all over this thing for ANY environmental science. The PRO version allows for a HUGE number of scientific measurements. Just check out some of their 'demo' videos. I am NOT even scratching the surface of the 'important' aspects of this software. (I want to REDO the Cave Pack Pro.... USING A REAL CAVE) Right now, this is the best when it comes to cost vs. value.

Ron
#17
11/26/2014 (4:00 pm)
Good to know it can work as long as the model has reference spots.

I'd suspected it might, but the only examples I'd seen indicate you want the camera to move, not the model.

So hey, learning everywhere :D

I planned to do some more work on this stuff from my side as well this weekend(4 day weekends! woo!).

One thing I'd thought of that I was going to try for human models that may be worth a shot for you if you beat me to it:

If you're going for a A or T pose, you could look at having fishing line loops at the appropriate height they can put their hands through, and it'd take a lot of the stress of the model while you take shots.

The fishing line shouldn't show up in the shots at all, and it'd make the process a lot faster if the model's arms aren't tiring out. And if they have to take a break, you can't be sure they get their arms in the right position again, which can scrap the set.

If I do it before you, I'll let ya know how well it worked.
#18
11/26/2014 (4:42 pm)
Jeff,

Good idea about the 'placement' markers/suspension system however, (This is going to sound a little odd.) My suggestion is make the Human match your bone structure. So, what I have done in the past (for texture work etc.) Superimpose a single photo of your Human over your Bone system/model (in whatever software you are using). GIMP, PShop, etc can do that easy enough. Then measure the distance from the floor (for the hands and stuff) that way you can 'adjust' without having to take the time to readjust the stings or markers. Just a thought. Its one shot and takes just a minute or two to get it set correctly (poor mans mocap solution as well ;-).

Ron
#19
11/27/2014 (4:13 am)
Impressive results :)

You could only imagine some of the results you would get if someone where to implement virtual texturing ( mrl.cs.vsb.cz/people/gaura/agu/05-JP_id_Tech_5_Challenges.pdf )
#20
11/27/2014 (2:37 pm)
thats great Ron. ok I see. but why not show it in its full glory? CinemaT3D hmmm... can you share your work or is this still unstable or for what reason? just asking
Page «Previous 1 2