Last week my friend LLB and I wrote an article about live coding. Or rather, given what the task consisted in, it would be more accurate to say that we copy-pasted the answers of six interviewees until the order felt right.
In their comments, they remember how and when they’ve discovered live coding and got involved, explain how they prepare for a competition, talk about their state of mind during a match, share their esteem for fellow live coders, and reflect on this new kind of e-sport.
Over the last few months I have been trying to push my understanding of Physically Based Shading, by actively exploring every corner and turning over every stone, to uncover any area where I lack knowledge. Although this is still an ongoing process and I still have a lot to do, I thought I could already share some of what I have learned in the process.
Last weekend the Easter demoparty event Revision took place, as an online version due to the current pandemic situation. There, I presented a talk on Physically Based Shading, in which I went into electromagnetism, existing models, and an brief overview of a prototype I am working on.
The presentation goes into a lot of detail about interaction of light with matter from a physics point of view, then builds its way up to the Cook-Torrance specular BRDF model. The diffuse BRDF and the Image Based Lighting were skipped due to time constraints. I am considering doing a Part 2 to address those topics, but I haven’t decided anything yet.
In the mean time, please leave a comment or contact me if you notice any mistake or inaccuracy.
Abstract
How do you implement a Physically Based Shading for your demos yet keep the possibility to try something completely different without having to rewrite everything? In this talk we will first get an intuitive understanding of what makes matter look the way it looks, with as much detail as we can given the time we have. We will then see how this is modeled by a BRDF (Bidirectional Reflectance Distribution Function) and review some of the available models. We will also see what makes it challenging for design and for real-time implementation. Finally we will discuss a possible implementation that allows to experiment with different models, can work in a variety of cases, and remains compatible with size coding constraints.
And finally here is the recording of the talk, including a quick demonstration of the prototype:
Interference shader
Here is the shader used during the presentation to illustrate light interaction at the interface between to media:
Acknowledgements
Thanks again to Alan Wolfe for reviewing the text, Alkama for the motivation and questions upfront and help in the video department, Scoup and the Revision crew for organizing the seminars, Ronny and Siana for the help in the sound department, and everyone who provided feedback on my previous article on Physically Based Shading.
FWIW – I think the model of refraction by the electromagnetic field causing electrons to oscillate is the better one. This explains not only refraction but reflection as well, and even total internal reflection. Feynman does out the wave calculations: https://feynmanlectures.caltech.edu/II_33.html
It also explains better IMO why a light wave keeps its direction in a material. If an atom absorbs and re-emits the photon there is no reason why it should be going in the same direction as before (conservation of momentum is maintained if the atom recoils). Besides which, the lifetime of an excited atomic state is many orders of magnitude longer than the time needed for a light wave to propagate across the diameter of the atom (even at an IOR-reduced speed).
Moreover, in the comments of the shader above, CG researcher Fabrice Neyret mentioned a presentation of his from 2019, which lists interactions of light with matter: Colors of the universe. Quoting his summarized comment:
In short: the notion of photons (and their speed) in matter is a macroscopic deceiving representation, since it’s about interference between incident and reactive fields (reemitted by the dipoles, at least for dielectrics).
Revision 2015 took place last month, on the Easter weekend as usual. I was lucky enough to attend and experience the great competitions that took place this year; I can’t recommend you enough to check all the good stuff that came out of it.
Like the previous times I shared some insights in a seminar, as an opportunity to practice public talking. Since our post-processing have quite improved with our last demo (Ctrl-Alt-Test : G – Level One), the topic was the implementation of a few post-processing effects in a real-time renderer: glow, lens flare, light streak, motion blur…
Having been fairly busy over the last months though, with work and the organising of Tokyo Demo Fest among others, I couldn’t afford as much time as I wanted to spend on the presentation unfortunately. An hour before the presentation I was still working on the slides, but all in all it went better than expected. I also experimented with doing a live demonstration, hopefully more engaging than some screenshots or even a video capture can be.
Here is the video recording made by the team at Revision (kudos to you guys for the fantastic work this year). I will provide the slides later on, after I properly finish the credits and references part.
Abstract:
Over decades photographers, then filmmakers, have learned to take advantage of optical phenomenons, and perfected the recipe of chemicals used in films, to affect the visual appeal of their images. Transposed to rendering, those lessons can make your image more pleasant to the eye, change its realism, affect its mood, or make it easier to read. In this course we will present different effects that can be implemented in a real-time rendering pipeline, the theory behind them, the implementation details in practice, and how they could fit in your workflow.
Revision is a big demoparty held each year at Easter, in Saarbrücken, Germany. Whenever possible, it is a custom in the demoscene to release a production dedicated to officially announce upcoming parties: an invitation.
Last weekend at the Ultimate Meeting, the invitation to Revision 2014 was presented. The quality of invitations can vary wildly, from rushed and uninspired to works of art (Kings of the playground or You Should are two examples that come to mind); this new invitation is rather on the higher end of the spectrum. Aiming for epic feeling, and nailing it, it imagines a time when the mostly unheard off sub culture has become a dominant one and the reason for a major Super Bowl like event in a Tron like set.
The Real Time Live! program looks very nice too, and it is good to see at least two demoscene related works will be presented there (the community GLSL tool ShaderToy by Beautypi, and some experiment by Still with a LEAP Motion controller on their production, Square).
Lastly, we had some awesome news yesterday, when we were told our last released demoscene production, F – Felix’s workshop, has been selected to be shown as part of the Real-Time Live! demoscene reel event.
Released last year at Revision and ranking 2nd in its category, Felix’s workshop is a 64k intro: a real-time animation fitting entirely (music, meshes, textures…) within a 64kB binary file meant to run on a consumer level PC with a vanilla Windows and up to date drivers.
This is the third day at Revision, and my contribution this year is the talk I gave yesterday. Unlike last year, this seminar is not technical at all but focused on the design aspect and, to some extent, how it relates to the technical one. The context is demomaking, but many ideas are still valid in other media.
There were some issues with the recording unfortunately, which means some elements are missing (you will notice some blanks at the beginning). In particular after 5mn, there is an important point which was completely cut out. The text was:
Throwing a new technique at whatever you’re doing is not going to make it any better. It’s only going to change what you can achieve. There are two sides of image creation: the technical one and the artistic one. Different techniques allow to do different things, and the more techniques you master, the better you understand what you can and cannot do with them, and how to do it. Technique becomes a tool that changes how you can express yourself.
Last year I gave a talk at Revision in which I summed up some of the things I had been gathering on light shading.
This year too I will be attending Revision, in Saarbrücken, Germany, and will give a talk about light again. I will present some of the new stuff I learned. This time the topic is going to be focused on the use of light from a design perspective, in particular in the context of demo-making. It will also be an opportunity to improve on the things I wasn’t happy with regarding the performance: hopefully a better diction, flow and construction.