Just Shared - My Spark AR Patch Assets
|
| - 25 Option Picker.arp
|
| - 25 Texts Option Picker.arp
|
| - 3D Line.arp
- TODO
|
| - Boolean Counter 4.arp
|
| - Boolean Counter 8.arp
|
| - Boolean Counter 16.arp
|
| - Distance Between Line And Point.arp
- TODO
|
| - FaceLess.arp
Patches work that's copied form Spark AR Community's post
|
| - Fresnel.arp
|
| - Fresnel Shader.arp
Since v83 - able to use Patch Assets as Material's Shader
|
| - Fullscreen Plane.arp
|
| - 6 Steps Gaussian Blur.arp
- TODO
|
| - Loop Animation 2.arp
|
| - Masking Shader.arp
- TODO
|
| - Masking Shader 2.arp
- TODO
|
| - Masking Shader 3.arp
- TODO
|
| - OR PULSE.arp
Like "Pulse Multiplexer" in Spark AR Library
|
| - Pixel Less Shader.arp
Since v83 - able to use Patch Assets as Material's Shader
|
| - SDF Round Rectangle.arp
- TODO
|
| - SDF Round Rectangle 2.arp
- TODO
|
| - 2D Water Distortion.arp
- TODO
|
| - World to Focal.arp
const Scene = require('Scene');
const Patches = require('Patches');
const FaceTracking = require('FaceTracking');
export const Diagnostics = require('Diagnostics');
Promise.all([
Scene.root.findFirst('Camera'),
Scene.root.findFirst('left_eye'),
Scene.root.findFirst('right_eye')
]).then(results => {
const Camera = results[0];
const face = FaceTracking.face(0);
const left_eye = results[1];
const right_eye = results[2];
left_eye.transform.position = face.leftEye.center;
right_eye.transform.position = face.rightEye.center;
Patches.inputs.setScalar('fd',Camera.focalPlane.distance);
Patches.inputs.setPoint('ct_facePosition',face.cameraTransform.position);
Patches.inputs.setPoint('wt_leftEyePosition',left_eye.worldTransform.position);
Patches.inputs.setPoint('wt_rightEyePosition',right_eye.worldTransform.position);
});