Mitosis in the Gray-Scott model : an introduction to writing shader-based chemical simulations - eviltoast

Hi ! I’ve been working on this article for the past few days. It would mean a lot to me if you could provide some feedback.

It is about implementing a physico-chemical simulation as my first attempt to write a shader. The code is surprisingly simple and short (less than 100 lines). The “Prerequisite” and “Update rules” sections, however, may need some adjustments to make them clearer.

Thanks for reading

  • pcouy@lemmy.pierre-couy.frOP
    link
    fedilink
    arrow-up
    1
    ·
    2 months ago

    I did not expect such a detailed code review (the fact that you wrote it on mobile impresses me even more), but I strongly agree with everything you mentioned. I think I was so caught up learning GLSL and its quirks, then playing and experimenting with the simulation, that I “forgot” my coding standards. Anyway, I’ll make sure to take some time to update both the code and the article following your recommandations.

    • towerful@programming.dev
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      2 months ago

      Like I said, impressive work.
      Converting science to shaders is an art.

      I guess your coding standards follows scientific standards.
      And I guess it depends on your audience.

      I guess the perspective is that science/maths formulae are meant to be manipulated. So writing out descriptive names is only done at the most basic levels of understanding. Most of the workings are done on paper/boards, or manually. Extra letters are not efficient.
      Whereas programming is meant to be understood and adapted. So self-describing code is key! Most workings are done within an IDE with autocomplete. Extra letters don’t matter.

      If you are targeting the science community with this, a paragraph about adapting science to programming will be important.
      Scientists will find your article and go “well yeh, that’s K2”. But explaining why these aren’t named as such will hopefully help them to produce useful code in the future.

      The fun of code that spans disciplines!

      Edit;
      Om a side note, I am terrible at coding standards when I’m working with a new paradigm.
      First is “make it work”, after which it’s pretty much done.
      Never mind consistent naming conventions and all that.
      The fact you wrote up an article on it is amazing!
      Good work!