Posted on Leave a comment

Creating 3D Models From Photos Using Meshroom

Meshroom is a new, free and open source photogrammetry software from AliceVision.  Photogrammetry software enable you to create a 3D scene using a series of photographs, generally the more the merrier.  Currently documentation is a bit lacking, so I’ve decided to create this quick tutorial.  In this tutorial we are going to quickly walk through the process of using Meshroom using a photoset available here.  That post links to a zip file containing 50 images that are confirmed to work with Meshroom.  Simply extract them somewhere on your drive.  Of course you need to download Meshroom, which is available for download right here.  Simply download the archive, extract then execute the Meshroom application.  Note Meshroom requires a CUDA GPU and works on Windows and Linux!  So this process will only work on nVidia GPUs, at least as of time of writing.

Once you’ve got Meshroom loaded, follow the following simple steps.

Drag extracted images into the Images pane on the left.

image

Save your project somewhere

image

Click the green Start button.

image

As it’s running, you will see the progress across the top:

image

This bar indicates a problem occurred.  You can divine more details by locating the current task in the Graph, like so:

image

With the node selected, check the Log (bottom right corner) for details.  This is the error message you receive if you run the process on a non-CUDA (nVidia) GPU.  Keep in mind, it can also be caused by the process running on a laptop with Optimus, not automatically selecting the right GPU.

image

Hopefully however you encounter no such errors and the process is entirely green.  On the bright side, it should pick right up where the error occured if you run the project again in the same directory, as Meshroom caches the results of each step as it goes.  You will find the vast majority of time is spent on the DepthMap section,  this is normal.  As the process continues, you should start seeing results in the 3D viewer.

image

You can pan, zoom and orbit the mouse using the LMB, scroll wheel and MMB respectively.  More detail in the point cloud will fill in as the process runs.  Once it completes successfully, you will see a button Load Model.

image

You can now preview the results of your effort!

FinalGif

A few steps in, it will have evaluated all of your photos, acceptable/usable photos will be marked with a green checkmark.

image

Review the remaining photos for flaws and inconsistency if you run it again.

Go make some tea… it’s going to be between 10 minutes and an hour depend on the speed of your machine.  Once the process is complete, there will be a folder called MeshroomCache, with the following contents:

image

This is a folder with all of the output files from each step in the process.  Generally what you are going to be interested in is the obj, mtl and texture file in the Texturing folder.  This can be imported into your 3D modelling application of choice, the obj format is fairly universal.  The resulting mesh is extremely dense and you may consider checking out Instant Meshes for optimizing the results.

Now that you know it works, it’s time to start refining the process or providing your own picture set.  I would recommend the following tips from my own experience:

  • use an actual camera, not a phone.  I got terrible results from my Pixel phone, but my Canon DLSR gave much better results.  YMMV
  • DO NOT green/white screen your background.  Unique markers in the background help Meshroom position each virtual camera
  • try to get the entire object in frame on each shot
  • get rid of any image with any blurring

So far we just default settings in the Graph Editor.  This graph represents a graph of nodes in the process, one for each directory shown in the screenshot above.  Note when you select a node, there are a number of properties you can edit:

image

You can also connect pins to multiple nodes to create multiple results.  For example, if you wanted to create a set of TFF and lower resolution PNG textures, you can do the following.  Right click the graph editor and select Texturing:

image

This will create a new node in the graph.  Now drag the output node from MeshFiltering and connect it to ini and inputMesh.

image

Select the new Texturing node and have it create a lower detail texture set:

image

Now when it runs, it will create two sets of textures for you.  Note there are other nodes such as Decimation that aren’t in the process by default.  You can see the entire thing in process in the video attached below:

[embedded content]

Art


Posted on Leave a comment

Materialize Free Texture Map Generation Tool Released

Materialize was just released for free.  What exactly is Materialize?  In the creators own words:

Materialize is a stand alone tool for creating materials for use in games from images. You can create an entire material from a single image or import the textures you have and generate the textures you need.

Materialize is production tested, having been used to generate metallic, smoothness and occlusion textures for the Uncharted collection.  It is very similar in scope and functionality to Substance’s B2M or the free ModLab.

Essentially you start by feeding it a diffuse map, which you can then edit as you desire, then create a height map, normal map, edge map, smoothness map, AO map and metallic map automatically.

image

Each step of the way you have fine tune control over how each individual map is created.  For example, here are the controls governing the creation of the normal map.

image

You also have the ability to provide your own maps from file if you have them, simply use Materialize to generate the maps that you are missing.  There are also features in place for creating tiled maps.  Of course to go along with all of it, there is a real-time preview of the map you are creating, including multiple skyboxes and control over the post processing effects show in the preview.

realtimePreview

