Art

Create A Selfie-Based Avatar for Somnium Space

VIEW UPDATED TUTORIAL HERE: https://youtu.be/aPjpQkvnJc0

Below is an in-depth video tutorial followed by detailed instructions on how to upload a selfie-based custom Wolf3d avatar into Somnium Space – for free! All you need is a gaming PC, a snack and a drink to follow along (snack is optional, but highly recommended). This tutorial is medium difficulty, so some experience with Blender is ideal. Scroll to the end of this article for relevant links including links to download the required programs.

Special thanks to artists Denevraut, MickyYellow, LevoNotion Studios, and KenoX for teaching me the basics to prepare this tutorial. Be sure to click on their names above to visit their video channels.

Directions:

Go to readyplayer.me and upload a selfie to generate a full body avatar.

When you are finished customizing your avatar, press “next” and use the link to download the .glb file.

In Blender:

Custom Wolf3d avatar in Somnium Space.

Open Blender and select “general” view.

Delete camera, light, and cube in the 3d viewing window by pressing “a” key, and clicking “delete”.

Click file>import>glb and import avatar file.

Go into “shading” tab above the 3d viewing window.

Expand “armature” in upper right window.

Hide “eye left”, “eye right” and wolf3d_glasses” or any transparent mesh by clicking the eye to the right of the mesh names.

In properties window, select uv green triangle.

Create new uv map by expanding the uv map section and pressing the + button to the right of it.

Select the new uv map and make sure camera on the original source is selected.

Click inside the material window beneath the 3d viewer to select it, press F3 or shift+A to search for image texture, and create a new image texture by clicking “new”.

title it “tutorial bake” and change the height and width resolutions to “4096” px. 

Uncheck “alpha” and press “OK” to finish.

Right click the new texture box, click “copy” and then paste the new texture into every other mesh in the file tree window (except for the eyes and glasses). Make sure that the new texture is selected within each mesh you’ve pasted it into.

In file tree section, hold down “CTRL” key, and select every mesh in the armature section (except the eyes and glasses).

Go to the “UV editing” blender tab and right click the uv map to the left of the 3d viewing window and click “unwrap”.

On the bottom left of the uv map window, expand the “unwrap” menu, and change the margin to “0.02” and hit the “enter” key.

In Properties window, select the little camera and change render engine to “cycles”.

Change device to “GPU compute”.

In sampling change render to “8”.

Go to bake window and change to “diffuse” bake type, and then uncheck “direct” and “indirect” so only “color” is selected.

Click “bake”.

Go to the “texture paint” tab in the upper Blender menu and click “image” and “save as” and save the new texture into a new folder for all the avatar components.

Go to “shading” tab.

Select each mesh (except eyes and glasses) in file tree window, one and a time, and replace the old  “base color“ texture with the new texture we’ve just backed within the material window. Link color outputs in the new texture to color inputs in each mesh.

now, select each individual mesh and in material window, create a new image texture again by pressing F3 or shift+A to search for image texture, and create a new image texture by clicking “new”.

Call it “normal bake” and change height and width to 4k resolution (4096px) each, and copy and paste the new normal texture into every mesh with normal maps (except eyes and sunglasses).

Within file tree window, select every mesh “except glasses and eyes” while holding down “CTRL” in the file tree .

Go to little camera tab in the properties window, scroll to bake section and change bake type to “normal”.

Click “Bake”.

Djembe Dragonfire’s Wolf3d avatar at his weekly virtual concert every Wednesday at 1pm PT.

When it’s finished baking, go to “texture paint”, click “image”, and save as “tutorialnormal” into your avatar folder.

From the file tree, select each mesh (except glasses and eyes) that contains a normal map, and delete the old normal map to replace with a new one. Make sure to link the new normal texture box to the material with a normal map, by pressing shift+a and searching for “normal map”, selecting it, and putting it between the new normal texture and the material. (In the attached video, we missed this step and had to go back.)

In file tree, select first mesh and in properties window, select red ball tab.

In top section of the red ball tab, delete the original material by selecting it and clicking the “-“ button to the right of the window, and create new material called “tutorial material “ by clicking “new”, typing the new name and clicking “enter” key.

Select the new “tutorial material” in every mesh except glasses and eyes.

Select every mesh in the file tree (except eyes and glasses) by holding down CTRL key and clicking each mesh.

Create new diffuse and normal image textures and link to new material by selecting the 3d viewing window, pressing f3 or shift+a and searching for “image texture”. Select new image texture and press shift+d to duplicate texture. In one texture box, select the dropdown menu in the upper left and choose “tutorial bake”. In the other box, select the dropdown menu in the upper left and choose “tutorial normal”.

Link the first texture “color” to “color” in the material and link the second texture to “color” to “normal” in the material.

Double check in the red ball tab within the properties menu and make sure the the “tutorial material” is selected within each mesh (Except glasses and eyes).

In the green triangle tab in the properties window, delete original uv maps for each mesh we’ve baked textures for. Make sure the new uv map is selected.

