Anyone know how to make a glass material in Unity 5?
I can do metal and image textures, but not sure how to create a glass material.
A search on Google would not get me anything for Unity 5 so it must be fairly easy to do.
It's for a shower door and plane glass like this:
Answer
Here's few things i could gather up, hope this helps you. There's multiple ways to get this done. You can write shaders or if you don't mind about having very simple glass, you can use default shaders and some PNG magic.
- Glass Shader made by Alastair Aitchison
- Reflective transparent "Glass shader" made by benoculus
- Unity asset store search: Glass
- Free asset - Breakable glass
EDIT: As this is getting some attention, i decided to add step by step tutorial for very basic window/transparency
- Create PNG image with transparency on places, where you need it.
- Drag and drop it to your assets inside Unity
- Drag it from assets to your gameObject, that you wanna use as glass
- Select shader -> Transparent -> Specular ( or any of the choices, i liked specular )
- Enjoy
I created simple 64x64 image with full background transparency and added black text on it
Then i imported it to unity ( dragged it ) and then dragged it over the cube i had there. After that, i selected transparent shader for it.
Results ( game is running )
After this, you could easily create PNG that has some scratches on it or other similar effects to make it look more real. You can even create borders with some color, that could look like a wood or metal. Try the different transparent shaders to find what looks best.
No comments:
Post a Comment