Writing custom shader with slider bar
Hey!
Thanks for this really neat tool!
I'm trying to visualize the level sets of a function over my mesh. I would like the parameters of the function to be variables I can change with the slider bars (akin to the "move speed" slider). The function is pretty unique so I would have to write my own shader. I don't think Polyscope has support for this unique application but I was wondering if there is somewhere I should look in the code to hack something together? Specifically, are there any shaders I should be looking at?
Thanks! Rahul
Hi!
First off, in case you haven't seen in, there is some isoline functionality already built in to the scalar value visualizers. https://github.com/nmwsharp/polyscope/blob/master/include/polyscope/scalar_quantity.h#L55-L61. It's not well-documented; I just made a docs issue to remember to improve that.
I've been meaning to add some features for creating custom shaders, but haven't gotten around to it! If you wanted to pursue this, the starting point would be to create a custom "shader rule" like these, and register it with engine->registerShaderRule(). These rules get substituted in to the shaders to allow them to play nice with all the other stuff going on in Polyscope.