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

  • WendyLuvsCatzWendyLuvsCatz Posts: 41,562
    edited 8:31AM

    so polystyrene?

    Richard Haseltine will probably affirmate Google Gemini is talking out of its Rsdevil

    Post edited by WendyLuvsCatz at
  • WendyLuvsCatzWendyLuvsCatz Posts: 41,562
    edited 8:29AM

    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]

    1. A Cell-Like Texture: A cellular voronoi pattern to replicate the pressed, individual foam beads.
    2.  
    3. Subsurface Scattering (SSS): To handle light penetration through the semi-translucent foam particles.
    4.  
    5. High Roughness: To achieve the soft, matte look typical of molded polystyrene.
    6.  

    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

    • base::voronoi_noise_vector: This serves as the foundation for the classic Styrofoam look. It maps a procedural cellular grid to the target 3D object to define individual compressed bubbles. [1]
    •  
    • volume (Subsurface Scattering): Because polystyrene is a compressed polymer, light propagates slightly through the beads before scattering backward. The volume block handles this translucent, glowing light-bleed along thin edges. [1, 2, 3]
    •  
    • df::microfacet_ggx_smith_bsdf: Keeps the material matte and diffuse by utilizing a highly randomized micro-surface profile. [1, 2]
    •  

     

    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?

     

    Post edited by WendyLuvsCatz at
  • jmucchiellojmucchiello Posts: 2,119
    edited 10:32AM

    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.

     

    Post edited by jmucchiello at
  • WendyLuvsCatzWendyLuvsCatz Posts: 41,562
    edited 10:52AM

    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 cheeky

    but this is what it likely is

    AI Overview

     

     

    unknown.png

    Polyurethane and polyethylene are the main foam plastics used to protect delicate gear in camera cases.[1, 2]

     

    Common Types of Case Foam

    • Polyurethane (Open-Cell): Soft, spongy, and flexible, this is the most common standard foam used for pick-and-pluck squares. It cushions light impacts well, though it absorbs moisture. [1, 2]
    •  
    • Polyethylene (Closed-Cell): Firmer, denser, and moisture-resistant. Brands like Clark Rubber and GigGear offer these denser options (such as PE45 or EVA) for heavy or high-value gear. [1, 2]
    •  
    • Kaizen Foam: Layered, peelable sheets let you customize the exact depth for each item without crumbling like traditional pluck foam. Most users on Reddit agree that using an electric carving knife or sharp blade gives the cleanest results with this material. [1, 2]
    •  
    Post edited by WendyLuvsCatz at
  • jmucchiellojmucchiello Posts: 2,119
    edited 11:22AM

    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.

    Post edited by jmucchiello at
Sign In or Register to comment.