Hey, I can’t figure out how to create an array of varyings in TSL.
For instance, in GLSL, I would declare it like this: varying float myArray[LENGTH];
I tried using the TSL transpiler, but when writing varying, I got /* unknown statement */.
This is good GLSL has been pretty consistent, I’m surprised it got this wrong but it might mean that us graphics people might be employable for a bit longer.
Hi,
In the demo I provided, I use arrays of varyings to perform calculations related to textures in the vertex stage instead of the fragment stage. Essentially, this computes individual texture UVs and “bounds” for cropping in the fragment stage. However, for now, I will do everything in the vertex stage.
Edit: I could replicate what I did using varyings (but not as arrays) with a JavaScript for loop (not a TSL Loop). The downside is that a lot of code gets duplicated once the shader is transpiled.