What are you coding?

I spent another handful of days extending and improving the rendering of 3D volume datasets in my path tracer. It now supports emission/temperature so that flames and heat can be used in conjunction with a volume's density channel (smoke, debris) to create explosions, smoking flames, and suchlike. It's no longer limited to just fog, smoke and clouds!

All images are raw outputs directly from the path tracer.

55157946070_c7bc4f1e91_o.png


55157946050_44a97d74ec_o.png


55156660427_0bb8c37a11_o.png


55157720518_2797ced63e_o.png


55157803309_5d761a6a24_o.png


55156660407_6ed59fd957_o.png


55157946365_cbe488c348_o.png


55157720803_6fc738eb97_o.png


55156661042_6d6a76cde2_o.png


55156661387_3278724f0e_o.png
 
Looks great! :cool:
Its better than it was but still has a few bugs: scrollbars not always updating, crackling sound when GC happens, it uses a lot of RAM!. Have improved the render speed by creating a render list that clips object so only render visible objects. Also, multi-threaded audio render(parallel for loop for tracks) and grouped notes/chords to reduce RenderNote calls. Vectored the buffer math also helped a small amount, it was taking 25s+, now ~0.2s-5.0s(some projects are long with few tracks), depending on the project. Have also added track/item popup menus with useful functions (not shown in video).
 
Its better than it was but still has a few bugs: scrollbars not always updating, crackling sound when GC happens, it uses a lot of RAM!. Have improved the render speed by creating a render list that clips object so only render visible objects. Also, multi-threaded audio render(parallel for loop for tracks) and grouped notes/chords to reduce RenderNote calls. Vectored the buffer math also helped a small amount, it was taking 25s+, now ~0.2s-5.0s(some projects are long with few tracks), depending on the project. Have also added track/item popup menus with useful functions (not shown in video).

Bugs? Nah... undocumented features!

It sounds like the crackles might be due to audio buffer underrun - the buffer being starved of data. This can happen if you are feeding your audio buffer from managed threads. When the garbage collector runs, it suspends managed threads. Which means you audio buffer can be starved even if only for milliseconds, and crackles could occur. It might also be worth looking at what is going on during the audio loop. If there is a lot of stress on the garbage collector (due to a lot of dynamic allocations for example) then the GC pressure can grow. How are you doing the audio playback scheduling? If you are using DispatchTimer, Task.Delay or System.Threading.Timer then these are paused when GC happens. Ideally, you might need to look at a dedicated high-priority audio thread with callback / event-driven buffering and a native audio clock. Disclaimer, I am probably wrong! :cry: I'm just going off experience from many years ago and doing something similar!
 
Last edited:
Bugs? Nah... undocumented features!

It sounds like the crackles might be due to audio buffer underrun - the buffer being starved of data. This can happen if you are feeding your audio buffer from managed threads. When the garbage collector runs, it suspends managed threads. Which means you audio buffer can be starved even if only for milliseconds, and crackles could occur. It might also be worth looking at what is going on during the audio loop. If there is a lot of stress on the garbage collector (due to a lot of dynamic allocations for example) then the GC pressure can grow. How are you doing the audio playback scheduling? If you are using DispatchTimer, Task.Delay or System.Threading.Timer then these are paused when GC happens. Ideally, you might need to look at a dedicated high-priority audio thread with callback / event-driven buffering and a native audio clock. Disclaimer, I am probably wrong! :cry: I'm just going off experience from many years ago and doing something similar!
I have fixed the crackling, for now. The Win2d Rendering and NAudio playback seemed to be fighting. I re-did the Win2D code and its much faster, the GC seems to not be involved. I am using NAudio for playback so did not code that. I am thinking of changing from using CanvasControl to CanvasVirtualControl as it seems it can render from a different thread, this will stop the main thread issues. It also allows updating regions instead of fully rendering everything. Overall, it seems much better now, just added rubber band multi-select which was easier than I thought.
 
I've been doing a bit of house-keeping and maintenance on my path tracer recently. Previously, analytical primitives in a scene had to be directly hardcoded into the software itself (which was a bit crap) so I have added editor support for loading/saving, adding, removing and manipulating analytical primitives. I am using ImGui and ImGuizmo for the UI and gizmos respectively.

 
Been tidying up a few things in my Quake 2 RTX mod which have been bugging me for awhile but I've lacked the energy / time / been too long since I touched the code to sort - though when I created it I did a quick dirty array for damage over time which is a really bad approach but works - with the age and relative complexity of the game I've not had the time and energy to get my head into implementing a tick based approach and all the potential considerations in the gameplay logic of an established game rather than something I've built from scratch myself.
 
Another video drop - having added simple camera animation to my path tracer. You can now generate a simple path directly in the path tracer itself (such as an orbital path) or use Blender to create more complex camera animations.

 
Damage over time is such a pain in the arse to code - all kinds of little considerations like clearing out any remaining damage ticks if the target dies, etc. i.e. so if the target respawns they don't have old damage being applied. The crude array tagged onto the target I did before circumvents all that but is also super limited and not a good approach.

EDIT: Whew the main framework of the damage over time implementation is done *backup* *backup* *backup* had a bit of a coding crunch overnight to push through it - I usually enjoy modding as a hobby but that was a slog I don't want to be revisiting LOL. Lots of considerations like how it worked with saved games, level transitions, being able to check whether a monster had an existing damage over time status in effect, etc. etc.
 
Last edited:
Damage over time is such a pain in the arse to code - all kinds of little considerations like clearing out any remaining damage ticks if the target dies, etc. i.e. so if the target respawns they don't have old damage being applied. The crude array tagged onto the target I did before circumvents all that but is also super limited and not a good approach.

EDIT: Whew the main framework of the damage over time implementation is done *backup* *backup* *backup* had a bit of a coding crunch overnight to push through it - I usually enjoy modding as a hobby but that was a slog I don't want to be revisiting LOL. Lots of considerations like how it worked with saved games, level transitions, being able to check whether a monster had an existing damage over time status in effect, etc. etc.
It's fun to see people get an insight into how mind-bogglingly complicated game development is. Even the most trivial of features on the face of it can be a massive engineering exercise once you have to have it playing nice with all the other systems running in parallel.
 
It's fun to see people get an insight into how mind-bogglingly complicated game development is. Even the most trivial of features on the face of it can be a massive engineering exercise once you have to have it playing nice with all the other systems running in parallel.

I'm not a newcomer to it - but implementing such feature into an old game like Quake 2 which was never engineered around supporting that kind of feature is another challenge again.

But yeah even the most trivial of features can be a massive undertaking with all the considerations for everything which might play into it.
 
I've ditched all my previous projects as none were really making any progress. So I've started up a new one which is a music streaming site which takes inspiration from Band Camp and Sound Cloud and adds several new features.

It'll be done in Python, Flask and SQL Alchemy. Hopefully it'll keep me occupied for a bit. I'm trying to keep it as simple as possible. It isn't really serious just a hobby project.
 
Added a media list view for Sound Fonts and midi file with Favorites, using explorer was a pain. also added track volume, decay and gain and keyboard navigation and improved selection. I find myself wasting hours on this now, its a bit of a time suck.
 
I am still looking for a job so sunk a bit more time into the ongoing path tracer pet project. Fixed a few bugs in the 3D volume renderer and trying to make it a bit faster.

55220444444_fd54de118c_o.png


55235471850_c804b53f1c_o.png


It is really easy to bring the PC to its knees! :cry:
 
Back
Top Bottom