It seems to be the end of this blog.
“Your life was short but colorful”
The deadline is approaching and I still have nothing. I used to write on this blog because I had to. But do I really have to ?
I have to admit that this blog used to motivate me to program beautiful stuff and show it to the few people reading the blog. But I don’t feel that I have to write on it. This blog now feels like a homework and this is very bad, I really don’t like homework. I will not do 10 article in a row the day just before the deadline because this clearly is not interesting for me and for you.
Writing in a blog was a good exercise but everyone is losing interest in the blogs, nobody’s reading them anymore. Why would I write something that nobody will read ? (And I am also to blame, because I almost didn’t read any other blog.)
So why would I write on this blog If I have nothing to write ? To have a better grade in English ? Nope, don’t really care.
Bye blog ! It was quite fun writing on you at the beginning, before you became boring.
I Just remembered that I still have a blog and that I have to wright new posts because all of my readers are desperately waiting for something new to read. Given the resent statistics about the blog, I think that approximately one reader is maybe waiting for an article to come, and I obviously don’t want to disappoint him/her.
Sadly I don’t have anything very interesting (interesting from my point of view) to write. I think that it has been a month now since the last time I programed a shader. Since the last article about a shader I created, I have not programmed anything that I want to show you.
The subject of this blog seems to be about programming fragment shaders but from now on, there may be more “off topic” posts because of my lack of willingness to program. I could also make more tutorials but it takes a lot of time and I don’t think anybody will ever use them.
Next post will come soon, very soon… or not. I don’t know.
As I am writing those lines, I just got back from the Global Game Jam 2016 (GGJ16) witch I already talked about in a previous post.
Unfortunately, this year I could not really participate because I was busy Saturday morning (thank you Polytech) and also Friday night (for other reasons). But even if I did not really participate and be part of a team, I spent the rest of my weekend at the Jam because the people there are awesome!
I had the opportunity to meet a lot of artists, programmers, and most of all people who love to create video games.
This year the theme of the Jam was “Ritual” and there was very good ideas about it. The theme is just here to guide the ideas it doesn’t have to be really obvious in the game.
This year was again the opportunity to listen to great sounds in the games thanks to talented music creators and to see beautiful drawings, animations and 3d models. The Global game jam is not the only Jam organized by the Apoil association of u-psud, there is other jams during the year but this one is the biggest and this is a world wide event.
This small project is pretty simple in theory but wasn’t that easy to make. From the beginning, I had a precise idea of how I wanted it to look like but of course there was a few evolution during the creation.
The first part, and I think the harder one, was to find the function to make a nice heart beat shape. I tried a lot of different things before finding a good one. I tried different sum of sinus, co-sinus and sin(x)/x. The final function that I use in my shader is:
y = sin(f*x)/(5*f*x) + sin(f*x)/7 with f = 70
And it looks like this:
That doesn’t look like a heart beat at all (Graph made on www.desmos.com/calculator this calculator is very good and it was very helpful for this project)
I want to keep only the part of the function that is close to the middle. So I multiplied it by an other function witch value is close to one in the middle and is decreasing to zero while going away from the center /\ .
First and most important part of the shader, the heart beat function
Then I had to make the light that move from left to right on the screen. The light is simply made of a gradient moving from left to right.
The light moving from left to right on the screen
Now that I have the curve and the light, I just have to multiply them together!
To make it look better I also added an effect that makes it look like an old monitor. (and of course multiply everything by a nice green color)
To sum up with a simple equation :
Electrocardiogram = ( Heart_beat_function * light + old_monitor_effect ) * color
“If there is no ups and downs in your life, you are probably dead.”
Like a wave, life is made of ups and downs as it propagate through time. As you move through time and space you interfere with other waves that will make you stronger or weaker depending on the direction you are heading. But even if it doesn’t make you go exactly in the direction you wanted, you need interference to keep the wave going.
You have to keep the wave of life strong enough because if there is no ups and downs in your life, you are probably dead.
The wave of life. (Electrocardiogram project (click on the image to see the animation))
The best example I found to illustrate this “wave of life” is the wave created by your own heart on an electrocardiogram. You have to live with its ups and downs because if it becomes flat, you are dead.
My last project (that was harder than I thought at beginning) was to make an electrocardiogram animated shader. It took me quite some time to make it look like I wanted and I will explain how it was made in my next article.
It has been a while since I haven’t shown you any beautiful shader that I made. And that is because right now I don’t have anything to show you, but I can give you the link to my ShaderToy page where I keep adding some shaders I have already made (some of them haven’t been linked on this blog so they should be new for you).
I haven’t done anything new yet because I am trying to learn how to do Ray Marching. Basically, it means creating an environment with 3D objects and lights and then shoot imaginary rays from every pixels of the screen to know the distance from the pixel to an object. If the ray went all the way without touching any object of your scene, it is because there is nothing on its trajectory. But if there is something, you calculate the normal from the surface of the object at every point where a ray hit the object (the normal is the direction of witch the surface of the object is facing). By knowing the normal of every point of the object you know the shape of its visible surface. With the normal and the position of the lights, you can calculate how the light bounces on the object and you can finally see the object.
A simple example of the Ray Marching of a ball transformed by a sinus function (it is a very easy shape to do with Ray Marching)
The example above is not from me, it is an example I found on GLSLsandbox.com that I modified a little. I use this example and others to play with them and learn how they are made in order to learn Ray Marching.
But this is hard to learn, I don’t understand everything yet, I can not do one by myself without an example.
I like to keep myself busy with a programming projects, and when I don’t have one, I think of the next one. But as much as I like programming, I don’t program every day. After a long day at work, it’s sometimes hard to start programming at home (even if my work isn’t about programming). Most of the time, I prefer watching 5 episodes in a row of a random tv series than programming. Why? Because I’m lazy!
I really started programming when I was unemployed and looking for a job after my technology degree. The first month of unemployment feels like holidays, but you are the only one on holidays, all your friends have to work. Soon I got bored and I started learning Java by making a video game for my phone.
Now that I have a job and I also have to go to school it’s hard to find free time to program and to find the willing to program during my free time. But I also have to write about programming in this blog. And to have something to write I need to program.
This blog force me to program, and that is a good thing, because maybe, without it, I wouldn’t have created this: