Getting texture from vec4

I’m struggling a bit in Lens Studio when it comes to making complex shaders. They have a bunch of built-in stuff that is really great, but I’m stuck at using a procedural texture as an input for another patch.

E.g. I want the edges of some noise texture

The output of smoothstep is vec4, while the input of the edge node is a texture. In Spark, you could do this without even thinking about it. At the most you’d need to add a render pass node between the two.

It seems like there is the option for multiple passes on a material, just because of the existence of material.mainPass but I don’t see anything in the docs that really go into depth.

Check out these super unhelpful docs on Pass

is there any solution to convert vec4 to texture?
it must be something possible just by script, I didn’t even understand the lens studio render pass :sleepy: the documentation is terrible

1 Like

so we cant convert back a vec4 to texture as once you convert it to Rgba we get it as individual pixels so we can convert it back to texture . even in spark ar we cant do it without render pass . so in lens studio we can actual create a procedural texture using code that gives pixel data to .

1 Like

The solution I found is pretty terrible. You have to render the shader to a texture and then resample it in another graph. I know you can set up a render target for each one of these things, but it seems like the simpler way is to use the post-processing pipeline because it already does that rendering step. I still haven’t really found a good workflow for this, but I haven’t been in lens studio much