Instagram 通过脚本在Spark AR上使用粗花呢颜色

Instagram 通过脚本在Spark AR上使用粗花呢颜色,instagram,reactive,spark-ar-studio,Instagram,Reactive,Spark Ar Studio,在反应式脚本中,什么等效于过渡补丁?我想在RGBA中将颜色从0,0,0,1改为1,1,1,1。我知道如何将单个值设置为alpha,如下所示: const timeDriver = Animation.timeDriver(timeDriverParameters); const alphaSampler = Animation.samplers.linear(1, 0); const alphaAnimation = Animation.animate(timeDriver, alphaSamp

在反应式脚本中,什么等效于过渡补丁?我想在RGBA中将颜色从0,0,0,1改为1,1,1,1。我知道如何将单个值设置为alpha,如下所示:

const timeDriver = Animation.timeDriver(timeDriverParameters);
const alphaSampler = Animation.samplers.linear(1, 0);
const alphaAnimation = Animation.animate(timeDriver, alphaSampler);
mymaterial.opacity = alphaAnimation;
使用可视面片,可以使用变换面片将矢量3链接到动画进度。我在反应脚本的文档中找不到类似的内容。谁能告诉我


谢谢大家!

您需要查看ShaderModule。按名称查找材质,然后可以使用setTexture


常数R=要求(‘反应’);
常量A=需要(“动画”);
const S=require(“着色器”);
const Materials=需要(“材料”);
const material=Materials.get('matName');
const driver=A.timeDriver({duration毫秒:1000});
常量采样器=A.采样器.线性(
[1, 1, 1, 1],
[0, 0, 0, 1]
);
const colorAnimation=A.animate(
司机,
采样器
);
材料结构(
R.pack4(
colorAnimation.get(0),
colorAnimation.get(1),
彩色动画。获取(2),
彩色动画。获取(3)
), 
{textureSlotName:S.DefaultMaterialTextures.DIFFUSE}
);  

这里我使用了ArrayOfScalarSampler,但这并不重要。

您需要了解ShaderModule。按名称查找材质,然后可以使用setTexture


常数R=要求(‘反应’);
常量A=需要(“动画”);
const S=require(“着色器”);
const Materials=需要(“材料”);
const material=Materials.get('matName');
const driver=A.timeDriver({duration毫秒:1000});
常量采样器=A.采样器.线性(
[1, 1, 1, 1],
[0, 0, 0, 1]
);
const colorAnimation=A.animate(
司机,
采样器
);
材料结构(
R.pack4(
colorAnimation.get(0),
colorAnimation.get(1),
彩色动画。获取(2),
彩色动画。获取(3)
), 
{textureSlotName:S.DefaultMaterialTextures.DIFFUSE}
);  

这里我使用了ArrayOfScalarSamplers,但这并不重要。

啊,谢谢!伟大的我没能打开信号阵列。顺便问一下,您知道脚本的其他文档来源吗?我发现官方的spark文档非常小。曾经有一个非官方的wiki页面,但现在看起来好像已经坏了(啊,谢谢!太好了。我没能打开信号数组。顺便问一下,你知道脚本的其他文档来源吗?我发现官方的spark文档非常小。有一个非官方的wiki页面,但它现在看起来好像坏了(