Jump to content

Glass Refraction Texture Needs Inversion?


Nick Stinger
 Share

Recommended Posts

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.

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...