Busti
Busti

Reputation: 5604

How do I create a Glass effect in opengl?

I want to create an Effect in opengl that works a bit like windows aero but in a 3D environment to make frosted glass more realistic. But even after hours of searching I couldn't find a solution.

Upvotes: 0

Views: 2156

Answers (1)

redsoxfantom
redsoxfantom

Reputation: 956

I'd recommend starting by blurring your glass (Here I'm assuming your glass texture is an RGBA texture, i.e, its partially translucent) by using a Gaussian Filter. This would have to be done in a shader as you want whatever is behind the glass to be blurred as well. Then blend a white color with the resulting texture. To make it look better, have the white color be "strongest" at the edges of the texture and get progressively weaker towards the middle. Linear Interpolation would help with this.

Upvotes: 1

Related Questions