Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Start your project by making a Mesh > Plane
- //Set the Mesh's X Rotation to 0
- //Using the scale tool align the edges of your mesh with the edges of the preview so that it just covers the screen
- //Make a new Material > Diffuse and make its Cull Mode = Front (thins makes it so the texture for the mesh faces away from the camera //rendering it invisible)
- //And also apply the new Material to your mesh
- //Create a script with the code below
- //Finally add a script component to your camera and add the script you just made and set it to Tapped
- //Connect the inputs and it should work
- //@input Component.Camera camera
- //@input Asset.Texture deviceCameraTexture
- //@input Component.MeshVisual meshVisual
- //Takes a screenshot which we can access with textureCopy
- var textureCopy = script.deviceCameraTexture.copyFrame();
- //Applies textureCopy to the
- script.meshVisual.mainPass.baseTex = textureCopy;
- //Sets the Mesh's texture to face the camera
- script.meshVisual.mainPass.cullMode = 1;
Add Comment
Please, Sign In to add comment