A small park diorama rendered with a modified Blinn-Phong effect that saturates shadows.

A month ago I decided to ditch all my projects to follow my heart and focus on Graphics Programming. Today, I want to share with you the beginning of my journey.

I had programmed basic Blinn-Phong shaders many times in the past, so I had many concepts already down, but there are many more shaders out there than basic lighting. I played a bit with Parallax effects before giving up on Unity (again) and moving to raylib.

At this point, I had decided I had to go through the basics again, this time to the end which I never reached before: Physically Based-Rendering.

I started with Catlike Coding’s Unity rendering tutorials, which I had followed many times before as well. However, they would not help me out this time: Unity uses HLSL, and I was using GLSL.

This would have been fine, just a little bit of translating, until I reached a point where Catlike uses Unity’s integrated functions.

I knew raylib is just a little padding against OpenGL, I had not realized the full tower of mattresses Unity actually is!

That is how I learnt that Unity has a custom shader language built on top of HLSL called ShaderLab, which enables us to: import hlsl files, make multiple passes within the same shader, simplify basic lighting computations, and many other things.

And so I ended up pivoting to LearnOpenGL.com. LearnOpenGL provides a comprehensive set of tutorials - and exercises! - to get from Zero to Hero on your own. It is truly a priceless resource for this. Also not the first time I had followed the basic tutorial for OpenGL, but never to the depth I was about to reach.

I had to confront a bit of a new conflict at this point: should I stay with raylib, or should I go just full OpenGL at this point?

I will save you my whole inner debate: I stayed with raylib.

I want to learn the shaders and effects I have been postponing for a long time, and not learning OpenGL right away does not mean I cannot come back to it later when I am truly invested in learning how graphic APIs work. OpenGL and Vulkan are both definitely on my roadmap! But right now, I just want to focus on what my heart is truly chasing: artistic expression.

It soon dawned on me that I would have to create a whole infrastructure to support my experiments, though. Raylib truly is just a little bit of padding! And that is fine.

It took me a while to realize that… what I was actually doing… effectively… was…

A whole f-cking renderer.

You know, that thing everyone tells you not to do? Yeah.

I am not technically dealing with OpenGL, but virtually, I am basically making a renderer. An engine, if you will.

Fuck.

And the worst part of it is I actually love doing shit like that, so it quickly roped me down into many, many rabbit holes that took almost literal days to crawl out of.

Sigh.

But I love it.

And like we say in spanish: «La sarna con gusto no pica, pero mortifica».

ANYWAY! If you want to know more about the engine infrastructure I had to create to support this project, there will be a post about it in the future. Stay tuned!

So with all that, I was very excited to get my hands dirty with almost-low-level APIs!

In posts to come I will tell you all about how I got here:

A small park diorama rendered with a modified Blinn-Phong effect that saturates shadows.

Bibliography

I have linked many things throughout the post, so let me summarize the most relevant ones here:

If you made it this far...

Thank you! I hope you liked it!

I do not allow comments in my blog because I do not want to deal with bots. However, feel free to contact me!

And if you would like to support my work, please, consider doing so through ko-fi:

Support me!