I would like to color my shape based on the position of the vertices (vposition) using GLSL code.
I believe there is something wrong with my GLSL code, particularly the function I defined to detect whether vposition is on the first segment of the geometry or not. I made a JSFiddle for it (JSFiddle)
Please refer to the pictures below to see the final expected result + the math behind the GLSL function (isptonsurface).
[Warning] [blocked] The page at https://fiddle.jshell.net/GiBelle/0wnjgp9t/3/show/?editor_console= was not allowed to run insecure content from c:\Users\nawfa\Desktop\3D GC Tool\Styles\style_base_model.css. (show, line 16)