Enabling refraction in Blender is straightforward and primarily depends on your material setup. Based on the reference provided, refraction is often enabled by default when using specific shaders or transparency.
Methods to Enable Refraction
The primary ways to get refraction working in your Blender materials involve using shaders designed for transparency and light bending, or by utilizing the alpha channel.
Using Refraction-Focused Shaders
- Glass BSDF: This is the most common shader for creating glass-like materials that transmit and refract light.
- Transparent BSDF: While primarily for simple transparency, it can also be involved in setups that include refraction.
- Refraction BSDF: A shader specifically designed for just the refraction effect without absorption or reflection typical of glass.
As the reference indicates: "If you plug a texture to tweak transparency in this alpha slider or use a glass or transparent or refraction shader, transparency and refraction are enabled by default."
Utilizing Alpha for Transparency
You can also enable refraction by setting up transparency in your material, often by:
- Adjusting the Alpha slider in the material properties.
- Connecting a texture (like an image texture or noise) to the Alpha input of a Principled BSDF or other suitable shader.
Using these methods causes Blender to calculate how light passes through the surface and bends, creating the refraction effect.
Controlling Refraction Strength (IOR)
Once refraction is enabled (by using a refraction-enabled shader or transparency), the amount by which light bends is controlled by the Index of Refraction (IOR) setting.
- Different materials have different IOR values (e.g., water is ~1.33, glass is ~1.52, diamond is ~2.42).
- Setting the IOR value appropriate for the material you are simulating is crucial for realistic refraction.
Important Note: The reference mentions that to avoid refraction, "you have to set IOR to 1." This means an IOR of 1.0 essentially disables the bending effect, making light pass straight through as if there were no material change, even if transparency is active. Therefore, setting the IOR to anything other than 1.0 is necessary for the bending effect of refraction to be visible.
In summary, to enable the visual effect of refraction in Blender, you typically need to use a material shader like Glass BSDF or ensure your material has transparency enabled and an IOR value different from 1.0.