Professional Services
Order outsourcing

Recreating Mars Bars in 3ds Max & Substance 3D Painter

Pete Mc Nally told us more about recreating chocolate bars with 3ds Max and Substance 3D Painter, detailed the photogrammetry process, refining and texturing stages, as well shared how renders were improved with Marmoset Toolbag's lighting system. 

In case you missed it

You may find this article interesting


I'm Pete, a 3D Generalist in game art, as previously introduced by 80 Level in this article. As my work is varied, I like to practice material and surface creation when time allows, especially everyday things that have interesting properties. CG food is tricky to get right, and that's one of the reasons I chose it as a subject to practice. I figured it'd be a good measure of a successful project if the renders could evoke a feeling of hunger or craving. 

I recreated some digital food in the past on gastronomical delights such as chicken wings, croissants, apple pie, and pizza. Scanned food is an interesting mix of hand-painted roughness and sub-surface maps while preserving the organic detail from the scan base color, so there is a heavy art portion after photogrammetry. 

It was also just after Halloween, and there was a lot of chocolate in the house from the kids trick-or-treating. They're not so fond of Milky Ways and Mars bars, so there were a bunch left over. I thought the chocolate surface could be an interesting one to reproduce digitally. There's the smooth chocolate shell, the more fluid caramel inside, and the soft nougat below.

Here's the reference photo used in photogrammetry:

Photogrammetry Process for Chocolate Bars: Smashing, Shooting, and Processing

I smashed a few chocolate bars by pressing down on the shell and then pulled them apart into two halves. I wanted cracks in the chocolate and the caramel to stretch and leak. After finding one I liked, I placed it on its torn wrapper on a plinth in the garden on an overcast day and shot about 60 images for the Mars bar and 72 images for the Milky Way.

I used RealityScan for the photogrammetry. Although I figured the small scale of the bars could be an issue, along with the metallic-looking parts and thinness of the wrapper, I liked RS for the job because it has a really useful 3D overlay that shows your photo coverage in AR over the camera view. Camera control in RS is stripped right back, so there is no fiddling with exposure, etc. The scene can be cropped directly on your mobile device, and then processing for the final model is done in the cloud, which you can access via Sketchfab (an account is required for this).

Results are decent but don't expect fine detail on an object like this. It's a good start on a 3D model and base texture if you're comfortable with manual mesh cleanup.

Here's the 3D model from RealityScan in 3ds Max:

Refining and Texturing Chocolate Bars in 3ds Max & Substance Painter

I used the detailed quality mode for processing and downloaded an FBX from Sketchfab, along with textures, to clean in 3ds Max. To clean the model, firstly, I deleted any floating islands and used the Slice modifier to remove additional unwanted geometry around the base. 3ds Max's Retopology modifier did an excellent job of unifying polygon density across the mesh and reducing noise.

I separated the chocolate part from the wrapper underneath and patched up the resulting holes using Bridge and Cap in the Edit Poly modifier. Then, I added another Retopology modifier to the wrapper geometry and manually unwrapped using point-to-point seams and Quick Peel with the Unfold option.  Additional detail was added to the wrapper in the form of wrinkles, which I used PolyCloth to brush in. I baked Diffuse and Normal Maps in 3ds Max. It became apparent that much of the texture would need to be painted over due to the baked-in highlights and shading, so I exported it to Substance 3D Painter. 

I extracted the scuffs and heat damage from the original scan in Photoshop and applied this as a screen blend layer above a flat brown hue for the chocolate. The chocolate albedo color ended up being a lot lighter than I was expecting to be PBR compliant. I took the base color from Substance Painter into Knald to generate fast Normal and Convexity maps, which add pixel-level detail to the existing normal, AO, and base color bakes. All textures were baked at 4K.

Below you can find the material painting in Substance 3D Painter.

The key to the believability of the chocolate bars was sub-surface scattering, especially on the caramel. I switched to raytraced mode and set the scene up in Marmoset Toolbag with the textures baked from Substance 3D Painter. Firstly, I dialed in a volumetric scattering amount that I felt worked for the thin caramel.

Next, I created an SSS Color Map by adjusting the Base Color Maps and hand-painting hue adjustments along the material definitions. The nougat was thick and dense, the chocolate thinner, with the caramel being the thinnest and least opaque ingredient.

Refining SSS in Marmoset Toolbag:

Enhancing Renders with Marmoset Toolbag's Lighting & Effects

Marmoset Toolbag has some awesome lighting presets built-in, so I used an interior HDRi from the library. Food photography is often bright and highly exposed. To simulate this, I used area lights with high brightness values and then adjusted the camera exposure accordingly. 

Depth of field is important when rendering small objects, so I experimented until there was a pleasing balance between background blurs and legibility, with clarity towards the nearest part of the bars. I tweaked clarity, shadows, and highlights directly in the camera settings of Toolbag. I also added some orbit motion to the lighting with a turntable to show off the surface detail.

For the video clip featuring the pile of chocolate bars, I created a simple physics simulation based on low-res proxies. I duplicated the pile with rotations to create a larger mound. That was pretty much it! For one of the rendered images, I changed the hue of the albedo color and SSS values to create dark and white chocolate versions of the Milky Ways, which kicked off some chocolate cravings! 

Pete Mc Nally, 3D Generalist

Interview conducted by Theodore McKenzie

Join discussion

Comments 0

    You might also like

    We need your consent

    We use cookies on this website to make your browsing experience better. By using the site you agree to our use of cookies.Learn more