A realistic glass bottle material with refraction, reflection, surface details and translucent shadow in Unity's URP.
Model Preparation
- The glass bottle model was prepared in Blender, with inner and outer walls separated for better control over material properties and to resolve transparency sorting issues.
- Thickness and Refraction: Simulated thickness calculated from normals and view direction, creating realistic edge darkening. Screen-space refraction achieved through offset sampling, enhanced by alpha adjustments for realistic light bending.
- Reflection and Specular Highlights: Built-in reflections from Unity's lit shader with "Preserve Specular Lighting" enabled provided efficient performance and visual fidelity.
- Surface Details: Roughness maps simulated smudges, while normal maps added fine scratches for enhanced realism.
- Translucent Shadows: Customized Unity’s shadow-casting behavior using a dither method for semi-transparent shadows, blending alpha clipping with shadow casting.
- Solved transparency sorting by rendering in this order: inner wall (2998), liquid (2999), outer wall (3000).
- Used post-processing effects to correct the overexposure of the HDR skybox, and applied a bloom effect to enhance the glow of the glass and other light-reflective surfaces.