• Notice regarding image hosts and attachments. See here.

What are you coding?

Given how bloated VSCode is becoming... I have idly thought about doing the same.

Is your source code anywhere? Would love to see it.

I’ve not spent any time making the code pretty, but have done various little bug fixes and improvements over the past few weeks. Been daily driving it for all my development work since I made it, not opened visual studio once.

It’s great to just make a bit of software that’s purely focused on doing what you need, nothing more, nothing less.
 

I’ve not spent any time making the code pretty, but have done various little bug fixes and improvements over the past few weeks. Been daily driving it for all my development work since I made it, not opened visual studio once.

It’s great to just make a bit of software that’s purely focused on doing what you need, nothing more, nothing less.
Ah I'd missed that its Unreal focused. But its a nifty project and I love the approach, well done!
 
Done some updates to my audio application:
Just added audio time slice rendering to make it easier to work with. Used off line rendering before, had to click render after any change was made(0.1-6.0s delay). Now the track volume\gain\mute\filters can be changed while its playing to give instant feedback. Some things still require updating the cache buffers but its a lot faster to set the track levels and also does not need a full playback buffer(100MB+). Also got the virtual piano AutoPlay to work much better, its not needed but I like to watch it play.
 
A bit more progress on the Command and Control app, experimenting with some procedural generation stuff and seeding/instancing on the GPU.

55665075771_091219e34a_o.jpg

55665190368_45628ab7fe_o.jpg


I then started to pull data from some freely available data sets in order to determine building footprints and areas of tree coverage, and interpolating between digital elevation models in order to try and determine rough heights of tree coverage and said buildings (where height information was not available).

The data is loaded and prepared CPU-side on worker threads and then wholly handed over the the GPU for seeding, scattering and rendering. All trees and buildings are simplified models and also procedurally generated for now. That is, only a single cube exists for the buildings. But that single cube is positioned, rotated and scaled millions of times to represent the buildings. Same with the trees. Three variants of tree exist and these three are rendered millions of times as instances too. The trees are slightly different though; each tree has (currently) three LODs (levels of detail) - high fidelity, low fidelity, impostor. The impostor is effectively a view-aligned sprite with a normal map that shows an approximation of a 3D rendered tree rather than having to render the full geometric representation of a given tree. A lot cheaper.

55668351410_7c7db38780_o.jpg

55666945052_0efd4b3c7a_o.jpg


Added a DoF (depth of field) as a property of the camera lens. Not useful for "serious" use but nice for eye-candy. Can be toggled on or off.

55668351315_c859fb3628_o.jpg


Same deal with the addition of the lens flare (so 1990s!) - my renderer works in HDR linear colour space so I made the app HDR-aware/capable and the HDR mode can be toggled on/off if a suitable display device is detected.

55672247791_c20ac06e4b_o.jpg


Finally a couple of terrain tinting options to show height elevation bands or slope-angle.

55672414549_898269e704_o.jpg
 
If you know the theme tune from “Charmed” then you know The Smith “How Soon Is Now”. Noted for it’s complex signal processing for the guitar rhythm.

Rather than code the effect in digital, the pedal has a fully analogue signal chain, with the STM32 providing support and injecting waveforms in realtime for the effect itself into the analogue processing.

Should be fun.. the last time I developed a low noise ADC into an STM32 then across USB.
 
The final development video before I move over onto a heavily rewritten renderer (in order to align it with modern real-time rendering engines and tech). It has been fun, and a little challenging, but the forward renderer will soon be replaced with the deferred (g-buffer) and forward+ renderer.

 
For most of its life so far (up until I decided to change it up), Project: OPFRAME has drawn its 3D view with what's called a forward renderer. It's the straightforward way to do it. You draw each object, and as you draw it you work out exactly what colour every pixel of it should be. For the terrain, that means working out the sun, the light from the sky, the shadows and the haze between the camera and the ground all at once, then writing the finished colour to the screen. The buildings do the same, then the trees, and so on. It works, and it's easy to reason about, but it has two problems that got worse as the scene filled up.

The first is wasted effort. When a tree stands in front of a hillside, the hill's pixels behind it have already been fully lit and hazed, only for the tree to be drawn over the top. With thousands of trees, buildings and models layered over one another, a good share of the graphics card's time went on lighting pixels nobody would ever see. The second problem matters more, though it's less obvious. Once a forward pass has written its colour, everything it knew about the surface is thrown away: which way it faced, what colour it was before it was lit, how far away it was. Nothing later in the frame can go back and light it again. That rules out a lot of what modern renderers rely on. One example is ambient occlusion, the soft darkening in corners and where things meet the ground. Another is anti-aliasing that blends several frames together (temporal anti-aliasing). A third is upscalers like DLSS and FSR.

Deferred rendering splits the job in two. In the first step, objects don't work out their lighting at all. Each one just writes down the "facts" about its surface into a set of screen-sized images called the G-buffer (G for geometry). One image holds the plain colour, another which way the surface faces, another how rough or metallic it is (PBR textures/workflow), and the depth sits alongside them. If something is drawn over the top, its facts simply replace the ones underneath, which is cheap. Then a single pass runs once over the whole screen, reads those facts for each pixel and lights it. Every pixel is lit exactly once, however many things are stacked in front of one another. Expensive work like the haze is paid for once per pixel rather than once for every object that happened to cover it.

Because the surface information is still there after everything has been drawn, the other features I wanted followed quite quickly. Ambient occlusion now reads the depth and the facing of each surface and darkens whatever is tucked away from the sky. Temporal anti-aliasing (yup, implemented my own version of this too) nudges the camera by a fraction of a pixel each frame and blends the results, which smooths the jagged edges on rooftops and trees far better than before. It also opens the door to adding an upscaler later on (if I go down that route)...

Lights are where forward+ comes in. The sun is easy, but a town at night has hundreds of street lights, and checking every light against every pixel would be hopeless. So each frame the screen is cut into tiles, and the distance from the camera is cut into slices, which makes a grid of small boxes called clusters. Each light is listed only in the boxes it can actually reach, so when a pixel is lit it only has to look at the few lights in its own box. The weak spot of deferred rendering is anything you can see through, like glass or a vehicle's windows, because the G-buffer only holds one surface per pixel. Those are still drawn the old forward way, after everything else, but they read the same cluster lists, so a street lamp lights a window just as it lights the wall behind it. That mix of forward drawing and clustered lights is what's meant by forward+.

It isn't free! The G-buffer takes ~126 MB of video memory on a 3440×1440 screen (~206 MB at 4K), and a few things, like the map's overlays, need care while the image is being nudged around for the anti-aliasing. But it's the foundation nearly every modern engine is built on. It's let me add what would have been awkward or impossible before.

That was a lot of text so here are a few images, using the new renderer.

This first image is what the G-buffer looks like. 15 screen-sized buffers are built each frame to capture the required information in order to calculate the final rendered image. A lot goes on behind the scenes before something gets presented on screen!

55682227058_ca9a6f770c_o.jpg


As you can see from the G-buffer image, I have added 3D model loading (with PBR support of course). A few more examples...

55682234208_62ae8c285e_o.jpg


55682527620_4fb78a151a_o.jpg


55682127791_58a944d694_o.jpg


I have also been continuing the work on procedural content generation...

55681117347_62a5031305_o.jpg


55682289129_cd62beb216_o.jpg


Each light is a real-time/dynamic light which has been made possible with moving to deferred rendering with the G-buffer. A compute shader is used to split the rendering into tiles and slices so that pixels are only lit by those lights that can potentially affect them.
 
Back
Top Bottom