Wanted: Package foam
I'm trying to find a shader/material for package cushioning. It has bubbles like soap foam. It just isn't a liquid (or soap). It's the stuff you find in a shipping box that is usually shaped like the negative space of the item being shipped.

Comments
so polystyrene?
Richard Haseltine will probably affirmate Google Gemini is talking out of its Rs
take this with a heap of scepticism
AI Overview
To create an Expanded Polystyrene (Styrofoam) shader in NVIDIA's Material Definition Language (MDL), you need a Physically Based Rendering (PBR) setup that captures its distinct characteristics. [1, 2]
A realistic polystyrene shader requires three essential properties: [1, 2]
Here is a structured, production-ready MDL shader definition:
Polystyrene MDL Shader Implementation
mdl 1.6; import ::df::*; import ::base::*; import ::tex::*; import ::math::*; export material polystyrene_foam( color diffuse_color = color(0.95, 0.95, 0.95), float cell_scale = 60.0, float bump_intensity = 0.15, float roughness = 0.85, color sss_color = color(0.9, 0.9, 0.9), float sss_depth = 0.002 // 2mm penetration depth ) = material( // Surface Properties surface: material_surface( scattering: df::microfacet_ggx_smith_bsdf( roughness_u: roughness, tint: diffuse_color, mode: df::scatter_reflect ) ), // Subsurface Scattering (Crucial for foam realism) volume: material_volume( scattering: df::anisotropic_vdf( directional_bias: 0.0 // Isotropic scattering inside foam ), scattering_coefficient: color(1.0 / sss_depth) * sss_color, absorption_coefficient: color(1.0 / sss_depth) * (color(1.0) - sss_color) ), // Procedural Cell Displacement & Normal Mapping geometry: material_geometry( // Generates the compressed Styrofoam bead normals normal: base::compute_normal_from_lookup( texture: base::voronoi_noise_vector( position: base::transform_coordinate( transform: rotation_translation_scale(scale: float3(cell_scale)), coordinate: base::coordinate_source(coordinate_system: base::co_object) ) ), factor: bump_intensity ) ) );Key Components Explained
How to Use This Shader
You can import this code into platforms utilizing the NVIDIA MDL SDK, such as NVIDIA Omniverse, Adobe Substance 3D, or enterprise renderers like V-Ray and Iray. [1, 2, 3]
Are you compiling this for a specific renderer like NVIDIA Omniverse or Substance Designer, or do you need to modify parameters like bead compression vs. flat foam sheets?
I don't know what any of that means. I just want a block of foam that isn't soap or water based.
The only thing here is I see beads in the text there. I don't want beads. Styrofoam is beady. I want fluffly airy foam.
The foam surrounding the miniatures is airy, not beady.
well it can be beads but also moulded but what you are looking for is called foam plastic
I won't bother asking Gemini to create a shader
but this is what it likely is
AI Overview
Polyurethane and polyethylene are the main foam plastics used to protect delicate gear in camera cases.[1, 2]
Common Types of Case Foam
Okay. But is there an existing shader slapping it onto a cube?
EDIT: There's an animated "memory foam" asset at the hub. But that is far more functional than what I need. I don't need it to react to anything. I'm just looking for the visual. Not the function. If I'm desparate later, it does have an OBJ in it.
I'm experimenting with hires images of foam and bump maps. This is a sponge texture. It's rather low res when wrapped around a cube. I probably need to deal with the UV map to get smaller bubbles. Increasing the tiling makes it look like there's tiling. :) I'd probably want to use geo editor (or maybe a dFormer) to make it look like the vase is pressed into the foam.
(The texture comes from here. I added the blue.)
I tried importing that "code" into Shader Mixer without success - I suspect that, if it is any good at all, it has dependencies that are not properely accounted for.
I had absolutely zero expectations of it working
we needn't fear our AI overlords yet