Art 3d Rendering realistic images of 3d prints

Eric

local maker
Staff member
A weird fascination of mine is trying to render computer generated 3d images of 3d prints, accurately. I have played with all sorts of textures and materials to try and emulate the layer lines in fused filament 3d prints but I am both not very skilled in texturing or 3d modeling for renders so it has always been a challange for me. It's not necessarily complicated to do, but it is pretty labor intensive for someone of my skill level. On a 3d rendered model you need to either generate the texture procedurally through math, or use a UV map which is the basically what you would be left with if you could unwrap the skin of a 3d object. That lets you "paint" or decorate the model in specific locations so it's not just repeating pattern all over the model. I am terrible at working with either of those solutions and just don't bother usually.

I eventually found a cool feature in prusaslicer and other slicers that allows you export the tool paths as a 3d model though!
Screen Shot 2022-08-19 at 10.54.02 AM.png
This uses the technology that renders the preview of the sliced model to generate an OBJ 3d model file using the printing parameters set and tool paths written in the gcode.

As result you can render your 3d prints as they are actually going to be printed. So if the print has 0.2mm layer lines so does the 3d rendered model, if there are 2 perimeters for the outer wall of the print so will the render!

3dprint_rendered_blender.png
This is really cool to me because it even captures the facets that are formed on the round shapes. The CAD model has more perfect circles, once they are converted to a mesh for 3d printing that circle has to be subdivided into straight lines, the number of which determines the file size. A side effect though is that your final prints end up with these flat faces which are very obvious with shiny plastics like "silk" PLA filament. You can usually adjust this effect by increasing the model details when exporting from CAD but always at a consequence of increased file size.

0bef8e8f-0a66-4ad1-98b8-44f46f7724be.PNG
This is the same model as it is rendered in fusion360 as a preview. This is a more accurate depiction of the CAD 3d model but not what the final part is going to look like. Fusion360 has no way of knowing what the slicer is going to do it and thus the actual 3d model preview is more preliminary than we can achieve with exporting the tool paths.

For example it cannot know how thick the walls will be printed or if there is infill or not.

3dprint_rendered_blender_infill.png
The same model rendered in Blender with no top fill material to show the infill pattern and internal structure used. These are just default shader materials applied to the 3d tool paths and no modifiers.

My next goal is this project is to try and learn those materials better to bring it closer to photorealism. I'm really happy with these results already but I think it can be pushed even further by making use of better materials applied to these tool paths. It should be possible to make each line show it's plastic deformities, little micro-scratches to the plastic and unevenness that is revealed when you examine the filament under a zoomed lens or microscope.

This is a zoomed photo I took of the roll of filament I will be using for this particular print. I don't think I realized just how textured that plastic really is. Hopefully I will be able to recreate this roughness in the print itself as well.
IMG_3423.jpeg

If I get the quality of the renders high enough I can throw the printer into the ocean and just send photos of stuff I say I printed instead. :sneaky:(y)
 
Last edited:
Messing around with the textures I prepare to dive right in.

Swim_first_render.png
This look was giving me programming book cover photo vibes. Maybe early 2000's drum bass album covers? Something about the marble texture and inability to identify scale after staring at a picture with no depth of field for so long led me think of it as architecture and the infill as some sort of pool. I stuck a little purple glass man in there, T-posing because I didn't pay for a fully rigged model and this one was free.


Gyroid infill is cool huh?
Swim_overhead2_render_low_res.jpeg
 
Oh. My. God. This is astoundingly better than any of the renders I've seen before. Is this a new feature?

You can usually adjust this effect by increasing the model details when exporting from CAD but always at a consequence of increased file size.
There's an octoprint plugin called Arc Welder that's supposed to convert curves back to curves, which is supposed to make them print faster and cleaner, while keeping file sizes down. I've never tried it, and you'd think it'd be more of a standard feature if it worked as well as it implies, but the concept is pretty cool.
 
Oh. My. God. This is astoundingly better than any of the renders I've seen before. Is this a new feature?


There's an octoprint plugin called Arc Welder that's supposed to convert curves back to curves, which is supposed to make them print faster and cleaner, while keeping file sizes down. I've never tried it, and you'd think it'd be more of a standard feature if it worked as well as it implies, but the concept is pretty cool.

It's been around for at least a year in a prusaslicer but I don't hear much buzz about it. Rendering in blender is a big ask for the average user though and definitely a limited audience of people who actually want to spend that time rendering 3d prints. I think I'm going to be doing it A LOT now though because it's very helpful in seeing how the layer composition affects the actual look of the final part.

ArcWelder definitely will reduce your gcode file size on some prints, especially curvy ones! It's unfortunately not compatible with prusaslicer's gcode preview though so you can't use it's processed gcode in this particular method. You can use the gcode on a prusa printer though for some reason.🤷‍♂️
 
Ah yes, the infamous "real-world problem > CAD render > 3D print > NFT" toolchain.
Man, that would be a lot easier than printing these things out.

