SKSL shader object

334 views
Skip to first unread message

craste...@gmail.com

unread,
Jun 22, 2023, 9:49:12 AM6/22/23
to skia-discuss
I have not found much documentation for SKSL and it's object types.
I was wondering, specificly, about the "shader" object type and it's eval() method.
Does the method have any variants that take other, or additional, parameters besides an x/y coordinate?
Does the shader object have any other methods?

John Stiles

unread,
Jun 22, 2023, 10:29:14 AM6/22/23
to skia-d...@googlegroups.com
There's some basic documentation here: https://skia.org/docs/user/sksl/

Shaders always take x/y coordinates as a float2. Color filters always take a half4 color, and Blenders always take two half4 colors. 

If you're curious about the implementation, this is where they are defined, but don't change this—lots of the SkSL implementation assumes that this will stay as-is: https://skia.googlesource.com/skia/+/refs/heads/main/src/sksl/sksl_public.sksl 
There are also SkSL built-in functions here which convert between color-spaces and linear sRGB, but these aren't shader specific.


--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/50a6fa67-6c1f-4385-9369-1a926542b6e4n%40googlegroups.com.

craste...@gmail.com

unread,
Jun 22, 2023, 10:42:38 AM6/22/23
to skia-discuss
Thanks!
Reply all
Reply to author
Forward
0 new messages