FarazzShaikh / THREE-CustomShaderMaterial

🧩 Extend Three.js standard materials with your own shaders!
https://farazzshaikh.github.io/THREE-CustomShaderMaterial/
MIT License
891 stars 56 forks source link

Cleaned up Complex Powers example, added Hopf Tori #9

Closed stevejtrettel closed 3 years ago

stevejtrettel commented 3 years ago

Making more examples on the road to my real application!
Cleaned up a bit how I was making the material; there's now a folder that contains all the stuff for a single material: its properties, it's vertex shader, and the fragment shader used as a texture map. Replaced the grapher (now called Complex Powers to be more specific) with this hopefully more readable code, and added a second example (Hopf Tori). I put an explanation of the math / the controls for each which can be accessed in the menu too.

I should also say - if you look through any of the code and notice things I'm doing badly - let me know! I have no training in programming and only started picking up javascript during quarantine to make my online lectures more interesting. So I'd of course appreciate any help!

FarazzShaikh commented 3 years ago

Looking good!

I have no training in programming and only started picking up javascript during quarantine...

Sure doesn't look like so haha, your code is really clean! What do you teach?

I have given you your own section in the demo site, You can possibly spin it off into its own site quite easily to show off your work outside this niche library lol. Your work is super cool.

Do you have experience or knowledge in creating Noise functions in GLSL? I could really use some help in generating GPU Fractal Noise for another library of mine.

stevejtrettel commented 3 years ago

I'm a mathematics postdoc so I teach the whole range of undergrad math these days (this year real analysis and group theory, and a couple sections of calc). And I don't have any experience with noise functions, but I do have a fair amount of experience in GLSL (thats how I first got into programming about 2 years back when we used it to speed things up for a research project!). So when school's out would be happy to talk and see if I could be helpful!

FarazzShaikh commented 3 years ago

Wow yes, let me know once you’re free, Noise functions are pretty much just Math and we’re using GLSL so it’ll be right up your alley.