When you are done you are able to export your generated maps to a variety of different texture formats.  Just an all around amazing application and one that should be added to every texture makers toolkit!  Watch the video below to learn more and see Materialize in action!  There are also some tutorials available here if you wish to learn more.

[embedded content]

Art GameDev News


Posted on Leave a comment

Armory Game Engine Tutorial Series

If you’ve recently been to the GameFromScratch tutorial series page recently you may have noticed the addition of a new Armory game engine tutorial series.  It’s not actually hosted on GameFromScratch, instead it’s on our newly launched sister site (watch out, the paints still wet!) DevGa.me.  Don’t worry though, nothings changed, it’s just a newer, cleaner, ArmoryDevGame900x600mobile friendly home for tutorial series, I’ll explain more about this later.  For now, just be aware there is a new text and video based tutorial series on the Armory game engine under development!

Armory (or Armory3D) is a newly free open source cross platform game engine that runs inside and tightly integrates with the Blender application.  If you are interested in learning more about Armory and why I’m so excited about it, be sure to check out Introduction to Armory video.  The series is still quite young but already there is a fair bit to get you started.  Right now the series consists of:

The entire series homepage is available here.

Additionally the video series has begun, lagging slightly behind the text series.  So far videos consist of:

There is a (very small for now…) playlist available here.

DevGa.me is not a blog format and does not have any news, it’s just home to tutorials.  I will however announce new tutorials here on GameFromScratch, so stay tuned!  If you want to discuss the new series, there is a conversation over on the Armory discussion forums or leave a comment below or on YouTube.

Programming, Art ,

Posted on Leave a comment

A Pixel Perfect Camera in Unity

If you are a pixel artist, one of the most challenging tasks you have to deal with is handling multiple resolutions and aspect ratios that your game might run at.  Thankfully if you are using the newest (Unity 2018.2b3 or later) version of Unity there is now a new component that makes this job borderline trivial.

Announced in the following tweet:

image

You can download the component and a couple sample scenes here on Github, and you can read more about it here.

The 2D Pixel Perfect package contains the Pixel Perfect Camera component which ensures your pixel art remains crisp and clear at different resolutions, and stable in motion.

It is a single component that makes all the calculations needed to scale the viewport with resolution changes, removing the hassle from the user. The user can adjust the definition of the pixel art rendered within the camera viewport through the component settings, as well preview any changes immediately in Game view by using the Run in Edit Mode feature.

Using the camera is simple, once the package is installed, it’s simply added to a camera and configure:

image

Your game should now scale gracefully across resolutions and aspect ratios.  To see the Pixel Perfect Camera in action be sure to watch this video, also embedded below.

GameDev News, Art, Programming

Posted on Leave a comment

Blender Game Engine In Blender 2.8–Life After Death

Last month we reported that Blender Game Engine (BGE) was being removed entirely from the source code of Blender for the upcoming major 2.8 release.  Judging by the comments section this was certainly a polarizing decision, with replies basically falling into two camps.  On one side there was a lot of “good riddance to bad rubbish” type replies, while in the other camp it was mostly “I’m done with Blender if this happens”.  Clearly the decision impact enough people that something had to be done.  Well, that something was just announced on Twitter:

image

The linked article from the developer mailing list:

Hi all,

The Blender Foundation Development Fund has reserved a number of bigger donations (also on donator’s request) for game engine and interactive 3D related features.

Now 2.8 is getting shaped up, it was time to check on this topic. Yesterday afternoon I met with Benoit Bolsee and a couple of Code Quest participants, to discuss the future of Blender’s real-time 3D needs and “interaction mode”.

The outcome is that Benoit accepted a grant to work as designer and lead developer for one year on bringing back a good real-time interactive 3D system in Blender. He will do this part-time, in average 1.5 days per week, starting July 1st.

Obviously all work and further discussions will be done in public; using our regular channels (mailing lists, code.blender.org, developer.b.o, devtalk.b.o). Help from other Blender developers is very welcome. This will be further announced when Benoit starts.

To summarise, work will first be done in two areas;

– Implement a high quality real-time viewport with physics/event handling. This should result in a pleasant & usable environment to setup and bake simulations.

– Design and prototype a new nodal logic system.

Related to this work is also to enable good support (export or some kind of integration) for external game engines such as Godot, Armory, Blend4Web, Unreal, Unity, etc.

I especially invite the first three (open source) projects to connect with us to find ways to keep a high level of compatibility.

Work on typical GE features such as super-fast drawing (LOD, etc) are welcome too but should be part of the regular work on Blender’s viewport and our internal drawing engines. That way everyone benefits. Laters,

-Ton-

Blender Game Engine is not coming back, but a great deal of the functionality that was removed with it will be returning. Additionally Blender will be working directly to support Blender as a game development tool for existing game engines.

<font face=”Calibri”></font>

Art, GameDev News, Programming ,