Bottles Shader & Script - AlchemisTeddy π§ͺπ»
Developed as part of the asset range of AlchemisTeddy, a set of bottles combines hand-painted and shader-driven approaches. Five bottles have subtle shading variations, each featuring a specific hand-painted detail. In addition, two bottles use a custom shader.
The shader was designed with flexibility in mind: it simulates a nebulous liquid that can be adjusted for fill level,
allowing the same model to represent multiple potion types.
The artist provided custom noise textures, which are integrated into the shader to
ensure visual differentiation across the bottles.
The entire set looks like this:
This workflow highlights how art and code decisions were made together to achieve both creative direction and technical efficiency. The bottles are optimized for real-time use and form part of a larger playable project (WIP).
Script
The bottles include a custom Wobble.cs script that drives small liquid-like movements based on the objectβs motion.
- Motion-based input: The script tracks both linear velocity (movement in space) and angular velocity (rotation changes).
- Procedural wobble: These values are converted into subtle sine-wave oscillations on the X and Z axes.
- Shader communication: At runtime, the script passes the wobble values to the material via the
WobbleXandWobbleZshader properties.
This setup ensures that the bottle contents appear reactive, tilting, sloshing, and βsettlingβ naturally as the object moves in the scene. The wobble intensity is clamped and gradually recovers over time, giving a convincing physical feel without requiring expensive fluid simulations.
Shader
The custom shader handles the liquid simulation inside the bottles:
- Fill-level control allows designers to reuse the same asset for multiple potion states.
- Custom noise textures (hand-painted) add variation across bottles while still fitting the same visual style.
- Integration with the wobble script makes the shader feel dynamic and physically reactive, without the overhead of actual fluid dynamics.
This shader-driven workflow lets a single mesh and material cover many potion types. Efficient for memory and performant in real-time.
Conclusion
The bottles showcase how hand-painted detail and procedural motion can be combined into one asset. Instead of static props, they behave like interactive game objects: wobbling, tilting, and visually differentiating through shader variation.
This workflow demonstrates a scalable approach: artists define the creative direction through textures and colors, while programmers add physical responsiveness and shader logic. Together, the result is both performant and immersive, ready for integration into a larger playable project.