Re: Long way round/Scourge of the Black Baron missions
Posted: Sat Apr 23, 2022 10:09 pm
Batrachian Bubble Baths.
I bugged cim about this who replied as following:
I bugged cim about this who replied as following:
Am I correct in presuming that this little project would indeed constitute a major pain in the unmentionables?cim wrote: ↑Wed Apr 13, 2022 4:05 pmIf you use the Smivs approach of hijacking the Trumbles code, no.
What I'd do instead - and I really can't remember the details of how, so read this as "what I several years ago would have done instead" - is as follows:
1) Set up a visual effect object with a simple cubic model with a nominal size of 2km.
2) Use a frame callback to ensure that this object is always at the same position as the player ship (which will therefore ensure, because of its size, that it's always "visible")
3) Stick a custom shader on it so that rather than being drawn in worldspace it ends up being drawn in HUDspace [1]; make that shader draw an increasing number of soap bubbles by binding in the https://wiki.alioth.net/index.php/Oolit ... #shader.2A generic shader* uniforms and updating them in the frame callback.
Actually *writing* the shader to display the soap bubbles is non-trivial - but don't forget you can stick a fair bit of data for it into the object's texture file in a convenient format!
[1] The hyperspace jump shader in SOTL or BGS works in a similar way if you want a reference for this bit. I *think* without checking that the Vertex shader is the one that handles the transformation to HUDspace, and then once you've effectively got a HUD-sized canvas to play with, you'd use the Fragment shader to write that.