Optimizing scans for game use
I wanted to mess around with using 3D scans for an environment, and kit bash them in a way that could feel unified in a test world project. I found a concept generated online, and wanted to replicate it realistically in 3D.
First I had to get a collection of scans, which I found from Sketchfab. These would be the base of the project. I used these scans in 3 ways :
1 - Direct decimation and use in the world
2 - Baking the scan detail and textures into lowpoly meshes using Mudbox
3 - Using the scans as bases for creating a custom smart material, and then making new assets.
Some meshes needed to simply be cleaned slightly by merging vertices, then decimated. this worked well with the sand pile mesh I used to build up the beach. I knew using the piles wasn't going to be the best for shaping the beach, but wanted to see how close of a result I could be happy with in the quick amount of time it took me to shape it. All in all this technique was used the least.
Here you can see why it was used so little. It made it hard to blend with other pieces, and created "seams" where edges collide.
As for a test though, and for optimizing for Quest / standalone headsets, this would prove to be a quick and optimized way to build the scene.
I've baked texture sets in Substance before, but I needed a tool that could pull textures from a high poly model and bake the already done base color maps onto a lowpoly version. For this I used Maya to create lowpoly versions of some assets, and then went into Mudbox so I could bake the base color images from the scans onto the lowpoly.
This was a nice method of cleaning up a high poly object that may not have been easily decimated. For example, some of the beach transition rocks and pebbles had terrible triangulation and unmerged verts to the point to where any decimation would destroy the model. This workflow recreated the scans in a much more optimal way.
The method I liked the most for this project was taking the 3D scans, making lowpoly versions of the combinations of them in Maya, and then using some of the scans textures to aid in making a unified smart material in Substance Painter.
I used this for all of the bigger rocks. I tried to stick to mostly granite for the shapes that those larger stones can make, but gathering scans from different parts of the world mean that there will be inconsistencies, not to mention the scanning methods and differences with textures with and without hard lighting.
For this I took samples from some of the scans, and began making different texture layers in the material. Some focused on the base materials rocky texture, others focused on veins running through and giving grit, while others drove a difference with ambient occlusion within the cracks. To match the original concept I found online I needed to make sure the stones also had a white appearance. I imagined that near the waterline the original stone materials could come out, while this white variant could be higher up, masked by a 3D linear mask.
I also wanted to use this as an excuse to play with custom mirror meshes in VRC. There are specific parameters needed for a mesh to work with the default mirror shader, like being in the XY plane facing -Z in its own local space, or being scaled to zero in the Z to prevent weird masking issues.
I actually used one of the 3D scans to make a boolean cut on the top of the mirror, and then cleaned it up for use in engine.
I also needed to make sure that the water mirror effect worked both with the world and the other mirror. For this, I actually faked the mirror in the water reflection by having a metallic smooth surface be shown instead of the mirror shader, reflecting only the skybox. I feel it gets the effect done enough to fake it, while again being optimized.
The water shader uses the same shader I made for the Manhattan Apartment project. In short, the shader is a variant off of the original that I modified to include an opacity pass. The goal for using it here was a simple still-water feel that calmed the scene, while allowing for the reflections to be largely visible and the sand underneath it to be also seen.
As this project was just meant to be a test, there are many things I would do to improve on the quality if it was meant for actual use. I feel I brought the poly count too low for some of the rocks, I would make a custom beach asset for the sand, I would've spent more time with the skybox, etc. All in all though I am happy with how the end result came out, and apparently the VRC community did too. When this was published on public, it was on trending within the day, and had streamers, VRC photographers, and players exploring the space. It was nice seeing the community feedback and support for the project!