 Hi, my name is Martin Sopitis. I use Blender for less than 20 years, more than 10 years. I'm a teacher. I teach Blender at art school and universities. I also created the Physical Starlight and Atmosphere add-on and I founded a company called Physical Add-ons together with my team. The team is here in Blender Conference and I'm going to show you a presentation that's not going to be a usual presentation. For a couple of years this way of presenting has proved me helpful to overcome some of my anxieties and stresses and also becoming teacher has helped. It's running in Blender Game Engine. In this case it's UpBGE. It's a custom build of Blender and I started using Blender because of Blender Game Engine so I thought it's nice like homage to Blender. This speech will have three parts. One is more like an introduction part. The second is the culmination, like a problem and the third part is culmination. It will be a story, not a tutorial how to do physical, like advanced physics of atmosphere and social bodies, but I will show it to you as well. Anyway, when my teammate Daniels assigned me this presentation, I was like okay this is going to be an easy presentation. I mean how hard it is to tell about advanced physics of atmospheres and celestial bodies and then I started to write it down and thought okay without the context it doesn't really make sense. So here's the context. Yeah I will start from very beginning. This is me, my mom, my brothers, my brothers here as well. He's a co-founder of the company. So I come from a rather large country, Latvia, and so this is my primary school. And so there's a reason why I'm telling you. So it is important. Latvia is over here and there is also a small gallery of important pictures of the place where I come from and it's also important. I mean it's part of the context of this presentation. You'll see later. So yeah, the environment and the background it influences me and it inspires me and also because probably because Latvia, it has like 1.8 million people, you quite easily can do something and be special in it. I mean I started using Blender like 20 years ago or something like that and I was special. Everyone else in the industry was like, how are you using Blender? It's like, you know, weirdo. Also the background my dad was playing computer games. They inspired me quite a lot and I knew that one day I will be a game developer. These are some of the titles that really, really inspired me to turn to the storytelling side of interactive storytelling side of things. Yeah. Again, so one way how I imagine the I could go to game development would be starting drawing games, making concept art for games. So that's probably not the reason why I entered art school. This is the art school where I teach now. They also introduced me to, oh, the school had Maya licenses. I really, really liked the splash screens of these two Maya versions and I will return back to school in one moment. At the same time my dad bought me Mac and I think he's this idea of getting me a Mac computer so I don't play computer games. But Mac back then had actually some of the best computer games. They weren't maybe the big titles but they were the smaller ones and they inspired me to actually try to help myself. And yeah, one of the first softwares that I came along, also one of the first games I played and I liked it was a Google and it was made by a small company in Copenhagen over the Edge Entertainment and they had this engine called Unity. I thought, okay, well, it's only for Mac. It's probably not going to explode. I need to move to something else and I find this thing. Wow, Blender. It has a game engine. Let's try this thing out and it runs on Mac and Windows. So I ditched the Unity idea and moved to Blender. This is the thing that was, you got introduced by Blender and it's like, you know what? No. I just deleted it and I couldn't really get used to the UI and it happened for quite some time. But I really started loving Blender when 2.4.2.4.8 came because it had the GLSL materials there and 2D filters and Deli was the one who was responsible for these things. So I started bugging him about the features and feature requests and I created this scene. It was like a normal Latvian bathroom. My grandma had a very scary bathroom. It inspired me. So that's why it's also important that the background inspires me. And somehow the video of it got quite popular and it got into official Blender web page. It looked like that back then in 2008, something like that. And there it is, like game engine video made by Martin. It's like, oh my God, I'm part of the Blender now. And you know, it also gives a lot of inspiration and hope that, okay, this is the thing that I want to do. And yeah, I framed the screenshot. It's amazing. I still have it. And then, yeah, the video, I mean, it's not a lot of views. I mean, it was back then 600,000. And yeah, so I mean, I was super inspired by that and I knew that I will stick to Blender, Blender game engine. I mean, it's an amazing tool. So I will return now back to school. Oh, and this painting here. Now I finally start to make sense about the atmosphere. Back in art school, we went to National Museum of Arts quite often. And one of the paintings that actually stayed in my mind every time was this one. It's called, let's say, I'm written it down. It's called Valley of Gaulia. Gaulia is the local river in Latvia. It's the artist is Julius Fedders, 1891. And I remember myself staring at it and like thinking, wow, so amazing rendering techniques. I mean, like, look at that atmosphere there. It's like, how is he doing that? And back then I remember myself that, well, I couldn't really like, I couldn't, I didn't have the skills to understand like the basics of atmosphere rendering, but I could like, it really inspired me to learn these things. And also, you see the subsurface scattering on trees and then the glitter on the leaves from the sunlight. And yeah, this was probably the reason, or the second reason why I started to take deeper interest in atmospheric effects, reflections and light. And that also went throughout my art studies in school. Three days after Blender conference and my voice is now at the level where actually I'm happy about it. I mean, I would love it to have this deep voice for my entire life. But again, it comes with extra sounds. Anyway, indirect light reflections. I mean, in school I probably was weird or because there was no subject I was painting. It was these, I saw a reflection, I saw a nice light, I saw something and I just, you know, repeated painting it and drawing. I liked skin rendering, I liked reflections and clouds and atmospherics and it was something that went throughout my whole arts, art studies. I didn't really realize it back then. Now I just look at it back and I was like, okay, yeah, it starts to make sense why I like that. There's also this is a presentation built on another presentation. There's quite a lot of unused stuff here. Yes, at the same time, during the art studies, I still had this dream of becoming a game developer and so I had my drawing skills, painting skills. I started to, yeah, I bought, this is my first actual purchase of my own money. I bought a vacuum into a tree, I guess, and started to paint weapons, monsters, environments and live through this phase of concept artists for local game studios, like really local game studios. It wasn't nothing important but it was important in sense that I learned the 2D drawing skills, 3D modeling skills, UV mapping, unwrapping, animation, texturing. This is also a slide that doesn't really represent, it's part of the older slide so I'll just skim through it. But it's important to know that these experiences help me to understand how computer graphics works, how game assets have to be optimized and why they have to be optimized, why you should use one material or as less materials on single mesh as possible. So I started to automatically optimize things whenever it wasn't even needed. So you know, after art school, I liked art school. I mean, I was good at technical replicating skills and I quit the art school with confidence and entered the Academy of Arts with even bigger confidence. I thought it's going to be easy and boy, I was wrong. I mean, I went into visual communication department and there they taught us that the concept behind the art is important, not your technical replication skills. And even like I really made chair or urinal that's been put upside down is art if you can explain why it's important. And it's more about the emotion, not really the technical skills, how you draw. So this was a very hard time for me because I was kind of like out of my comfort zone. And during the first two or three years, I was really sloppy at attending these lectures. But in the end, I got myself, I got a little bit more comfortable about the idea that actually my technical skills can be also a concept, like a art form. And yeah, it is a valid reason to if you know how to draw. It can be created, it can be described as an art form. And one of my ways how I dealt with the times in the Art Academy was during the end of the semester, there was these practices and workshops outside of the countryside. We went the whole class and I took my laptop and my intuitions and everyone else was painting with oil and acrylic and I was doing these live digital speed paintings. And yeah, that was my thing. And back then I was like, okay, this is actually, you know, working out quite well. I will probably become illustrator or artist. And then I like what I do, it kind of like itches my, like scratches my itch of becoming, I don't know, it was something that like this feeling that I need to train my lighting and shading skills. And yeah, I graduated the Art Academy with actually quite a big confidence and I was like, okay, I mean, this is it. I mean, I guess it's the end. I'm going through the doors of success. So like, okay, I will become an artist and there's like, no, no, no, no, no. So there comes the second part. I found myself in open waters, let's say, it's a pun here as well. And also part of our new product. So my marketing team is happy. So you know, I find myself floating in the sea of computer graphics, everyone needs artists, everyone needs painters. So I need to start to earn my money. So I will do a little timeline break here. So for Daniels, this is our new product. It is, I'm developing all of my products as shaders. And shaders are written in GLSL language. GLSL language, mostly are the best way how I can make them are either in shader toy or game engines. I use Godo and up BG. That's how I developed them. And and then I translate them to Blender as nodes, nodes, nodes, nodes tangles, let's say. So I'll move to the next slide. So sorry for the timeline break. So it's the time, yeah, when where the illustration kind of starts to scratch the right spots of the edge. But still, I mean, it's not the same. I mean, I'm missing something. I was doing a lot of illustration for magazines. And this was how I earned my money. I mean, probably they couldn't afford photographer. So I was drawing the portraits. So it was probably cheaper. But the illustration was fine to the point where you're kind of like, I felt like I've stopped and not continuing my studies of lighting and light transfer through skin and light transfer through atmosphere. So so at the point in the presentation, well, I'm like, I'm like improvising. So let's say I turned to dark magic shaders. And shaders was my next iterative step into learning about or continuing my my art studies about light transfer and everything. So I mentioned the life of Linto and there was also Mike Pan who had this shader in Blender game engine. And it was called ambient occlusion and that of depth of field, I was like, wow, amazing, 2d filters are incredible. I took them, took them apart, started to think over them, added some new sampling methods and I was really hooked on them. These were like the first steps into into my shader, shader world. And also it was the time when when when when I started to become very active in blender community and Blender, Blender artists. And I shared all of my research work and my findings in Blender Blender artists game engine resources. It became my my second second home. Let's say every day I was like there and looking what's happening. And during the time I realized that I really love working with atmospherics, water reflections, it was something that's still approved, not really approved like it gave like a stamp. Yeah, I'm still continuing my art. I'm not stopping my art studies. I mean, I was I was learning how to draw and paint for many years. And then suddenly I was like, yeah, I'm going to I'm going to become a programmer. No, no, that's not how it happened. And during the times when I was doing the shaders, I was also not really programming. I was looking at other people's work, seeing what fits and just combining different ideas together into one thing. This was a demo I did. Now this one in last Blender talk here, I mean, like five, six years ago. And I'm still I'm still doing water rendering. And yeah, and these are some of the screenshots that that I made back then. Yeah, skin shading as well. And these were the main topics water, sky, skin, and also special materials. So here comes the third part. During these, yeah, probably the biggest reason why I got my first actual job was because I shared everything in Blender artists and YouTube and a doctor approached me and asked if I want to create skin shaders and shaders for for for for anatomy and and shaders for for for instruments. And that's like, okay, yeah, sure. And the first assignment was I'll try to find this is probably over here. Yeah, this one is the first straighter I did for him. And it's, you know, the camera goes inside. And I didn't know what exactly that is. But he was super impressed that I could simulate the the skin that well. And it's not part of this talk, I was just also skim through. I started to work in medical simulation, virtual reality company creating medical training simulators for doctors. And this was my job for over 10 years. And we did everything with blender blender game engine also was some of the driving engine in some of these simulators. And it actually worked quite great. Blender game engine is really great for not actual, like real games, but more like these concepts and fast prototypes. And then also for these very specific, specific use cases like medical simulators. We really knew that that then that blender is actually running in and teaching doctors how to operate. And this is my room of fails. I, I, I really encourage everyone to, to do as many projects as possible, even if you don't see the end of them. This was the time when I learned the most, the time when, when you fail the hardest, you learn the most things. And none of these projects saw the end of it. And for quite a long time, it's made me sad that they haven't really seen a public release. I mean, I spent like all of my life back then, I mean, I wasn't too social about, about going out with people. So I did these things. But then again, these failed projects, how I call them are the ones that, that are probably the most important to me. And now I'm at the room that I actually haven't seen myself. I, this is the presentation part that I just did on Miro's computer and I replaced the textures. It actually looks quite good. It's not a mess here. So another story, I mean, this is the last story before I turn to actual physics of atmospheres and celestial bodies. Yeah, so my first, first baby was born. And I realized that I need to take something like a half a year off my, my work. I mean, the work at the simulator company was so involving. And it was sort of startupy that it took all of my time off. I thought, Oh, no, no, no, this is like sucking everything out of me. I quit all of my jobs. And except for the school, all of my other works. And, and I created created an add on. I mean, I will see if it's here in screenshots should be here. Right. Okay. Okay. One of the screenshots is missing. I polished one of my tools that I use the most. And to a point where I thought, where I realized, okay, this can be useful for other people. And also blender market opened. And so, yeah, so I've sort of like finished it. I thought, Okay, it's going to be fine. I need some, some passive income for for the, for the next half year. And it turned out to be great. I mean, in gum, it opened. I launched it on gum route at first to blender market took its time to validate it. And after a while, yeah, I realized after months or two, that's okay, this can be actually a viable way how I can live. I don't have to work for anyone anymore. And now, three years have passed. And I have my team of people I can actually hire team and optimize things how I do, how I do work. So I don't don't overwork myself. I mean, it's not like that. Having your own company is like having another baby with and if you have already two babies at home, it's even even more difficult. Anyway, yeah, during that time, I realized that I can finally earn by by making exactly what I want. So I started to go and dig deeper into the actual physics of light transfer. So previously, I was using other people work to like, squish them together, add my own like artistic view to it. And now after after work in medical industry, I had this access to academic papers and started to do research. And more I actually read about these research and how to how to approximate things are more I realized how physics and science actually works. It kind of like still approximates things close enough that you can validate them in different ways. And it was it is very similar to painting, art, you're just so in school, you do painting of a subject for over and over and over till, you know, you get better, it looks nicer and nicer. And in physics, it's the same. I mean, you make one assumption, then comes another scientist, it makes a better, better, better function. And it replaces the previous one. So at that moment, I realized, yeah, I can actually come up, come up and stuff myself. And it's valid. It's not like it's it's it's it's not that it is wrong. I mean, CG in general, in many ways, is doing things wrong. It's like faking things and approximating things and like invisible, invisible shadow catchers and stuff and everything. And if it looks good, and if it if it touches your emotion, and then it's right, I mean, it's like art. At least I'm telling to myself, so I haven't really, you know, completely ditched on artistic side of stuff. Anyway, yeah, I started to work on on physically accurate shaders. And that look right, at least to me. And I base a lot of stuff on research. And 50% is also artistic look and artistic freedom. And while I'm satisfied with it, it's it's working quite nice. That's also the idea behind physical starlight and atmosphere, you cannot really find the exact solution in other scientific methods of rendering sky. So there's a lot of artistic freedom in it. And I'm quite sure that it's why it is working that well. And now we've finally come to come to the topic of the talk. Advanced physics of atmosphere and celestial bodies for a living. So, um, this is also part where I have to completely improvise. And I will show it also live how it works. But okay, so I'll just show some of the development screenshots these are taken while I was I was researching the shaders and different kinds of atmospheric rendering techniques and experimenting with with light transfer. So up down here, these are photos like this one, that one, this one here, this one also here. And they show effects that are so subtle that most of the computer, most of the techniques in computer graphic just skip them over, because they're, they're maybe not that relevant. Now it's time actually in computer game industry where these subtle effects start to appear. And they're for me making the whole difference. I mean, like this backscattering like halo effect around the viewer, same happens here with this. They're called sun dogs, but the Mia scattering of the back scattering from from the sun. Also this light spec on the rings, they might seem like artifact of photo, but that's actually the place where if you project the array from from from the sunlight through the viewer, it's actually like projecting on top of the rings and they these are the effects that for me make that they go the way to the point where I say, okay, this is actually something that you would see actually on on Saturn's rings. I mean, if it's not there, okay, that's CG to me. I mean, doesn't really interest that much to me. And these small subtle effects, they make they make they do this extra extra thing to me that I would actually be ready to, you know, explore the atmospheres in Blender and then consider it it actual travel to space. And and some of these effects also do do they they're so convincing or these they're so surprising that they surprise me in ways that like, wow, okay, so for example, this shadows on on the planet from the rings, it makes these nice nice light transfers that that are actually surprising me in ways that I couldn't imagine that my work could inspire myself. I mean, like, I sometimes paint something as like, yeah, it looks nice. But I mean, it's not like surprising me. Wow, what did I do? What's happening here? So yeah, I'm over to the part where 20 minutes. Okay, it's fine. To part where I can. Oh, yeah, this is the end of my, my last slide. Thank you for my for for attending the presentation slides to me. So let's meet on. No, you have a random. Oh, no. I'll open it. I know where it is. I moved it much space here. Oh, here's a demo of advanced atmosphere and celestial body physics. And so where do I start? So everything is done in world node shader editor. The reason behind that is that if you work with real scales of like real scales of the planets, use if they are meshes, they start to lose precision, you start to get into the place where you have to start to think here with with the near and far camera ranges to get some any result or some result at all. So that's why we are doing everything in in shaders. So all of the math here is done in in the magical shader world. So yeah, we're able to simulate planetary bodies, we can actually move away from them because it's real scale, it kind of maybe looks like HDRI if you move around the camera, and it's static to probably most of you. Whenever you start to go into light speed, you know, finally move away from the HDRI. And for example, go here. That's a few hundred thousand or no, a few thousand kilometers away from the origin point of Blender. And this way, we have an option to add extra planets. I'm going to try it right now here. It might might might be might be risky. But if you add extra planets, you could add moon at the real distance. And for example, without any tricks or or or or like magic, you can actually go to the moon as well. And if you go far enough, you can make Earth look like a star or a small spec and and it's still calculates everything there. You don't have like this precision loss. Then one added feature of doing everything in world shader that you have reflections for free are calculated in real time. Everything else. So here happens in EV. If it works in EV, then it also naturally works in cycles. That's our ideology. EV first cycles work anyway. Cycles cycles is easier. And now for the crown jewel of our presentation, planets with rings. So we call it Saturn, but it's also can be Earth with rings, or moon with rings, or, you know, sun with rings as well. The idea in the end is that this way we can simulate not only planets, or, or, or, um, oh, yeah, light speed. We probably have to well, I'll do it this way. Oh, yeah. Also, this planet is much smaller. So this is like only five kilometers in radius. And don't only 10 meters. Now the, oh, yeah, it's been offset here. Let's set it in the center of the scene. Now you have super big atmosphere. So yeah, also you have free, freedom to increase or decrease the radius size of the atmosphere. It can make nice, nice screensavers for your computer or background pictures. I have my phone lock screen that I haven't really changed for many years. So for a year or something, it's also from here. It's a business idea what our planets can do. Daniels is pleased. And, um, yeah, the rings can be rotated, changed and also, yeah, this is my favorite part. The shadows are being cast on the atmosphere as well. And you have these nice effects that I couldn't really see it in any, well, at least not in real world. Well, then this is the final slide of my presentation. Now, so for maybe some after, after thoughts of the whole thing is about the takeaway, let's say, is, um, yeah, I couldn't really gave the presentation about the advanced physics of, of, of, like, without you knowing that I come from academic arts background and my approach to coding and programming is not about physics, like basing, basing everything on physical papers. It's more like being an artist and what if it looks right, it must be right, right? And if it convinces most of the people, I mean, the real world does that as well. I mean, sometimes we are tricked by some actual phenomena and we're scared about, scared of it, but we, well, the actual physics to, you know, explain things. And yeah, my approach to coding these things, sometimes they are on, on, on, on, I'm quite certain that I'm doing things really, really wrong. But in the end, if, if, if the output gives you something that's, that's like a pleasing, pleasing render. I mean, yeah, I mean, that's, that's a right way how to do things. We have some time for questions. I forgot to mention that at any time you can also stop me. So it's too late. If you, if you had something that there was like, it wasn't really clear. I mean, I'm, I'm like running through the whole presentation. So that's why I, yeah, sorry for this. Right now, right now, now they are projected on, on, on a really thin slice of plane. But so it's in, it's in, in like a thought development that I could actually simulate how these particles are formed. Because it's not that simple. They are not just like specks of dust that, that floats around. They are actually interacting with each other and make these very nice shapes. So the inner ring is moving faster. Delta ring is moving slower. And it makes these very nice curved, curved spirals that you don't usually see in computer graphics. But I want to, it's my, it's my mission to simulate it. And so I will do it. Because I'm really like a space nerd. And I'm not doing this just to sell it. I'm just doing it for myself. So it makes me happy. With all the settings as well, I forgot to mention that we have indirect lighting as well from the rings. And if you move the sun around, the rings will, the light will interact with the rings and they will be reflected back on the planet. It's less, less performant than, than just without the rings. But also that's a problem at Blender. They don't have yet the uniform values. Whenever I change the sun position or something like that, it recompiles part of the code. And it's super slow. Other than that, it runs super fast. Like 20, the display has like 60 frames per second to run 60 FPS. Yeah. Oh, yeah. It's not really fake actually anymore. It was fake, fake ish for physical starlight and atmosphere. That was like a parametric, super fast one sample thing here. They are actual volumes. And we have three layers of atmosphere here. If you can see, for example, at this, this, at this shot here, the upper layer has ozone. It has like a physical ozone layer that does the absorption stuff. So it has like this blueish haze here, then there's the lower, lower, higher soil layers that gives thicker, whiter atmosphere and then there are a lot of scattering scattering that is this blue thing. In the future, we might add the extra layers because also we need a layer for emission layers for the thin, thin air glow layer and the aurora borealis so you can also simulate that. And clouds as well. Right now we don't have clouds. So it's, yeah, it's, it is more physically accurate than most, most skyshedders. And also, wait, yeah, I'll show you one thing. If you move back to Earth and you put the Earth at the origin point, so the surface is, so here's the Earth radius. And I offset the planet back to zero, zero, zero and minus radius. And I forgot to copy minus radius and extra meters. Then you have a skylight system. It's a physical starlight atmosphere to ish, but it's not really doing it very accurately, but it works. Let's see in the world. Yeah, also, textures and everything they work the same way. And of course, you can just, oh, yeah, light speed. Well, yeah, you can also fly away now and in this version of the sky system is not going that direction. Now it's everything. Oh, you mean, oh, yeah, okay, I got your question. There is a point where where you can make it even more complex. That's, that's where we have, we have had this limit already for, for, for water rendering. And the cycle says no, that something something is full the stack, something is full, you cannot do it anymore. And there, there comes the my, my, my, my knowledge of doing things in blender game engine where I had to learn how to overcome or overcome situations and you have to start to learn to be out of the box and find new out of the box solutions. And this is part of our job. So optimizing stuff, it's part of our job, it makes our lives much harder. But I'm really hoping for actual shader nodes someday, where you can just type in GLSL code in node, and it will compile it without having to do this thing. The node tangling. So it's like node inside of node inside of node, and then you just like start to realize that sometimes there's a loop but okay, at least, at least, at least Blender recognizes it and just like doesn't allow that anymore. So yeah. But I also believe that we're a bit in this spot where my patience on, on, on doing this is, is, is, is, is gets us a bit further in the blender market because not a lot of people are ready to, to make things these way, this, this way. So maybe that's helping us as well. I didn't run to understand the question. Yes. You mean like the planets, planets and atmospheres? So if I understood your question correctly, every, every shape there is a parametric sphere, spheres are really, really easy to trace and also calculate the lighting. They are real surfaces but not like polygons. It is possible also to use ray marching that we have already tried, but ray marching in nodes is without the loop node or repeat node that would be that that is really a pain also super slow right now. How to how to? Yeah. Go to blender market. Let's see what I'm looking for. Physical Celestial objects. There you have it. It's on sale right now. 50% off. And if you're super friendly, it will give you to do for like super friendly. I'll leave it here.