Camera Texture Wrapping

How is the Camera Texture wrapped by default in Spark AR ?

Is there a way to change it’s texture wrapping settings from clamp to repeat or vice versa ?

Hi, Camera Texture is in clamp mode by default. If you’d like to make it repeat, mirror, void/solid color, you can do UV processing or the simples way is by go to the Spark AR Library and search “Texture Wrapper” patch asset by Kevin Kripper, and use it as bridge between the Camera Texture and the next process.


If you’d like to do some fancy processing, I suggest you open up the Texture Wrapper patch, and replace “Vertex Atribute: Texture Coordinate) + Fragment Stage” to “Function: Vector 2”, and also replace “Texture Sampler” to “Composition”. I don’t know why, but without those replacement, some processing are just not working as expected.

3 Likes

It’s probably because the texture sampler outputs a color so you can’t sample the texture again after that. Function/composition will maintain the sample-ability of the texture so it works in long chains. The other option would be to use a shader render pass after texture sampler.

Also, if you all find yourselves doing UV manipulations often, I have a kit for it!

3 Likes

Thank you very much, appreciate it. :slight_smile: