Saturday 26 December 2020

Twinkle Twinkle, I said Twinkle... you little....

I wanted to make my small galaxy stars twinkle........what a simple idea....NOT


Boy its hard... mainly because there's no built in random function in shaders and shaders themselves only work on the info they are given, providing a uniform of something like time, and a random value from the attribute, means you get some varation, but its mostly an everything at once blinking effect.


Anyway, to cut a long story short, I found a way to generate random numbers from some of the input data, and in turn use that to alter the base colours.. Its not too bad, but the effect only ever lasts 1 frame, and is fleeting enough to give the twinkle effect I wanted, but adding some intensity variation and colour ranges is proving harder. Sadly a video grab doesn't show the effect well at all, due to the single frame nature of it, but it does work, it is shader based and it works well, so a few more tweaks and I will get a nice shimmering twinkling starmap.


after a bit more tinkering I came up with this, a bit too many brown stars but I can tinker a bit more.


Thursday 24 December 2020

More tests

A small update.


Still not tackling the project in anger yet, but doing a lot of tests and also bought some models from the Unity store to see how easy it would be to extract them to work on straight openGLES2/3


not too hard, but it does take a bit of time.


Also sorted out a 2D text render which will expand into a 3D text labeller... and added some new skyboxes I bought. Also a few nice freebies.



I'm pretty much satisfied witht he models I have, just need to do some LOD's on them and create a playfield to view them properly. The Game is much more overview stratgety based than individual fights so showing them up close and in detail is best done in some kind of menu info screen.



Monday 21 December 2020

New Year, new projects

 Well its been pretty quiet on this blog for a while and maybe this is the time to change tack a bit.


I have quite a few new boards (as you may have noticed) many of which are capable of doing OpenGLES3.x or even Vulkan. So I'm making some efforts at work to upgrade the tutorials I give students to be more OpenGLES3.x or even OpenGL4.4 compliant.


To that end I need to get my own skills up to speed as I'm a bit locked into an OpenGLES2.0 mindset. So I'm going to start a new project as soon as I clear up a couple of older legacy projects.


The last couple of weeks I've been doing some tests on some new ideas on how to handle my shaders and lighting systems. By stressing out my Pi3 and Pi4 and not even attempting to stress out my Jetson. To outline some of the things that I need to revew to get better performance in a game related concept.


So, Im going to spend most of 2021 writing a game, its not a new game, though it is kinda unique, its actually a project I've been giving my students every couple of years to test their logic and basic graphic skills.


Its called Empires, its a fairly simple game, where students were tasked with creating a galaxy with 8192 stars in those stars a number of habitable planets needed to be seeded which have resources and if inhabited technolgy to trade.

Thereafter the game behaves a bit like the game of life as a planet can be colonised by the player creating a sphere of influnce around it, which if another planet comes inside that sphere can itself be converted to the players team and generate its own influence. Over time its quite possible for the player to just take over a planet and slowy wait to see all the other planets fall.

Of coruse there are other empires in the galaxy also expanding and in time coming into conflict with yours, so there are certain requirements a planet with sufficient tech needs to do to avoid invasion or to allow it to expand.

Ability to crete defensive and exploritory ships to both save and attack planets as well as large colony vessels to inhabit new ones means that you can artifically influence the growth of the empire and if careful cut off the advancement of other empires... So there's a little strategy involved.

Mostly though its an automatic process that students just have to set up and then work out ways to visualise. Its a fun challenge and over the years I've seen some amazing examples and some dire ones too.


So I'm going to do my own version of it, try to increase some of the playability a bit by introducing more strategy and interaction from the player. Students normally get 8 weeks to do this, and as I say some are amazing, I've got a year, or 2 :D depending on how much time I can get to spend on it, but I do hope to make a nice game out of it, adding some nice concepts from some of my own personal favorite RTS's.

I bought some nice model assets online and downloaded as much suitable free stuff as I could find. And started to do some basic tests on performance on targets, Ideally the Pi4, but I'll try to make something work on the Pi3, at least until I hit a full stop.

Early tests incldued some hires lighting which I can improve performance on considerably



various model tests on the models I bought, to test stress levels on a Pi4



And some point cloud galaxy generation tests. the Point cloud has a range of other uses too, it will be used for thuster trails and explosions with a few different shaders in place to keep performance up.

I need to get a few more tests done on fonts and picking algorithms, before I can make a proper start on things but thats going to be where most of January will go. I'll upate things as I go.




Friday 4 December 2020

Slowing down a little

 I've not been buying as many boards of late. I made a decision not to rush out and buy every new one, and in a way I am glad I did. The annoyance of spending up to 100euros on a board only to discover its not actually going to do what I want due to lack of software is just too annoying.. I now wait to see what reviews and other comments on performance are like.. So far the new Orange and Bananna boards are, as usual, not getting any support. The new Odroids I did buy, but need to wait till software catches up. The N2 was very upsetting in its lack of support but its getting better.


But I did spash out on a new thing, sadly it caused me upset for different and obvious reasons


Gaahh, thats annoying, they're hard to source now as they sell out every store that stocks them as soon as they arrive, I got this from a reliable German company, but DPD did the damage in transit.. I'm sure it will get replaced soon.

Despite the case damage it does still work, and what a lovely little machine it is, a real return to 80's bedroom coding with a fully working plug in your TV and go computer. I'm in love with it... Its nippy, cool and can evern take a fair amount of overclock (if you like that kind of thing)
Can't wait to get one with with no damage. The keyboard itself isn't half as bad as I expected it to be, damn sight better than a dead flesh ZX spectrum. I really hope this does well for Rpi, as much as I love the RPi3 and RPi4, they are still precieved as mechanical control toys or server units, not as proper computers. This may finally break that mould and get kids coding again.

In other news, I'm reworking my game/demo frameworks to be more compatible with Pi4 and X11, it has required a bit of relearning and adjustments to demo's but it will all be ready in a few weeks for when this years Block C students get their chance to work on Rpi. They'll have to work hard to out do last years crop of nice content, but I always have high hopes.