Hold down ctrl, select all the mesh we’ve worked on, press file in top menu, click export, and export as .fbx. Title your avatar and save it in your avatar folder.

In the file tree, unhide the hidden meshes by clicking the small eyes to the right of the eyes and glasses mesh.

Select the eye mesh and click inside the material window below the 3d window, click f3 or shift+a to create a new texture, click “new” and title it “eyes diffuse” and click “ok”. 

Make sure that the new textures within eye left and right are selected.

In Properties window, select the little camera and change render engine to “cycles”.

Change device to “GPU compute”.

In sampling change render to “8”.

Go to bake window and change to “diffuse” bake type, and uncheck “direct” and “indirect” so only “color” is selected if it’s not already set up that way.

Click “bake”.

Artist KenoX’s readyplayer.me avatar.

Go to the “texture paint” tab and click “image” and “save as” and save the new texture as “eyes diffuse” in your avatar folder.

Go to ‘shading” blender tab again.

Select eye meshes in file tree one and a time and replace old texture with new texture in their material windows. Link color outputs of new textures to color input in each mesh.

In file tree, select the “glasses” mesh and click inside the material window, click f3 or shift+a to create a new texture, click “new” and title it “glasses diffuse” check “alpha”, and click “ok”. 

In the properties window, go to the camera tab bake section and change to “diffuse” bake type, and uncheck direct and indirect so only color is selected.

Click “bake”.

Go to “texture paint” tab, click “image” and save the new texture as “glasses diffuse”

Go back to shading, select the “glasses” mesh in the file tree and delete the old base color within the material window. Replace it with the new texture we’ve just baked and link  the color inputs and link “alpha” to “alpha”.

Press F3 or shift+a to create a new texture, name it “glasses roughness” make sure it’s 4k resolution, select alpha, and click “ok”.

Go to bake window and change to “roughness” bake type.

Click “bake”.

Go to “texture paint” tab, click “image” and save the new texture as “glasses roughness”.

In “shading” blender tab, go to the material window, delete the old roughness texture, and link up the new one. Press shift+a and search for “separate RGB” and put it between the texture and material connection.

In Unity:

Artist Ultralord installing his selfie-based avatar within Unity.

Open Unity and click “new”, “3d” and name your avatar and click “create”.

Open Somnium Space SDK. Log in to Somnium Space.

Go you scenes. Create new folder called “materials” and another new folder called “textures”.

Drag in .fbx that we exported from Blender, select it, and click “extract materials” in the upper right window, and export the materials into the new “materials” folder.

Open new “textures” folder and drag in all the textures we baked and saved from Blender.

Click each texture to change texture types to Sprite/2d if it’s colorful or “normal map” if it’s a violet/purple color normal texture.

In “materials” folder, select the first material, and go to “textures” and drag the corresponding textures into their correct slots as demonstrated in the tutorial video.  Repeat for the rest of the materials. (Put diffuse textures in “Albedo” slot and normal maps into “normal map” slots.

For transparent material, change the “rendering mode” to “transparent”, click the color box, and use the “A” slider to adjust the transparency.

From the left menu, drag the new avatar into the scenes folder and import it as a “prefab variant”.

select “upload scene” section and save progress.

Drag the new “prefab variant” into the “Model pivot drop your model here” section.

In upper right to the right of “transform”, click the gear button and select “reset” to position the new avatar correctly.

In the left menu, select “body builder” and at the top of the right menu, uncheck the box next to the name.

Select the new avatar variant in the left menu, and go back to the right menu and click “add component”, “avatar configuration”, choose the gender, expand “lip sync”, select “morph” as the sync type, and click the circle to the right of “morph mesh” to select “wolf head”. Make sure the “blend shape name” under “morph mesh” says “mouth open”.

Make sure that the avatar is selected in the left menu, click “Somnium SDK” in the top menu, and select “build and upload”.

If all the errors are clear, click “build.”

When a new window pops up, name the avatar, and fill in the description if desired. Check the box on the bottom of the window to agree with terms and conditions, and press “upload model”.

Wait for “upload success” window and click “ok”.

In Somnium Space PC Client:

Launch the Somnium Space launcher, and click “PC Client”.

Once it opens, select “avatar” at the bottom menu, and then use the arrows to choose “custom” in the avatar visualizer. Choose your new avatar from the left menu, and hit “use avatar” above it to finish installation.

Links:

Somnium Space Unity SDK Step-by-step Instructional PDF:

Wolf 3d Selfie-based Avatar Generator:

http://readyplayer.me

Blender 2.92 

http://blender.org/download

Unity 2019.2.4 

https://unity3d.com/get-unity/downloa…

Somnium Space SDK:

https://somniumspace.com/files/SomniumSpaceSDK.unitypackage

Somnium Space 2d/VR/PC Client Launcher:

https://www.somniumspace.com/

Oly (@olysounds) is an interdisciplinary musician, writer and explorer.

Check out her music and other projects at solo.to/olysounds.

Categories: Art, How To

Tagged as: , , ,

1 reply »

Leave a Reply