This photo isn't particularly realistic or pretty but demonstrative of the benefit of using a ray traced renderer when previewing the products. This particular product's purpose is basically collimating the light path to an exact rectangle shape and size while blocking or mildly reflecting it elsewhere. Basically a barn door style spot light but compact, unadjustable and with almost no light leaks. This is used for illuminating only a single section of a saltwater aquarium filter to grow algae for bio-filtration and making sure the light isn't bleeding into other compartments. It is shaped to fit a custom setup but with a render pipeline in place it can now be re-rendered with any other customized versions in the future. This was not the first custom light shade and it won't be the last.

front_F.jpeg
front_T.jpeg
 

A photo study​

So one of the things that I find really interesting about trying to render 3d prints is that real actual 3d prints don't really look that real to me. They are so geometric their shiny specular patches are even weird looking compared to most items we see in every day life.

This is a real photo, not to a render.
IMG_3435.jpeg
There are some obvious signs this is a photo like my messy desk, the bright red reflection of my shirt on the side facing the camera. The hairs. What seems weird and unrealistic to me though is the specular highlight in the middle. It's so binary, it's like the part section is either bright white or not at all, if it was glass it would be a clear reflection, if something more matte it would be more of a gradient. With 3d prints it's both but on a weird scale so there ARE gradients but they are tiny. This is a real world object but the layer lines somehow make it pixelated. If anything it almost reminds of a textiles like silk.

This is a real photo, not to a render.
IMG_3434.jpeg
Things I'm seeing are the layer lines are not as well aligned as the gcode preview. I think we can replicate the effect with geometry modifiers on the rendered version, I just need to learn how. This is PETG plastic too so it's very stringy or hairy. We can also replicate that in blender with the hair particle effects, at least in theory.

This is a real photo, not to a render.
IMG_3433.jpeg
It also needs some dust. I don't think it's actually dust but rather hairs or little whiskers of plastic on the print that appear white. I think two types of hairs at least, the large 1cm long whiskers of plastic and these tiny micro hairs that much more white looking than their larger counterparts.

I haven't worked with hairs in blender before, hasn't come up in my usual light shade render work. :unsure: This will be some fun playing around to learn this blender feature and see if we can bring the render quality up a notch.
 
ArcWelder definitely will reduce your gcode file size on some prints, especially curvy ones! It's unfortunately not compatible with prusaslicer's gcode preview though so you can't use it's processed gcode in this particular method.
Oh that makes sense, since arcwelder is doing its processing _after_ PrusaSlicer is done.

I also googled it a bit, and it seems like it's only in PrusaSlicer. Best I could find for Cura was a couple of dudes arguing over how it probably can't be done from a technical level.
 
Man, that would be a lot easier than printing these things out.

This photo isn't particularly realistic or pretty but demonstrative of the benefit of using a ray traced renderer when previewing the products. This particular product's purpose is basically collimating the light path to an exact rectangle shape and size while blocking or mildly reflecting it elsewhere. Basically a barn door style spot light but compact, unadjustable and with almost no light leaks. This is used for illuminating only a single section of a saltwater aquarium filter to grow algae for bio-filtration and making sure the light isn't bleeding into other compartments. It is shaped to fit a custom setup but with a render pipeline in place it can now be re-rendered with any other customized versions in the future. This was not the first custom light shade and it won't be the last.

View attachment 451
View attachment 452
Man, there are some really solid use-cases for this. I saw a video of a dude testing this out, where he saw a defect in his model that he couldn't see in the slicer preview. He then held up the same part IRL, with the same defect, and was like "welp, that would have saved me an afternoon and some filament".
 

Back to renders​


I added some roughness to the plastic. It was actually a ton of different things to make it appear this way and I don't think it's right yet. Too shiny. I still don't have the geometry modified for layer shifts either but the roughness does somewhat emulate the look at the corners at least.

plastic_textured_close_up.png
You can actually see a defect in this corner of that render that appears in the final part as well. It is much more severe in reality, but it's that under extrusion on the corner near the top. It took atleast a centimeter before the extruder was primed again looking at the final photo of my previous post.

plastic textured.png
Now that is too shiny and the roughness is appearing blotchy at a distance, probably need to play with the scale of the noise or something. Also not hairy enough! This model is missing the slots of the photo study's print so I will swap it out to make the comparisons easier going forward.
 
Goals/Wish list:
  • HDR map of my garage where I took the photo so the reflections in the render will be similar to the photo
  • Light the prop like my photo
  • Layer shifting geometry modifier
  • Fix roughness blotchy result, and too shiny
  • That thing where the light can penetrate the plastic depending on the thickness and sort of appear to glow, subsurface scattering?
  • PETG whiskers and hairs, dust particles too, just enough to look real, not to disgust the customer.
  • procedurally modify the top layer to come out a little smoother or flatter like in the photo. Even more severe for the bottom layer to simulate smooshed first layer.
 
Back
Top