(WIP)The Beautiful World of Mathematics - My first shader

#Mathematics #Maths #Computer Graphics #fragment shaders

Table of Contents

Introduction

A little bit of my past…

In my teenage years, I was into drawing, sketching, more specifically digital drawing and animation. But due to how life transpired and me getting into programming and CS, I didn’t have time to consistently practice my hobby of drawing. I’d known about shadertoy, mandelbrot for a long time, how noise can be used to generate patterns that you see in real life. Also, I am immensely fascinated by the Universe and astronomy.

Becoming the Artist With Mathematics and Programming

This is my entry into the world of shader programming. I created this ‘sun like’ shader for my work in progress N-body simulator. So, I first started by writing a ‘software’ shader; which is just some C code which writes an image file to the disk. Why did I do this? Just because I felt like I would learn all the bits and pieces by doing it on the CPU first, which might look odd to some of you.

Anyway, this article is about how I created this shader. As we go through the article, I’ll link some wonderful resources which you can read to explore more.

First Some Math

resize

Tis art

(To be continued…)

References

  1. Inigo Quilez’s article on domain distortion
  2. Inigo Quilez’s article on Fractional brownian motion
  3. Article on perlin noise implementation in JavaScript
← prev