Styrofoam texture

Does anyone have a good node setup for a procedural Styrofoam/polystyrene material like that used in drinking cups?

Seems like a Voronoi noise would work for that – Cycles or Eevee?

1 Like

I tried that a few times… keeps coming up looking like Barf! LOL

Huh. You’d think there’d be a way to get Voronoi Cells single-color with borders – trying to get that with Voronoi Intensity and messing with a color ramp doesn’t seem to do it. Anyway, attached is the best I’ve managed.

Styrofoam 002.blend (644.0 KB)

2 Likes

seems to render as black Styrofoam

can it be modified to render in EEVEE ?

happy c,


I use an old noise/node procedural tiling texture generator called Genetica – in it I can use a Voronoi texture and a Color Ramped gradient to make a simple styrofoam-like bumpmap (or texture), using it’s Regions node which defines regions using (in this case) the Voronoi noise and then fills each of them with the squashed gradient. It seems like something simple that Blender’s nodes should be able to do, but if it has any equivalent to Genetica’s Regions node I haven’t found it, and without that I can’t come up with anything better than using a Math Node, Color Ramp, and/or Brightness/Contrast node trying (and failing) to flatten the interiors of the Voronoi cells without losing too much definition at the edges. I’m out of ideas, sorry @5_on_it .

Displacement nodes handle differently in Eevee than Cycles, here’s a link to the tutorial I was looking at.

2 Likes

That’s OK. I’m sure that I’ll figure something out eventually. If I do, I’ll post a solution here.

I can post the map if it’d help you, but since you said you needed it procedural it probably wouldn’t. Well, mine was generated procedurally, just not in Blender.

Your’s isn’t too far off. I think I just need to tweak it… once I figure out HOW to tweak it! LOL.
It’s close but the SSS is weak and the surface needs to be smoother. (Coffee Cups aren’t that bumpy). This looks more like the polystyrene used in shipping. I think the SSS weakness is simply because Cycles just isn’t that great at it. I might try another render in Appleseed.

1 Like

got one like that polysterene
but bumps could be reduce
should be visible only at close range

happy bl

Have any photos of what you’re trying to achieve? For pattern I’d probably end up with a variation of the top one (just more generators mixed). The circular shape found in some styrofoam (which is why I’m asking for an image) cannot be achieved with voronoi, we need a different kind of cell generator for that. Back in the day, that is the generator we had, and we longed for true voronoi :smiley: For the round cell style, I think a seamless texture would work better than trying to set it up procedurally.

As for shading, I’m not sure. You’d have a examine a real sample of such a cup and describe how it reacts to light. Does brightness change with a slightly thicker rim at the top? Is there any significant sss/translucency going on at the most solid parts at all? Can you see backside shadow? I ended up with DisneyDiffuse roughness 1 specular 0, where I put the glossy component into a slightly rough “topcoat” instead, only to be able to have no normal stuff going on for rough diffuse, and have the topcoat only react to normals. Instinctively I tried exaggerated normals for diffuse/sss (how we did it way back when sss wasn’t invented yet), but oddly it looks much better with no normal modifications in these channels (only glossy, or “topcoat” in principled terms).

Unless these are still in the stack, still wrapped there will be

slight dirt
bent out of shape
coffee stains
coffee
bits from the rim boolianed off
All these sell the realism.

Video of an artist painting on a styrofoam cup. Observe how the textured structure is mainly visible where the light is reflected - reflected more sharply than I anticipated:


In the end, you can see him filling up coffee and how sss/translucent effects manifests itself from the backlight.

If you image search styrofoam texture, you’ll see that there are many variants. The circular dotted one can only be achieved with an image texture.

Here is my attempt, pattern setup similar to the one at the top.
Nodes:

Pattern preview:

Glossy/“topcoat” contribution only (since I use separate normals):

Result, with some not so good looking “coffee” :smiley: :

Like in the video above, the bumpy nature of the pattern emerges only in the reflection, and there is some sss light transmission/shadowing going on (seen when he fills the cup). Circular pattern (like packed balls cross sections) cannot be created using voronoi, this is the closest I could get.

1 Like

@ Carl
this is for 2.8 ?

did you use the Square root with the math power node ?

could this work in 2.79 ?

did this one in EEVEE

blue one is another set up

thanks
happy bl

1 Like

Set it to power and use 0.5 in the second slot, same thing.

Hello ! This topic is old, but do you remember your node setup for this one ? I tried to replicate but barely found the solution.

For which image? I had a few different setups.

I would love to hear how you put together the polystyrene used in shipping. I’m desperate, and have been searching for forever. I just started blender but have been going insane trying to get exactly what you created!