Nick Stinger Posted March 22, 2016 Share Posted March 22, 2016 Still completely new to this, so I'm not quite sure how to get glass working right. I took the glass reflection & refraction demo and added a square beneath the ball. http://www.babylonjs-playground.com/#19JGPR#15 That square is not visible from the top of the glass ball, where I was hoping to see it. Rather, its visible from the bottom (like a reflection). Both the dull reflected square and strongly refracted square are visible from the bottom. I think I have to invert the refraction texture to make this work. In my case, I want to clone() the reflection texture, invert on the y axis, and then set the refractionTexture to the cloned texture. I see the Texture constructor has an inverty parameter, but the clone method does not (and probably should not) have an inverty parameter. How can I invert the texture after I have cloned it? Or perhaps I'm going about this the wrong way. At any rate, thanks again for the help. Quote Link to comment Share on other sites More sharing options...
Sebavan Posted March 22, 2016 Share Posted March 22, 2016 Hello, Using the probe, the refraction texture is inverted on Y, you are right. You may want to inverse it using this: glass.invertRefractionY = true; http://www.babylonjs-playground.com/#19JGPR#16 Sorry to not have placed this in the documentation, I ll add it later today. Thanks, Quote Link to comment Share on other sites More sharing options...
Nick Stinger Posted March 23, 2016 Author Share Posted March 23, 2016 Working great and simple enough. Thanks for the help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.