# Creating a dark rooms (or caves) in Hyperfy using Blender & Substance Painter In this tutorial, I'll guide you through the process of creating a dark room or cave like the one I created in [my homespace](https://hyperfy.io/hiro). I use Substance Painter for texturing but Blender's built-in texture painting can achieve the same results. ![Cave Scene](https://hackmd.io/_uploads/HyajlZvCh.png) ## Step 1: Model Your Asset Ensure that your 3D model's normals are facing into the room. You can use Blender's "Face Orientation" overlay to check this. ![Face Orientation Overlay](https://hackmd.io/_uploads/SyoP7rDCh.png) Blue is good (facing in), and red is bad (facing out). Make sure everything you want inside is blue! ## Step 2: Create a Material Create a Principled BSDF material in Blender and apply it to your UV unwrapped model. Give the material a helpful name like "demo_cave_inside", it'll help in step 7. ## Step 3: Export to .fbx Export your model as an .fbx file to import into Substance Painter. ## Step 4: Set Up a Substance Painter Project Open Substance Painter and set up a new project using the following settings: ![Substance Painter Project Settings](https://hackmd.io/_uploads/BynnXZPA2.png) You can choose a different template if you prefer; I use the Spark AR template for its pre-configured packing settings. ## Step 5: Add a Fill Layer Add a fill layer to your model with the following channels: ![Substance Painter Fill Layer Channels](https://hackmd.io/_uploads/rk_4SZPAh.png) In this example, I know I'm not going to use the emissive channel in this material so I use the emissive channel to paint where I want the inside of the cave to appear. This emissive channel will be mapped to the specular input in Blender's BSDF. Settings for the fill layer: - Base color: rgb(0,0,0) - Roughness: 0.8 - Emissive: rgb(0.01,0.01,0.01) This is what the model looks like now: ![Textured Model](https://hackmd.io/_uploads/SJ5TI-v0h.png) ## Step 6: Texture the Non-Cave Parts Use Substance Painter to texture the non-cave parts of your model. I'm just quickly applying a wood texture so you can see the difference. ![Texture Non-Cave Parts](https://hackmd.io/_uploads/SkQ0YbDR2.png) ## Step 7: Export the Textures Export your textures using the following settings: ![Export Textures Settings](https://hackmd.io/_uploads/rkeOqZP0h.png) Note: I use a packed JPEG for AO, Roughness, and Metallic (ORM) which keeps everything optimised. The emissive texture is a separate JPEG which will become specular in Blender. ## Step 8: Set Up Principled BSDF Material in Blender Import the exported textures into Blender and set up the nodes in your Principled BSDF material like this: ![Blender Material Nodes](https://hackmd.io/_uploads/SkYANHD0h.png) To get the packed channels into the appropriate inputs, use a "Separate Color" node. Red = AO, Green = Roughness, Blue = Metallic. Ensure you connect the emissive map to the specular input. You can rename this texture to "specular" in Substance Painter's export settings which helps if you tweak SP and re-export the textures. ## Step 9: Export as .glb Export your model as a .glb file. **Bonus:** use https://gltf.report to optimise the model. ## Step 10: Import into Hyperfy Import your .glb file into Hyperfy to amaze your friends with your impressive cave scene! ![Final Result - dark rooms](https://hackmd.io/_uploads/BJRVOBP02.png) In more complex projects, you'll probably want to add detail to your cave walls with normal maps but this should hopefully have given you the technique to get it working. ![Final Result - dark cave in hyperfy](https://hackmd.io/_uploads/Hyh0IBDAn.png)