Nathan Baggs offers a masterclass in technical discipline, proving that true engine mastery lies in the elegant marriage of modern C++26 and low-level shader logic. It is a refreshing antidote to the "black box" approach of modern game development.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
FPS From Scratch (C++26 & OpenGL4.6) // Post ProcessingAdded:
Hello. Hello. Um, hang on.
I, as I continue to be incredibly [ __ ] at what I do, uh, I am I had loads of time, like loads of time, and I was fatting around. And I looked at the clock and it was said 7:59. I was like, "Oh, I don't have a shirt on yet."
Um, so Quo, I appreciate the message.
Yes, I'm okay. I'm just very terrible at this.
Uh, okay. Right.
Um, also means I've not had a chance to fully research what I wanted to do today, which I was what I was planning on doing just before the stream. So, be going be figuring this out as we go along. Um, wait for a few more people to roll in and then we can kind of get on with it. I think the Twitch thing is wrong. Twitch, how do I This is now processing done this.
Um, mysterious Quo Connor. Hello. Hello.
Hello.
You just need to bear with me for a second while I sort out my life.
Press that button. Got some buttons to press. Got buttons to press. Quo's still here after 18 months. Not sure why, but I'm I'm pleased about it. Uh um uh the other fun one is as I was my office is not particularly big, you know, sort of uh in the order sort of 3 m by 2 m. I was reaching over to turn the camera on because it's mounted on the wall and then I brushed against my uh electronic my standing desk and lowered it and then overwrote the setting and I can't remember what it was before. So I have no idea if this is the right height. It feels off but I think it's okay.
So So I think we're I think we're getting there. Uh, what I want to do is, uh, I wanted to get some stuff up to go through because I got a whole bunch of stuff to do today. Uh, as always. But, uh, hang on.
Which window is this? This.
Okay. Don't want that up. Okay.
Up. Okay. Right. Okay. Um, I was hoping to have some more notes off screen to go through, but I [ __ ] it. We'll just figure out as we go along. Okay. So, today's goal, post-processing. I want to kind of finish off the renderer to kind of a point where it doesn't look as [ __ ] Um, and then before we go on to physics, so I want to do a bunch of post-processing effects over today's stream and next stream. Uh, I'll go through what those are in a minute.
There's kind of like a minimum set I think we need plus all the dials and the handles and the nozzles and all that kind of stuff. So, we're going to go through all that. Um, add all those in, which should be fine. And then I want to do a bit of um not necessarily profile bit of profiling but not necessarily performance tweaking but I want to start getting some metrics on um how long each step in the uh each like um OpenGL part of the proc pipeline takes like how long each render pass takes that's the word I'm looking for um how much memory allocating what are the threads doing that kind of thing I think that would be useful to have before we start adding some really complex I don't think we're going to necessarily do anything with it, but I want I want I want more graphs in immui. I want more graphs. So, I think that'd be fun to spend a stream or two wiring all those up. I think some of it I've done before, but I've definitely definitely never done the is it the OpenGL query performance thing. So, I think that would be kind of fun to stick some of those in and see assuming that's the right way to do it. Um, how bad do we me do we mess up with the featur? Uh, who knows? Who knows?
Yes, cuz I made a few. Basically, what I'm going to do now is I did some work off stream because I really wanted there's a bunch of there's a bunch of tedious refactoring I want to do. Okay. And I started it and I made such a pig's ear of it I had to back it out and basically throw it away because what we want is handles for entities. The moment we have handles for point lights, we want handles for entities. So again, we can kind of query whether the hand the entity still exists.
And then I was like, but if you're doing handles for entities, you might as well have handles for like the render data, right? Because there's there's there's a bunch of data we have to upload to the GPU per entity. Okay. Right. And I was like, that that sounds like perfect for a sparse set because we can then rather than at the moment we loop through each entity and upload and write to the although it's a coherent persistently mapped buffer, we still do n writes for n entities. So, if that's all just in a sparse set there, we could just do one big right. And then I was like, well, I'll start there because that's what the end goal is. Um, and um, yeah, I was made such pigs of it, I had to back it all out. So, I've done some of the other refactoring steps I would have had to have done anyway, but I've still not gotten up to making entities handles yet. So, I might do that off stream because it's it's really tedious and requires a few beers and a bit of thought. But, I'll show you what I've done. Um, and then we'll kind of go from there. Uh, yes, C has had the threading library since C11, right?
Okay, let's press the button. Okay, so what did I do? What did I do off stream?
Hopefully, you can see some of these commits. I uh clean up a test cuz I had this random code in the test. Didn't want that. Uh, I had a bug in um the resource packer which I wrote off stream anyway, but I copied the code from a previous project where I wasn't correctly getting the material index.
Um, would you consider unscheduled streams when you sit down to do what you consider boring refactoring helpful as a hobbyists? I don't know. I I go back and forth on this because like coding live is very strange, right?
because I have to I have to write code and I have to explain what I'm doing and I have to respond to comments and try and be entertaining and engaging and is there's kind of like um it there's a lot of things in flight and I think I've gotten a lot better at it over the years, but it's still it's still quite challenging and for like a refactor like that sometimes I just just need like the quiet space to do it. So I don't know if I'd actually get it done in a stream if that makes sense. Um, so yeah. So anyway, I fixed this bug because this was going to prevent us having other this is going to this had some knock on effects later on. Um, I'm always always deducing this. Uh, I've updated the re the I mean the gun model is in there, but it's not currently workable, but it is it is in the secret assets now. Um, we have default textures now. So before we have like the albido and the normal map and the specular map, those are now nonoptional. The entire rendering pipeline assumes you will always have those textures, but there are default one by one pixel textures for all of them all in the DDS format. So the re what the resource packer can now do is basically say when it uses as simple to pass the model, if you've not supplied it with say a normal map, it will put in the default texture for you. Um, I think these are in secret assets, but they need to be moved over, but I'll do that later. So, yeah. So, now we can kind of make this assumption that there will always be texture driven data, and there's a fallback for all of them. So, I think our vido is pink. Um, normal is that weird blurp like normal pointing straight out. Uh, specular is black, white, whatever the default makes sense is. Um, I then went back and cuz I realized that the I wrote all the code that does the um resource packing uses YAML, but it did it before I did all the reflection code because I wanted to do that live. So, it was using like sort of I guess vanilla kind of loops and stuff like that for building up the ammo. So, I went back and I changed all that to use a reflection which stripped out of the code which was really nice.
And then uh I had some bugs in the multibuffer which I think I don't know if Mr. Stake is here but he's pointed out I've done this before. I I have a habit of doing this. Um I don't correctly when I've got the triple buffered coherent bit persistent nonsense. I wasn't correctly picking the right offset. So if stuff changed too quickly um you would get those weird artifacts. Um so there's that. And uh and then I guess the real big change is uh hope you can see this. We had material data and we had object data. And object data effectively contained an index into the material data. But I realized material data and object data were a onetoone mapping. Like whenever you added a new object, you always got a new material.
And whilst this is technically shared with other objects of the same mesh, the extensions I want to do going forward will require per model material data. So I basically just deleted this and I combined it all into object data. I don't know if it's you can see this somewhere because that changes across all the shaders. And I went through all the shaders and I deleted all the bindings that were just kind of hangovers and left over. But uh basically object data now contains uh handles for the various thing and I added um I've added a glossiness one which is the PBR roughness. So we kind of have access to that now. And there's some others as well which we need to add in which is going to be emissive and uh the baked ambient occlusion. But I didn't want to do too much off stream.
So we'll be doing those at some point together.
I might do the pre-baked AO one because it's just it's just wiring stuff up. But emissive is really important and I want to do that al together. And then what's the other one I did?
Uh oh yeah, so I realized I was being stupid.
Um, we were binding the texture array, right, which is the global list of all textures and the bindless handles, which is sampler 2Ds under the hood. And then we would always bind that array into an as an SSBO. So a shader had had access to it. And then we're passing like indices into this. So like index four or seven or whatever your favorite integer is that is presumably pointing to an index texture. I realized that was stupid because I can just pass in the bindless handle directly. So now none of the shaders directly use the global array of textures. Those are just there and resident. But now I pass in I just pass in bind the samples directly. Um so it basically removed a texture lookup. Um so functionally the same but I guess technically more performant and it was just a bit of a rework. So now you'll see here everything is in 64ts whereas before they were 32ts for an index and now they are oh that's a typo. That should be index. That should be handled.
Fix that later. Um yeah, these should So if you go to uh render entity, we now pass in we construct this with I've actually started wiring all these in even though I've not used them all yet. So this rather than now having like a I think before we had like an in the texture manager return an index and then you would assume index plus 1 2 3 4 were the various uh materials that you needed. Now we just pass in like the bindless handle directly. So it kind of cuts out a load of stuff like that.
Yeah, binus handle is is the pointer into the GPU memory effectively. That's that's the way I understand it is you make it resident so it can't move around and then you can access the texture directly by that uh context for auto camera but it should be something like context for auto camera this auto self not sure I'd have to have a look uh it's probably just a mistake on my part uh and then finally I went through and I wanted to wire in I wanted to have a play around with the glossiness this because uh the it was looking a little bit flat the lighting.
So I went through and I'd had some mistakes in some of my shading code. So I was basically I think I was always return I think I was always reflecting like a white light. The the specular component was part of the light which was wrong. It should have been part of the material which derives from the roughness. So different materials will inherently have different specular amounts rather than like the light. Like a light doesn't care how shiny the thing it's reflecting off of is, right? So, we pulled that out, worked in the glossiness texture, fixed up some other bits and pieces. Um, and now it looks a lot better.
mistake. Hello. I was just uh I was just uh telling everyone how you pointed out before how I had a bug where I with my binding my uh persistent map buffers and then I went through the code and I found that I had two more of those bugs that had just been sat there.
Um, so now hopefully you can see that the uh the reflection here actually kind of has the color of the light rather than just being sort of like super shiny white. Um, and then bottom right, this my my big bold tones in the way, but can you see it's multiple colors now? Before that was just effectively the specular texture baked into one channel. Now, this is the specular and the glossiness baked into one texture. So, we kind of just we have access to both of those bits of data in the lighting path. So, when we come around the corner now, you should see that yeah, like the lighting looks, I think, a lot more a bit more realistic. You can actually kind of see like the red and the green reflecting more on the floor.
Some of these lights now are way too bright. Um, which I think is just a symptom of like my bad shader code before, but um, yeah, I think it looks a little bit better.
Oh man, it's got to be Halo, right?
Which the unless I I really want to go kind of Halo vibes on this. Um, so yeah, what I really want to be able to do is have this fan spin, but I want it to do it via a co- routine, which schedules itself every tick to rotate it a bit more, but I want to do that via the entity handle rather than entity pointer. Um, so yeah, so I think I think we're getting there, right? I think this is looking a lot better. Um, it needs an awful lot of tweaking aesthetically, but I think the goal now is to put as many hand like dials and knobs and levers in there as possible to start tweaking it.
Um, so the the post-processing effects I want to do kind of in order first are fog. I think we need some visual cut off, right? So we can make the I'm not like indie horror is like super played out and I hate horror games but I think make it a little more atmospheric by having like a limited vision like distance. I think that'd be cool and again tweakable so if we don't like it we can just turn it off but I think I think it's quite a simple postprocessing effect to add. I've got found some articles. Um, then I want to do chromatic aberration, but I want to do it. So that's where you it simulates a lens not being able to fully focus the lights and you get the color banding, but I want to do it radially so it just applies to the corners just to kind of give it a bit more visual interesting around the edges, right? So not like super in your face, but just like just distort the corners a little bit. Uh, and then based on that, I probably want to add a vignette as well. So you just darken the corners a bit just to focus it in with a custom color. So, like I don't know if you're shot, maybe you can make the vignette bigger and red. I don't know.
It might look [ __ ] but we'll give it a go. So, I really want to do uh fog. I want to do chromatic aberration. I want to do vignette. Then I want to do what else do I want to do? I want to do noise, like a basic uh film grain. Just basically I'm trying to cover up the fact that I'm going to be buying a lot of assets from different artists and they're absolutely not going to gel at all together. So, I think just a little bit of noise. Again, let's experiment around with it. This might be something that we increase as part of gameplay, but I think it should be there.
Then L, but I might do that off stream because I've not built a lot yet. I need to play around in Photoshop and kind of I think we need all those other effects first.
Then after L, I think that's probably most of the post-processing effects I want. Then I think we need to do emissive textures. So, write the emissive textures out from these materials that we've got. And then we need to do bloom. And I think once we've done that, I think the game's gonna look pretty pretty things going to look better. It's going to look different.
So, next couple of streams is going to be just rattling through those. I think uh uh I kind of want the flexibility. I think I I just don't know if this tone mapper kind of gives me exactly what I want.
Um, so again also like just learning experience. I've never written a lot before. I've never done like the lookup code for it and stuff. So I might as well throw it in, learn something, and then if it's total disaster, I just remove it.
Um, so again, like a lot of this is just my own kind of learning. And then I want to go through and do we might do some optimizations around um the render targets because these are all just like big fat floatingoint buffers and I don't think they will need to be. And then there's some special like HDR specific ones like R10, G12, B8 or something like that. Um, and then we'll do some um uh we need to skybox at some point as well, but I'm just going to pull it off.
Uh, so yeah, I think we're going to get going. I think we should write some code. So, I found some articles.
Um, if I can't find an article I want, I will have to defer to the Oracle, which is a bit lame, but like must must make progress, must find information. Um, so I found this, which basically says how to do like the different fog stuff, and then I also found this, which gives some actually better code. So, I'm going to try and work this in. Um, I guess as well like, uh, frog's probably going to go before tone mapping. I guess so in the in the I think what's going to end up happening is so I have a tone map right fragment shader I think this is going to eventually be renamed to postp pro excuse me postprocess and I think it's going to do all the post-processing steps so let's add a fog one to here okay and then see what we get to yeah I'm going with exponential because I read somewhere that that is better for for in fact I Yeah, exponentials two or squared or whatever.
Hope that sounds interesting. Okay, so I guess first thing here. So, we got the tone map. We're uing um Yeah, exactly. Yeah. So, I don't I don't it doesn't have to be like I'm not shooting for photo realism. I want to shoot for like atmospheric and interesting. Um but uh cuz we're not doing PBR like there's loads of other stuff we're not doing. Um but I think we can kind of just use some like easierish techniques to like sort it out. Okay. Right. So I guess so that does so that applies the uh the luminance I think averages luminance. Is that right?
Is that where that comes from? Yeah. So, do we do it before does fog come f I've already got I've already got myself stuck now. Do I do fog before or after I do dynamic uh exposure?
Yes. But do I apply fog to in color before I multiply by the by the average or do I do it post this?
because I'm going to have something like uh I guess what float bog it's multiplication so it shouldn't matter.
Sure.
Uh blown depth. So we're going have to bring the depth buffer over. Uh vec 3 color ve 3. Oh, no. Then the others we So, we're going to Oh, no.
Uh, I guess we do. Uh, what's this article say? You do? You then mix it.
So, So you're going to return something like mix uh in color u fog color fog amount right and fog amount you'll derive from the depth right so float fog amount equals 0.5 right and then I guess this will be in color equals uh fog depth when I get it in color. Something like that. Something like that.
Uh yes, IB cloud.
So something like that.
And then we'll wire it up into um imui so we can toggle it and see the I think there's other factors in there. I think you need like a fog density for the exponential one. If I'm looking at this correctly, you have a uh you do expum this is some sort of approximation of that of the distance times the fog density times the fog density. Well, this squared, right?
Yeah. So, I'm not sure which way around it goes, but I guess it's actually kind of we can we can we can try both, right? And see what we like.
So, depth. So, we're going to need access to the depth buffer. So, start wiring these things in. So um so u depth texture right uh and then we can do uh uh float depth equals texture u depth texture in uv r. All right so that will give us the depth. So we can do that and then we're going to need another uniform. I suspect I will pull all these out into an SSBO having all these different like random uniforms around because I think this is going to get quite unruly. But let's make it work and then let's refactor it.
So then this is going to be uh loc uh location 10 and then uniform ve 3 u in fact uh we we could pack it into a ve 4 and have the density and the color as one.
I don't know if that's I think that's kind of cheating cuz I don't I think unless you profiled it and like some reason you need to start doing packing stuff like that. I'd rather I'd rather keep it uh clear. Right.
So, we're going to do So, we got we got our uh So, this is going to be float fog amount equals exp uh of depth times U fog density times depth. depth time u bog density, right? I think HDR color. Yeah, I think to be honest also I'm kind of like I'm happy for there to be some mistakes in the shaders if it kind of looks okay if that makes sense. It's like it doesn't have to be like absolutely pristine like photoggrammically correct.
If we put a load of GLSL in there, it looks like okay, but like it'd be nice to be able to follow around. Um, so I mean I think this project is doable in C. I just think you'll end up running a lot more boiler plate, right? Because I rely quite heavily on the existing C++ primitives, hashts and dynamic vectors and RAI and all that good stuff. So I think you would have to rewrite a lot of that or find a library to do it.
Uh but yeah, you I think in my specific style I think you'll struggle quite a lot because I use I heavily lean into C++. So like coins and ranges and stuff like that and concepts and a lot of templating. So I I think you could achieve the same visually composited frame in C, but I think the code would be very different to what I do.
Okay. Right. So, let's let's see if let's see if one can fog and wire these up into the tone mapping path. So, let's do scene. All right. So, we're going to want a I think we might want to collapse all these down at some point, but let's do struct fog options.
And this is going to have a color color and a float density. Uh I don't know what's what's a good starting density. 0.5, right? And then this should equal uh color.
No. Is it colors?
Um, okay.
Okay.
Not zero. Thanks.
Nailed it. Okay, so let's do we're going to be fog options. Fog options.
And then con expert auto fog options.
this auto self because we're going to want to use deducing this so that we get const when it needs to be const not const when it's not or or auto and then we're going to have uh fog options fog options we actually need to add a member variable for that fog options underscore we're going to move it even though it doesn't really make any sense but whatever at least consistent with the rest.
Pog options.
Pog options.
And then somewhere down here options and then f options. Cool. Okay.
Uh, I've never really used either, so I don't have much of an opinion. So, what try both and see which you which you prefer.
Uh, I suspect mono game will be easier because Ray Lib is just a framework for like windowing and rendering, basic rendering, right? So, you probably have to do more work with Rayb. Um, that's kind of my an educated opinion. Uh, okay. So, let's go to my least favorite file, the debug renderer. So, where do we do the SSAO stuff?
New SSAO options. So, that's all there.
So, I guess above exposure options.
Uh I suppose below exposure options cuz it's below the exposure settings in the other one in the uh scene. But bloody hell actually no cuz that's just the luminance and stuff. So I think the opions or it should be above it. Let's put it above it. There only so much uh fog options. And then we're going to this this I feel could all be reflected out by the way. All this all this gubbins I absolutely hate and I fully plan on reflecting out at some point.
Uh dot uh fog options dot color and this should be uh is it color picker three color.
Where else do we use this color picker three? Need this value there.
M copy into value the address of scene options dot color size of value.
And then we'll stick value there. Then if we do this, we're going to do copy that back into at scene dot fog option options dot color uh value size of size of value. What we thinking something like that?
Where's Matilda? There's uh I think 4.6 is great. I really like DSA. I really like MDI. I really like all the other TLAs. Um I think we're getting on pretty well with it.
Uh I mean, neim setup is kind of I just I used kick kick kickstarter kick kickstarter is that it uh I used near kickstart right which is basically like a sane default beginning setup for near and then I just tweaked it from there. You can find my dot file as well. I think someone's already linked it. That's kind of where I started. And it's like when you're faced with any kind of system that's fully customizable, I always think, "Yes, I can tailor it to exactly what I want." And then I'm like, "That's an awful lot of work." So, I'd always tend to find someone who's done like the leg work that kind of gets me 90% of what I want and then tweak it from there.
Okay. So, after that, we can do this. So let's do auto value equals scene dot fog options dot density and then if slide what uh what do we think is a good like 0.01 0.1 F to like what's a good density? Is it is it between zero and one? Is that is that is that the density we want or does it I suppose we just [ __ ] I could put something down and see what happens. Uh value I got that the right way around.
No, not at all. Not even not even close.
So I I get what you mean and I totally get what you mean when you say you like defaults for like editors and stuff and that makes sense. What I actually like is consistency and I want and reproducibility. What I really want is to be able to go to a new system and with very little effort get exactly my kind of my system up and running which you get for free with defaults, right?
So I do understand that. This is why I kind of try and keep religiously track of my doc files and only use tools that I think I can repro I can use across different systems. So, I'm very particular about um color schemes and fonts like fonts you can install anywhere, but like color schemes specifically because I want to make sure that whatever color scheme I pick, I can use it on any tool.
Harand, welcome back. We're trying to do some post-processing.
Uh sorry, question. What is the package location? Uh yeah, so this just means this just forces you to access it through the global namespace. It has two purposes. One, it instantly starts the autocomplete, which is quite nice. And two, it's a just it's a it's a personal preference, but it's a visual uh identifier to me that it's code I didn't write. So I will put this on any platform or third party code. So at a glance, I'm like, yes, I didn't I didn't write this. I mean, obviously, I wouldn't have written this because this is not my naming convention, but at a glance, I'm like, yes, this is third party code.
Yeah.
Shush. Okay. Fine. And then we're going to do scene dot fault options dot density equals value.
as this returns a reference.
I wonder if I could just put it in here and that would just work.
Am I being stupid?
Pass. All right, let's just see. This will this this this will not work.
The best way, right, is to to just write lots of code. like you've just got to you have to go through the mechanical action of just typing out lots and lots of code, seeing errors, hitting problems, and kind of working your way through them like and and basically trying to avoid like outsourcing all that all those kind of mistakes and fun bits to LLMs.
Nailed it.
Oh, cuz I'm not wired in any of the bloody uniforms yet, have I? I really wish I really wish OpenG would tell you that if it's like you've not said anything with this uniform, like yeah, cool. Thanks.
Uh, I want to use like the latest and greatest C++. I want to use all the new features as soon as they're available.
So that's why I'm on 26, right? And also like part of these streams is for me to kind of talk about new C++ features and how you can use them and how I use them and the interesting parts and stuff like that. So we kind of want to be using the bleeding edge, right? So lighting pass now has more un no post uh tone mapping to mapping. Here we go. Right. So we want to do uh G buffer RT dot depth binders handle. Right. And then theme dot fog options dot color theme dot fog options dot I think a refactor is on the cards for this. I just like smashing more and more uniforms in.
Uh the part time's not too bad. Like it's it's not too bad. It's okay.
If you're struggling for project ideas, like then I think that is a good use of the Oracle. Just go and ask for like 10 beginner C++ projects and pick the one that sounds the most interesting. My go-to projects for any when learning a new language are always a ray tracer and you can look up the article ray tracing in a weekend. That's absolutely great written in C++ and then some sort of networking like client like a TCP echo server or something like that. something that gets you using like the platform and doing fun stuff like that. Uh what is going on here?
Uh so okay so black means I think it must be the density right It does look like depth of field, doesn't it? Whoa. I think I think my math is wrong.
Yeah, rewriting like standard Linux tools is great as well, right? write ls, write cat, write muka, write and some of the extra some of the fun like um command line options with it as well like write like a utility that you could drop in and use dayto-day.
It might be one over per I think you might be I think you might be right.
Yeah. Is that what this is saying here?
Uh map So we want to do fog amount is 1.0 f over x per that assuming I've got the depth mapped in correctly which I think I do.
Looks better.
What if I said it's like blue? I've got so many lights. Hang on. Let me just like stop flashing for a second.
All right. So, in theory, like I want to be able to like not see the end of the hallway, right? That's that's the goal, right? So, if I feel like it's just changing how much it mixes this color in.
Well, that's just the that's just the AO pass.
What? Oh, is the SAO not being bogged?
I still feel this is wrong, right? Like I feel like I feel like this is just about flying like a haze over everything. And I feel like after a certain distance, I shouldn't be able to see anything, right? But this is no matter how far back I go, I can still see the details.
It does not agree. It does not seem very depthy. Uh, what have I done wrong?
Seems the depth is not correct. Let's just uh who's depth do I want?
Suppose we could just check against uh the SSAO pass, right? because that correctly uses Oh, that doesn't use depth, doesn't it?
Doesn't that use the um world position?
We could actually change this. So, um what might be easier is if we do, uh what when we do SEO, what do we pass in?
And we pass in bonus handle one and two which are the uh Gbuffer rag uh out color normal pause. So pause is 012. So it's this one. So I wonder if we need to pass this in instead.
because the I think some point out the depth is probably not linear. Um pass that in instead which would then give you XY Z. So I think we can then go to light pass frag and then do change uh sorry uh to map frag and change the depth to zed.
It's the wrong way around.
I mean, it's cool, but it's it's the wrong way around.
Use world space position to calculate fog. Is that not right? Do I not want the Oh, hang on. No, no. Don't I now need to pass in the camera position and do the distance is the depth and the distance between the camera and then the world position.
Do I need is that? Is that right?
Just an average buffer, mate. Uh, what one takes camera?
Does this does this calculate a depth?
This has a sample depth.
So I get the sample depth here. This is how I do it in um the SAO which does work which is why am I turning by the view? Oh, this is so much more complicated than I thought it was going to be.
Can I I wonder if I just need to do this and then do uh Oops.
Ve 3 I equals uh ve 3 camera position dot and then depth would be uh keep this on the same line.
Uh so then the depth would be the so this is the uh frag paws right do I use u no I've just it's uniforms or ssboss and it's those are two are bust I'm afraid I should probably wire up u bothered um so then can I to float depth equals is there is there length of hang on a b so rag minus i is that a thing just make it up Uh, place a customer back three at 63 XY Z.
Uh, not wired it up. Not not not pass the uniform in. Not pass the uniform in.
Sorry. Not pass the buffer in.
should it shouldn't yeah bad bad things should happen uh right renderer where do I right camera yank 2577 go down to here put this in as buffer too.
I could do with abstracting out how that all those buffers get bound as well so I don't keep making mistakes around the moving the triple buffers.
Okay.
On if we Why is it still the wrong way around?
Like I feel this is kind of what I wanted, right? So I can change like the fog color.
It's still messing up with the S with the SAO. That's fine.
Yeah, 726 is great.
Uh, also where frag. Uh, should I be applying SEO here anyway?
Flip the mix in the fog function.
Interesting.
Or I guess I could just do one minus fog amount.
Uh, no. I do not have a reverse death buffer. We're not sampling the depth buffer anymore anyway. I think it still says death buffer, but it should be positioned as that's dark. Can't see [ __ ] That's better.
Can I give this like a a purplish hue?
Yeah, that looks better at that. I think that adds a nice little like atmospheric glow like to I mean maybe purple's not the right color. Maybe it needs to be darker with a little bit of a hint of something but almost black. Bring that forward a little bit with the mix rest. The falloff might be logarithmic. So, so do I need to then do I just need to do one minus the fog amount then getting there? I just trying to work out why my I think I'm doing the occlusion in the wrong place. I think I need to do this and then do in color times equals uh occlusion and then drop this from here.
Oops. [ __ ] sake. Start. Keep sake again.
This game is coming to haunt me.
Try depth equals minus depth.
Uh in call out.
Where's one?
Well, take an hour to do what I thought would take 30 minutes. Pretty pretty standard. Uh, that needs a much better default as well.
That's better. You don't get the occlusion now in it. So, I assume still Yeah, you still get the occlusion, which is nice.
I'm glad you're enjoying it. Thank you very much. So, that's We don't want it too I'm not making a horror game, right? But I do want it like I think a purple looks really It looks really cool.
It's just it just breaks up the distance a little bit. Do you know what I mean?
It just it just adds that nice little kind of atmosphere to it. And because it's a uniform, we can change that. We could write C routines that you know when something happens like the fog color changes, but that's I need what it looks like in like a bigger room.
Yeah. I think that range needs to be much different.
Yeah, because I kind of want it to be a little bit more impactful in here as well.
So, as you're kind of moving around like the fog does, I suppose this effectively gives us a colored sky box as well, right? Because that will just be whatever that is.
I don't know. I like that. I think that's good. I think Yeah, it just I think it works quite well with the um dynamic exposure as well.
Yeah. Yes, it's true. I think there's loads of stuff we can do now. Like again, it's just the whole point is just wiring it up. But that that I think is much more atmospheric.
So if we if we drop completely drop the ambient light now cuz I don't think we really need as much ambient light.
This is way too bright as well.
Let's make this a little more constrained and drop it down as well.
Yeah, it's starting to it's starting to look good. It's starting to look good.
I'm pleased with that. Right.
Does it Does it save? I don't think it does.
as in if I uh don't think we have the so the lights have changed. We don't we just need to wire this into scene uh into description. Yeah, this is the issue. So description should also have uh options.
12 options. Oh, we need to change the range of the values as well.
Yes. Um, I think because I had a bug in the lighting code, we had to make the attenuation values like incorrect to actually see them visible. I think I need to probably just go back and spend some time tweaking all those values and making them more sensible again. What do we think was a good sensible for this?
Like 0 0 five 0 0 five. And then in the debug renderer, uh, we want fog density to be from like 0.0 five to Yeah, let's do let's do 0.5.
No, actually that's two. Let's do 0.2.
Let's do what says uh scene and then scene. So when we des serialize this one here, we need to do fog options description dotfog options.
Can do zero to turn off. Would that make the maths still work?
Okay, here we go.
Okay. Right. So, let's do that. Do this.
Do that. Uh, this will now not run because it will try and des serialize.
The problem with the only problem with this dynamically generated like reflective based serialization, it's absolutely great, but it's not versioned in any way. So, if I add fields, I have to again manually add it. So, at least build the first time. Um, so we're going to want what's going to want like fog options.
Fog options color R not G.
And then in fog options color we're going to have density and that's going to be 0.02. I think that I think that's all we need and then got an hour. Let's see if debug renderer 314 debug renderer 314 missing field fog options don't think you are you are take it all back take it all I'm not going to do the refactor now. I think I might do that off stream about renaming like it to a post-processing rather than to mapping and putting them all in like an FPO or something like that.
Uh so yeah, zero turns it off. That is basically cannot see shite. And then there I think we said was kind of like a good one for now. Make it a little bit purpley dark purple. Very dark purple. the brush purple.
Bring in a little bit.
So, we get some of that movement around there.
Nice. Okay. So, hopefully that can save.
Then we can reload it and we'll get back that same depth and purple value there.
Uh, I never really I've just not had the time to spend with Russ, so I don't really have an opinion on it, and it's not really fair for me to have an opinion on it. Oh, nice. Yes, signal works.
Yeah, that's true. Yeah, but for like the scene we're building now, I think that looks pretty good cuz then if we back out of this, it should start creeping in.
Just it just breaks it up a little bit.
Do you know what I mean? You can't just see infinitely in the distance. And I think having it exponential is quite nice. See, it's much thicker further away and it doesn't really encroach too much on your sort of where you can see now.
Right, let's do some commits.
Uh, so a lot of these are quite tied together.
add black color uh add fog options and then it's basically render fog commit update scene file.
Okay.
Yes, true. Yeah, it would have given a sense of scale, I think, to a larger world. But I think for now, again, I'm just I just messing around with it as I go along.
Okay. Right. I want to do So, can I find the article that I was using for this?
Uh yeah, just like uh um there's a really good blog series about uh post-processing effects, but I whenever I look for it, I can never find it. It's in my bookmarks somewhere. How does one search in bookmarks?
Bookmarks search for uh post uh openg uh shader.
This is it.
I think this is it.
Yeah. So, this guy has a bunch of uh post-processing like shaders for gamedev, which I think are quite useful.
Uh my and it even has so it has lookup table film grain. So, this is how I was getting ideas for a lot of these. Uh it has chromatic aberration. My favorite part about this site though is that it uses Imur and because of the online safety act here in the UK is basically blocked for everyone. So, uh I can't I can't view any of these. So, um so you have to take my word for it. Take my word for it. Um the only problem is uh the only thing is this does it linearly and I want to do it radially and I can't I'm not sure if I'm going to be able smart enough to work out the maths. So, I might have to unless anyone can help me work it out. I couldn't find an article which shows exactly what I want, but I'm pretty sure the Oracle will know what to do. So, um yeah, yeah, animation is like like rigging and skeleton animation is way down the line.
Got to do physics first.
I think we can start wiring it all up, right? We could at least let's we could at least do what he's got here to get the linear one and then we can maybe figure it out from there because I only want it to be in the peripherals. Um but I think a lot of the options are still going to remain the same. So let's do uh watch as I spell this wrong every single time.
Promatic aberration options.
Okay. But I don't know the specifics.
All I know is that there was they basically didn't make themselves compliant with whatever the UK wanted.
Um, let's do float red offset.
I'm going to pick his defaults.
Okay. Whether they whether I want them to be my defaults or not, I don't know.
6F.
Uh, blue r= minus0.06f.
Okay, fine. So, I think we're going to look we're looking at quite a tight quite a small range of values here. Um, so blah blah blah blah not adding it to that. Can I get away with not adding it to this?
Uh, chromatic aberration options. Chromatic aberration options.
Constra auto chromatic aberration options. This auto self whatever whoever you are. Uh duh. Uh, chromatic operation.
I should just learn CA should be one B and two RS.
Oh, go. Gosh darn it. You're right.
Uh, let's do uh at least I was consistently wrong.
Okay. Right. IC chrome chromatication options.
And then we're going to do chromatic aberration options. The move chromatic aberration options.
Chromatics. Right. Hang on.
Whoa, whoa, whoa, whoa, whoa, whoa, whoa, whoa. One thing at a time. One thing at a time. Let me mess up one thing at a time, please.
Uh, whoa. What have I done here?
Okay. Right. Uh, ch. Oh, yes. Chantic.
Uh, chro chromatic.
Okay, fine.
And then let's do four options.
Uh, nope. Sorry, got that.
Okay, let's do scene return self dotation.
Okay, chromat uh chromatic. Okay, cool. Right, we're there. Okay, let's go to let's just get all this wired up first because I hate doing all this. Uh, and then so somewhere in fog options, we got this.
So, let's do fog options and let's do uh chromatic uh aberration options. And then we're just going to basically yank this and do this three times. Yeah, it's not great. Yes, it needs a refactor. Yes, I also hate it.
Uh, chromatic operation opt steady steady uhation options red offset offset red offset. So this is going to be something like 0.0 1 to something like that.
In fact, actually get all this shape.
We'll just copy and paste the actual one that works.
Uh dot operation options dot red offset.
Okay. Right.
Uh, red, CFD, green, CFD blue.
Right.
Uh, I don't think I missed anything.
Oh, yeah. Fog works. I don't know if you saw that or not, but fog fog doth. We are we we do be fogging.
Okay, so hopefully now I have three sliders for this. Obviously, they don't do anything, but at least they are there. So, let's wire up the basic shader.
I think I'm going to want to do chromatic aberation like quite late, like after everything is done. Probably after the tone mapping, right?
Make three chromatication.
Uh, no idea what's going to return yet.
Uh, no idea what it's going to take.
Probably going to take an It's going It's going to need to sample, isn't it?
How does he do his? So ah, so he has a direction, right? So I probably could work that out based on the screen coordinates. Make that tiny.
Um, so that's basically what I need to do is I'm going to need Oh, they're uniforms, aren't they? So, I can just access the input texture. So, I need to do vecto text size equals texture size. Uh, I assume I can do this. Um, u input texture 0.xy.
Okay. Mean the texture size. Uh, and then do vecto text.
Do I get the text cord for free with UV with UV?
Do I need to calculate? I don't need to calculate texture cord. Surely I I know it.
So if I want the direction to be the I want the direction vector to be from the center.
Okay, which actually I can then work out via texture size and then but UV is um yeah what space do I want the cord? I need it in UV coordinates.
Let me just copy what he's done and then I'll try and figure out. So he does vecord equals glad.xy over text size.
So that gives me the current normalized texture cord.
But isn't that UV though?
And then back to direction equals text cord minus uh text uh back to 0.5 F 0.5 F. Is that right? Will that give me the the the vector the distance from the center outwards?
If it's UV, it's the UV. I do have it. I do have UV. So I have Oh, I do I not pass in the I do have it in UV. So in fact, actually, do I just then need to do So is this just in UV like that?
UV from the corner. So UV minus 0.5 uh because I want to sample along that vector. So do I need to do That's five cuz then I want to do. So this is going to be uh Yeah, probably. I think I just want to get something working first, then tweak it afterwards. So then basically, let's wire up the rest of it. So we're going to have float red equals because you're then going to sample based along this offset, right? because that's how you that's how you kind of get the chromatic aberration. So, we're going to do U input. No, we're not. U input texture uh in UV plus direction times vector 2 uh U red offset, right?
R. So, we're going to sample the red from some offset pixels away.
Just going to add some more uniforms.
What's What's a few more uniforms between friends? I will fix this.
Uh, blue and then green.
Blue.
would just be direction + one times offset for what?
Just for the sampling.
The problem I've got now actually is that because I'm not sampling the I'm sampling the input. Does this need to be a separate phase, by the way? Does this need to be a separate pass?
Because all I'm going to do is sample the original texture and it's not going to have any of the other post-processing effects applied to it.
I think I need to see what this does.
Like, do I then just do like after all this gamma corrected plus equals uh aberration.
That going to be an absolute mess.
Scene dot mass corporation dot red offset.
crash. Oh dear.
Like it is definitely shifting some of the colors, but it's not applying them correctly.
Right. So, let me go back to what what was the suggestion? Sorry, I just wanted to get something going. Um, so we're saying is because you get where the pixel SC would not be 65 to 67.
So we want to direction times 1 plus offset.
So, this is that what you're saying?
Also, I'm not sure how I'm supposed to blend these.
Do this have some sort of like scaling factor to it or do I mix them?
Replace in UV.
Oh, so just this.
No, only something below. Sorry.
Oh, I see. So this should be so you so you're saying this should be vec 2 0.5 f 0.5 f like That's okay. That is I think that is doing the aberration. I think cuz I think if we play around with these sliders, we can probably see. Yeah, you can see the red offset happening. Yeah, nice. Okay, that's cool. It I think the problem now is it's just uh it's it's it's adding all the colors, but I don't want that.
I want them What do I want?
Because effectively I'm doubling the scene, right? Because I'm adding these colors and then and then I'm I'm literally adding this back here, right? So, this either needs to be like I still think this is going to hardly make the scene brighter.
Too much too much data. Oh yeah, it's true actually because it is effect three. Um You need to replace the original image with the result to the operation function.
Um because I basically want this to be like a mask that's applied over the top.
So you only use Yeah. replace the original image with the result of the aberation function. How do I Oh, so like that.
No, because then I won't have any of the pre-processing. This This will probably work, but then I won't have any of the tone mapping or anything applied to it.
I need to be able to sample. I think I need to do this as a separate pass, right? I need to have all this even. That's Yes. Okay, fine. So, don't need to add another pass for this.
Um, lines above where we put the colors do input are minor. Oh, interesting.
So, do I need to do Uh, ve 3 color um, equals texture.
Oh, hang on.
Do I take the original color and subtract it? So, do I do U input texture?
In fact, actually, do I do three color and then do I do you saying I do this like that and then I pass in I'm worried this is going to have to be a separate pass. It's not the end of the world. It's just more I've got more typing.
Yeah, but do plus equals about him.
I mean, it's cool.
It's not what I wanted, but it is it is cool.
Oh, that's really trippy there.
Okay. So, do we think it has to be a separate path then? I'm sure about like how does he do it? because it's not particularly obvious here feel free to play around with these particular color you're looking for these particular offsets produce the blah blah blah the offset's going to go with the reduction make three samples of the scene's color these will be the final fragment color yeah okay so what he's basically doing he's basically saying hey your the red output of this is actually shifted off slightly Yeah. So this is this is why this is the final pass, right? Because color texture is the full thing. So if your red offset was zero, then it would render the scene normally, right? But then what you're saying is when you come to render the the red component for this pixel, you either you take it from the source, the input, and then offset it slightly.
Okay, fine. I think we have to do a separate pass and separate shader. It's not too much work. It's just bor. It's just it's just tedious.
Okay, fine. Let's do So, we're going to want a program uh chromatic aberration ab aberation.
Is that how we're spelling it today?
Nope. Aberration program.
Uh, we're going to need another render target for it because the light pass now is going to have to render, sorry, the tone mapping pass is going to have to render to that and then that will then consume it for the next one.
Did I spell it wrong again?
Okay, fine. Uh, so then we're going to need a render target chromatic.
uh operation render target.
Uh and then we're going to want after this a final uh execute chromatic aberration pass. Okay.
Uh so renderer that here So say blur program it's going to become say so this is going to become uh chromatic aberration program and it's going to be uh ca uh I should keep it consistent Chromatic aberration.
No aberration. This is going to be C2T.
Chromatic aberration chromatic aberration and then C2T domatic aberration and then finally chromatic aberration program.
Uh, no, no, BIM. Got to type it all out. Uh, and then here is basically the same as this. But, oh, actually, I don't want it to be half size though, do I? So, I got to make sure I get this right. So, it's going to be the same as this.
Uh, nope. Nope.
Uh, C2.
Okay. Right. We're getting there. So then this is going to call execute operation scene.
I just It's one of those things where like uh I don't know. I should have just done it. Um but I was just I was in the zone.
So then tone mapping.
So let's copy this to what 667 did that there. Execute chromatic aberration scene. Okay. Uh pass. Okay. Right. So that's going to execute that. So this now needs to bind a different buffer to render to.
No, that's fine. That's still going to bind to the tone mapping one cuz we're then going to read from that. It's the final blit pass that now needs to change. Uh where do we do the final blit post render blit final FB? Who who writes to the final FB? Oh, here we go. Ah, so smart. I knew I was going to have to change this at some point. So, now I just take a a point to it. I'm so smart.
So, that will now blit that.
Uh, do this. Do that. So, now we're going to bind the cratic operation RT. We will clear that.
um autobind the chromatic aberation RT. So then the inputs to this are going to be the tone map program uh tone map RT color texture N. Right? So that's the inputs from that. And then it's just going to have the red offset, green offset, blue offset. It's going to need the vertex shader. It's not going to need the luminance. It's not only the camera buffer and then it's just going to bind the statically built pro postprocessing command buffer which just has one command to draw a full screen quad and it's going to do it. I think that's I think that's all we need.
Uh so now let's do E source. Nope.
Assets shaders chromatic aberration dot vert uh tone map vert.
This is going to be the same as this.
Right.
So it's going to pass those straight through. And then e assets shaders chromatic frag.
Uh, let's take the tone map drag, stick it here, and then just tidy it up.
So, we don't need the camera. We do need the input texture. We don't need any of this gubbins. We do need those. So, those then become one, two, three. Uh, have the out color. We don't need Uchimura.
We don't need fog. We do need chromatic aberration. So this is going to take the in color there and then it's going to do out color is chromatic aberration of in color.
That's what we need to do, right?
Do we need to duplicate the numbers in the render code?
Uh possibly. Uh what I do need to do though is remove the extra ship and tone mapping now. So this is all going to basically just undo all this up until we fix that and then that.
Okay.
Uh I don't think we need to update the numbers because I have a utility function which uses template meta programming to bind them in the order that they are passed in as the function template arguments. So the renderer should bind these in that order as 0 1 2 and three. Should see it works wrong.
Why were you not auto? Oh, cuz that's got to be a program, not a render target.
I think set uniform.
which set uniform.
Well, that's a lot of uniforms there.
You can you can see here it's the templates pulling out the arguments on renderer 636.
Oh, did I not pull these out?
That was so clever. That was so clever.
I like how Open Jail is like, "If you don't give me enough uniforms, it's fine, but if you give me too many, I will explode." I was like, "Oh, pick pick a lane." Like, do you know what I mean? Like, why can't you keep be consistent? Anyway, I'm just angry now.
Uniform on unbound program. Set uniform on program 98.
Program is in the renderer. Correctation pass render 675.
Why is it not like this?
Chromatic aberration frag 01 two and three. I don't understand why it's not liking those.
Uh calibration also doesn't need uh doesn't need this for a start.
Um what's the actual error? Setting uniform on unbound. But the program is bound.
How do we do it here?
9675.
Oh, good spot.
Sent on the wrong thing.
Yeah, this will work.
I guess it doesn't tell you if you not set too many because you might you might have some system where you only need to set certain uniforms and like generated code and stuff. So, I do kind of understand it, but well, now I have only the shifted colors.
Uh, sorry, wrong dial.
Do I need to now mix that in?
That should all be done. There's no SA.
This is purely coming from the Let me just check I've got the right to map RT. So, this comes from the output from the tomapper, right?
Are we adding it to the input color? No, but he doesn't add his, right?
I mean, I could try.
Okay. Yeah. Yeah. I think that's Is that Is that Is that doing it? Is that is that if I whack this up?
I think we get Yeah, that's that's I think that's it, isn't it? Yeah, you got the the bleeding colors from the edges.
Like, it's obviously way too much. This needs to come right right down.
I think that's doing it, isn't it?
If we set this to these to zero Yeah, it's still not doing it the way I want it to. I want to I want it to go diagonally outwards from the center. Whereas is that is it doing it? I think it might. It's so hard to tell.
So green is more obvious because your eye is more sensitive to it. It needs to go much more. Why is it's not it's not doing as much minus as I want. Hang on.
Give me one second. Uh I think this needs to go like quite f much further back.
Yeah. I want what I want is the fringes of the screen to be almost like you're looking through a lens or something like to be a bit more just a bit more visual interest. I don't want the whole thing to be unless there's like a glitch effect or something happening in game where like the whole thing goes.
But that definitely does go in and out towards the sense. If I look like over here, does it kind of do I want it to do?
Like you just want them just all slightly offset from each other, right?
Like bring the green in to zero and you have like a purplish offset then.
So the the So that's what we're doing.
Just looking Approve.
I wonder if we also need to we need to probably have some sort of offset as well, right? So it doesn't happen in the as much in the middle.
Uh yes. Do I want to just return that then but then add that over the top in the function return ve not co and then just return the veain.
Ah so what just this then Oh yeah that looks better. Yeah. Okay.
Yeah, that's much Yeah, that's much more like what I was expecting here. If you look up here, you should be able to see like what what we're at now.
more like the same amount.
That's That's cool though, right? So, let's So, what I want is that just to be on the fringes of this screen. So now we got to I feel like we need to I don't know like scale it outwards like we could have like I I I want it blended towards the edges, right? I don't want to be like if cuz you can get the length of this right.
Yeah. So this this this direction will be I'm trying to look at how to Yeah, I we can fix that later. I think for now I just want to kind of get the effect kind of mostly. So this is interesting actually. So this is it already kind of doing this because direction will be bigger the further out you go from the center. Right? So this will be close to zero at the center which means this will be scaled to zero.
So do we just need to kind of like fudge this a little bit more? Does this need to have some sort of like scale factor?
What if I times this by uh like what would like two?
No. 0.5. Which way do I want it? I should probably put a slider in.
Whoa.
Maybe not that. Maybe not that.
Oh, hang on. precedence. Yes, you're right.
Perfect.
So, I need like 0.5 or is this just going to fish eye? Is this going to make them bigger?
Do I need a mix?
Oh, that's awful. Right. That's That's obviously not the way. Um I feel like I need direction to something needs to scale.
Do you know what I mean? Like scale the offset by the length. So which one's the offset? Uh oh. This so do you mean again order order precedence here? Do I want this times strength?
Yeah, but I need to know like what the sliders are doing, right? Let's try that.
I need to kind of get a base understanding of like what I'm adding sliders to, but I just start throwing sliders around here, there, and everywhere. Boom.
Strength.
Can we do the vignette as part of this as well, do you reckon? Just darken it by some scale.
I think that's Is that right?
I think that's right. But I think we need a sliding scale on it now because if you look It doesn't help that everything's flashing bloody red.
But yeah, if you look in the top left here, you can see the colors are shifted. They just right.
But then if you look at them, they stop shifting. I suppose we could we could make this more obvious by really like raring up like the green offset.
Yeah. Okay, that does do it to the side.
It's not seamless, by the way. Just FYI, none of this is seamless. like I'm making a lot of mistakes as I go along.
Have I changed the whole field of view or am I going mad?
So then this needs to be times by some sort of U scale, right?
Uh scene options floats strengths. I think strength is better equals 0 5F uh chromatic aberation ver strengths uh and this will be strength times u strengths and then debug renderer.
What's another slider between friends and what like from zero 0.0 F to like I know 1.0f.
So from like nothing to everything.
I got Yeah.
I kind of want a vignette color though.
So like red if like player is shot. Does that feel like like a sensible like use of vignette?
Uh not not wire this in yet. Have I don't go nowhere.
uh one minus one minus strength. Is that right? So is the strength. No, I want the strength as it goes up to make the overall number higher.
Right? That'll be inverting it. or can I not math this late in the day?
I don't know. I don't know if I like it or not. I just It's kind of fun to play around and add, right? And I think it has some interesting implications and again just kind of break it up a little bit as well.
Oh, vignette. Okay, cool. Right. So, let's see what happens when we play around with this slider here.
I think that's changing the radius. It affects that. So, if I just do it like a little bit, I just should just get it in the corners.
You're right. I think the aspect ratio is wrong.
But just a little bit. Just a little bit, I think, just to add a little bit of interest, intrigue to the corners.
And probably I probably want to keep the green roughly zero because I'm interested more on like at the moment like the sort of purpley aesthetic.
Let's bring up the red and the blue.
Uh one second.
Okay. And then I guess maybe make it just a little bit stronger.
Hard tell that's having much of an effect but it's because it's quite I want it to be quite subtle.
Yeah, I think you're right.
I don't know. Is No, I think that's right. Cuz if I look there Yeah. I'm not bringing in any closer, am I?
Um Okay. Okay, I might play around with this whole stream and get it working.
But I think like I still I'm still pretty pleased with this. Like I think it's looking pretty pretty good now. I just like delete that light and then drop the ambient light. Oh, the ambient light's already off. Okay, raise the strength of power. Tie the sliders probably. Yeah, I think my brain can't handle the maths tonight. I think I'll look at that off the screen, but I think it's pretty pretty much there, right? Like I think it's pretty cool. I think we're definitely getting there.
Uh, we need to serialize it super quick, don't we? Uh, let's just quickly get that done.
So then here.
So this here would have uh desri sorry chromatic abration options and then this would be chromatic options uh and then dotation options equals self equals self dot criteration options.
need to add the uh whatever the defaults are into the scene as we have it.
Uh scene.
So this is going to be chromatic aberration options. Uh, and this is of type chromatic aberration options. And this is going to have a red offset of type 0.09.
Uh, green of 0.9996.
CF CFD is going to be blue. And that's going to be0.06.
And then finally strengths is going to be 0.5.
Okay, I think that's fine. So let's runs and blends and does all the things.
And then we can stick this in the githole. And next stream we will uh give effects. I think we need to do vignette and we need to do noise. Uh like film grain like just very subtle film grain.
I think just again just to break up some of the scene and give it a little bit more atmosphere. Again, if it's dreadful, just turn it off. Um, just check that saves.
Cool. Okay. Okay. Fine. Let's So, let's do the Let's do add CA shaders. Sorry. Commits. I don't need to type it out over and over again.
Commit. add CA options and then commit render CA. Again, it's kind of first pass cuz I think there's a bug in it.
And then update scene for in the GitHole, right?
Uh oh, is it Oh, in a new month, I think there's YouTube gifts to give out. Isn't that exciting?
Tag. Oh, well done. Yep. Uh what we stream 31.
Okay, let's take that. Let's Oh, interesting. The new overlay doesn't handle this. I'll have to check that.
But anyway, there are people with YouTube gifts. The It's annoying it doesn't appear in the bottom. I'll have to see why that is because I turn the other highlight off. But anyway, five of you have received a free gift.
Congratulations.
Um, gives you early access to videos of which I have not even started planning uh this month's video yet. So, running out of time. Um, uh, Open I think I just I can just achieve more with OpenGL than I can with Vulcan. I don't need all the control Vulcan gives me, right? So to do something live and make progress, OpenGL for me is the better choice as it's like a oneman band trying to figure out as I go along trying to make progress. That's kind of my view on it. I think if we were using Vulcan, we would be nowhere near where we are now after 31 streams and it wouldn't be any more performant.
Uh I get to gift 10 membership 10 one month memberships per month in batches of five on live on YouTube.
Okay, I think this is looking I think this is looking pretty good. Like I'm pretty pleased with this. I think we're we're in a pretty good place now. Um next stream we'll do vignette and we'll do noise. And then after that we're going to do so probably going to be a couple more streams of this. Right. So then after that we're going to bake out the write out the emissive textures because we don't write those at all at the moment. Like they're there but we just don't use them. And not all the models have emissive textures. So, I'll go and find in the model pack I've got some ones to kind of play around with.
Then we can bloom. I'm planning on doing the Let me try and find it.
The advanced I think it's COD Advanced Warfare Bloom method. The one with the 13 taps.
Uh it's like a secret article on OpenGL physicalbased bloom. Yeah, this is this is we're going to follow this uh I think it's got a good example.
Basically, we just create our own MIP chain where we down sample um the frame buffer uh using this tap pattern and then upsample it again using a slightly different pattern uh which basically blurs it for us. And then I think it's got a nice before and after like this going to work.
So this is the traditional this is like the my first open. Sorry, hang on. Just realized it's tiny. Um so which way is it? So you've got so that with the really fuzzy edges is um like the other like the standard blur with the highp pass filter and then just like a by directional blur on it whereas the one I want to do is when it changes over this one it gives you I think it's a much more subtle glow and I never done it before so it could be fun to give it a go. Um so yeah we're going to try we're going to try give that a go. I'm probably just going to follow along with the tutorial and hope for the best.
Uh, I've never used BGFX, but like if that's if you get use out of it, then you should absolutely use it. It's kind of hard for me to have an opinion on something I've never used before, but like if they solve your particular problem, then you should use them. I'm just kind of having fun doing doing what I'm doing, to be honest. Um, I think that's all I've got. I think that's largely it. Thank you for coming on, keeping me company. It's been great. Uh, I feel like we got quite a lot done today. I probably even maybe got another community post out of it which is obviously important. Definitely beer time. I'll hang on Discord for a little bit. I got to be up early for work tomorrow, so be around for too long. But uh other than that I will see you all and
Related Videos
OpenHuman VS Hermes AI: Who Wins?
JulianGoldieSEO
285 views•2026-05-29
Long-Running Agents — Build an Agent That Never Forgets with Google ADK
suryakunju
142 views•2026-05-30
5 Mind Blowing Omni Uses Cases
PaulJLipsky
1K views•2026-06-02
This computer is made from real human brain cells. And you can buy it.
Talktmsmedia
3K views•2026-05-28
BREAKING: Microsoft’s New Image Generating Model Beat Out GPT 1.5 and Nano Banana 2
aimmediahouse
122 views•2026-06-03
I Made the Same Anime Fight Scene in Every AI Video Generator
NobleGooseAnime
295 views•2026-05-30
Nvidia Bets Big On AI PCs | New Chip To Power Windows Laptops | Technology | AI Updates | N18S
cnnnews18
3K views•2026-06-01
I Tested NEW Opus 4.8 on Four Projects (Updated LLM Leaderboard)
AICodingDaily
298 views•2026-05-29











