- Home /
How to apply refraction at marked texture pixels while the rest is being rendered normal?
I have a low poly textured mesh. I want to add some refraction on the glass-pixels of the diffuse texture without splitting the mesh and applying the desired specular material to those faces.
I know masking could be the key, so I duplicated the diffuse texture and masked with pink where the pixels should get the refraction applied. Now I need to know how a shader can read those pink pixels and draw there refraction over the diffuse texture.
How can this be done?
Answer by FortisVenaliter · Oct 03, 2017 at 10:15 PM
I don't think it can. Not without a second render, anyway.
You're basically breaking the mesh down into two parts already, except using extra textures, on the GPU, in real-time. Splitting the mesh would already be a performance improvement and drastically decrease the complexity of the setup. Why is that not an option?
Thought because it would be more dynamic with masking ins$$anonymous$$d of editing the mesh and assigning the desired material everytime I want to change the glass positions. Anyways thank you for your time.
You would need different textures to make it dynamic, just as you would need extra meshes, so there's probably not much of a gain to be had there.