Sponsored By

Realtime rendering with OpenGL: a student's perspective (week seven)

Adding in alpha.

Josh Church, Blogger

December 18, 2023

2 Min Read

Week 7

Adding in alpha:

This week was much lighter than normal, it may have been midterms, but I still wanted to get some work done for week 7. The task I ended up on and found most interesting for this week was adding transparency into the render engine. I first tried to just change the alpha channel for the vector passed through the FragColor, but it did not do anything. I did some research into it and found that there are some parameters for OpenGL that need to be updated in order to draw a scene with transparency. Namely, you have to tell OpenGL what type of blending you want then enable blending.


I took the toon shading method from the previous week and for one of the light intensities I manipulated the alpha. Below are two gifs, the one on the left had a section at alpha 0.1 and the one on the right had a section with alpha at 0.9.




Since this week was short in terms of technical information I will take some time to explore some of the non-programming specific skills I learned through this project. One of them was to do enough research into a topic to get a good idea of how you would start tackling the topic.

After I implemented alpha for this week I decided to look into some cool things that I could do with the render engine. I had been interested in ray tracing from the start of this project and I remembered a video by Sebastian Lague called (39) Coding Adventure: Ray Tracing - YouTube.

I decided that I would work on that for the next week, but come the next week I started doing more research into how implementation of ray tracing would work in a bare bone OpenGL engine and realized that I would not be able to implement it in 6 - 8 hours. This led me to waste about half of week 8.

The main takeaway from this for me is that when exploring topics that are new and have deadlines you need to meet, you shouldn’t let excitement for a topic take over completely. Rather than looking more directly into the implementation and estimating how much time it would take me I looked at example outputs of ray tracing.

It is not the most profound lesson, but I think it was good for me to realize that if I don’t take the time to estimate how much work something will take, then if it does end up being something that will take an extreme amount of time and I need to pivot then I will have wasted time needed for a deliverable that week.

Read more about:


About the Author(s)

Daily news, dev blogs, and stories from Game Developer straight to your inbox

You May Also Like