Skip to content

Instantly share code, notes, and snippets.

@flushpot1125
Created December 16, 2023 10:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flushpot1125/c7b36d438e41c0fbd6e136aa5670f124 to your computer and use it in GitHub Desktop.
Save flushpot1125/c7b36d438e41c0fbd6e136aa5670f124 to your computer and use it in GitHub Desktop.
//Create reflecting surface for mirror surface
var reflector = new BABYLON.Plane.FromPositionAndNormal(glass.position, glassNormal.scale(-1));
//Create the mirror material
var mirrorMaterial = new BABYLON.StandardMaterial("mirror", scene);
mirrorMaterial.reflectionTexture = new BABYLON.MirrorTexture("mirror", 1024, scene, true);
mirrorMaterial.reflectionTexture.mirrorPlane = reflector;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment