aferriss / sparksl-shader-examples

A collection of shader examples in SparkAR's shader language (SparkSL)
197 stars 31 forks source link

Sdf example wrong number of arguments in Pro tip #3

Closed Askhento closed 3 years ago

Askhento commented 3 years ago
  // PROTIP!!! You can create the sdf on a single line with an extra set of brackets in your syntax
  // For example, the two lines above could be combined into the line below. Note the (uv) at the end
  // float poly = sdfPolygon(vec2(0.5), texel.x*50.0, 5.0)(uv);

                                                       ^
                                            here function should have only 2 args, but 5.0 found, which give unknown error!
aferriss commented 3 years ago

Hi @Askhento ,

Are you sure? The docs lists three arguments for sdfPolygon https://sparkar.facebook.com/ar-studio/learn/sparksl/sparksl-api/sdf#enums

Screen Shot 2021-01-26 at 10 35 52 AM
Askhento commented 3 years ago

oh no it's my fault))) Hah I used it for different SDF, will close the issue. sorry