Ultibo game programming

Anything and everything about programming graphics with Ultibo
Gavinmc42
Posts: 1003
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: Ultibo game programming

Postby Gavinmc42 » Sat Jun 10, 2017 7:31 am

You don't have to be good artist with Povray to make an animated 64x64.png as not a lot detail shows ;)
Still there is quite a bit more than I expected, the light reflections show up.
So sun angle will need to be fixed, no dawn or dusk raids.
Unless I make pngs for a days sun/moon travel at every angle, that would be quite a lot of 5KB pics :D
Guess that's why 3D GPU's are used, duh.

Getting an animated png into a memory array? pjde's code?
Time to read some basic game engine theory
With Povray an animated movie of sorts could be made and played back on the Pi?

Wonder how to make exploding building and tanks etc in Povray?
Some buildings and tanks etc will be smaller so 32x32 pixel should be ok.
A blimp with cannons needs things to blow up :P
Angles and perspective changes are going to be a pain, I think I need to play similar games to see how it is done.
Purely for research of course :lol:
2.5D games like Age of Empire etc, don't have perspective? Think I need to check.
Attachments
blimp.png
blimp.png (353.81 KiB) Viewed 277 times
Gavinmc42
Posts: 1003
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: Ultibo game programming

Postby Gavinmc42 » Sat Jun 10, 2017 9:05 am

Terrain generation by code would be handy, since i don't know enough about procedural generation I went looking for a tool.
http://geomorph.sourceforge.net/intro_en.html
This uses Povray :D

And yes Povray can do explosions, plasma, smoke and clouds.
The graphics generation stuff looks like it is nearly sorted out.
http://www.geocities.ws/evilsnack/tut01.html

The physic engine and AI? Some serious learning, how did people learn/find this stuff before google?
If I get bored I can make a steampunk tank or explosion etc.

Soon time to look at pik33's DMA 2 memory animation method.
pik33
Posts: 576
Joined: Fri Sep 30, 2016 6:30 pm
Location: Poland
Contact:

Re: Ultibo game programming

Postby pik33 » Sat Jun 10, 2017 9:50 am

how did people learn/find this stuff before google?


About programming - friends at the computer club, computer journals, a poor quality hundredth photocopies of computer books, experiments... There were good old 80's, communist party ruled, the western goods were very expensive, but then there were computer clubs and a lot of young people who wanted to learn and do something with 8-bit hardware... :)
User avatar
Ultibo
Site Admin
Posts: 1476
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Re: Ultibo game programming

Postby Ultibo » Mon Jun 12, 2017 12:37 am

Gavinmc42 wrote:So files like this describe the interface to the VG bit of the start.elf blob?
https://github.com/raspberrypi/userland ... G/openvg.h

Yes and no, those header files really just describe the Khronos standard interfaces that many libraries and applications know how to use. There is code both within the userland libraries and inside start.elf that implements those functions but it doesn't necessarily look anything like the OpenVG standard or anything else you might recognize.

Gavinmc42 wrote:So reverse engineering of the start?.elf's is needed to get rid of these VC4 helpers interfaces?

Full reverse engineering is a very long road to nowhere and there is no real need for it, there is a small vocal minority in the open source world who believe that the closed source parts of the GPU code must be revealed or replaced otherwise the entire Raspberry Pi is no good.

For the rest of us we really don't care what is inside start.elf or whether we have the source for it or not, as long as we can get access to the necessary interfaces then that will provide the services we want.

Gavinmc42 wrote:Ouch, is this what Eric Anholt is doing with the DRM interface etc?

I'm pretty sure Eric is being paid by either the Raspberry Pi foundation or Broadcom (yes companies pay people to write open source software) and he has access to documentation.

But remember that what Eric is doing will produce Linux drivers for more of the internal functionality, there will still be a large amount that will only be accessible via start.elf. In addition to that the Linux drivers will be mostly totally incomprehensible to anyone and so won't provide much of a resource of how to do anything.
Ultibo.org | Make something amazing
https://ultibo.org
Gavinmc42
Posts: 1003
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: Ultibo game programming

Postby Gavinmc42 » Mon Jun 12, 2017 1:27 am

Wonder how many Pi's are in the hands of ex communist block hackers?
Get them to figure out the RPI's VC4 stuff :lol:
Should take them a week or two.

Yep, Garry you are right, it does not matter to most how it works as long as it does ;)

With just framebuffer and a single tile cursor it will be interesting to see how far even I can go for gaming on a Zero.
On a Pi2 or 3 we should be able to go faster using the NEON stuff.

Keeping a close eye on this post subject as it should open up the QPU's for use.
viewtopic.php?f=9&t=290&start=60
Did not think it would get to 7+ pages :o
pik33
Posts: 576
Joined: Fri Sep 30, 2016 6:30 pm
Location: Poland
Contact:

Re: Ultibo game programming

Postby pik33 » Mon Jun 12, 2017 6:30 am

On a Pi2 or 3 we should be able to go faster using the NEON stuff.


This has to be enabled in Ultibo.

As it is now we have a choice: if you enable NEON then you cannot use floating point.
The second problem is: not all NEON stuff is available even if you use -vfp_NEON. Only opcodes common for NEON and VFP are available. The stuff which can be very useful for gaming, like vector interleaved loading to get one color in one register cannot be used.

I hacked fpc to resolve the first problem and now I have a compiler which can compile subset of NEON and floating point but then nobody else can compile such a source, so this can be used only by me to learn this stuff.

I tried to add lacking NEON opcodes to fpc but I didn't manage to do this so I gave up for a while.

Wonder how many Pi's are in the hands of ex communist block hackers?
Get them to figure out the RPI's VC4 stuff :lol:


VC4 stuff will be a natural step in developing GUI, so I have learning this in my plans.
Gavinmc42
Posts: 1003
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: Ultibo game programming

Postby Gavinmc42 » Mon Jun 12, 2017 6:52 am

I think we might be ahead of the FPC guys re NEON, have to wait for them to catch up?
It's only important for me in the 64 bit Pi's and we are ahead of most Aarch64 stuff so we need to wait for that too :lol:
Off to FPC forum to see latest.
I'm sure Garry will figure it out one day :roll:

But still plenty of other things to do/learn/try/test/make.
If I run out of things to do I could get a SBC with a Mali GPU and start learning ARM C/C++.

If I understand correctly, I think develone just got sense out of the GPU/QPU?
Or he has gone full circle?
viewtopic.php?f=9&t=290&start=60
User avatar
Ultibo
Site Admin
Posts: 1476
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Re: Ultibo game programming

Postby Ultibo » Mon Jun 12, 2017 10:42 am

Gavinmc42 wrote:it does not matter to most how it works as long as it does ;)

No not at all, it is very important to know and understand how (and why) it works.

It is much less important to have the source code or to reverse engineer the functionality, as long as what is available allows us to access the features we need.

Perhaps some of those who constantly whine in other forums about the lack of an open source GPU (or lack of other documentation) in the Pi are really just using that as an excuse to do nothing.
Ultibo.org | Make something amazing
https://ultibo.org
Gavinmc42
Posts: 1003
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: Ultibo game programming

Postby Gavinmc42 » Tue Jun 13, 2017 4:43 am

Not important when it works, very important to understand when it does not work ;)

Perhaps some of those who constantly whine in other forums about the lack of an open source GPU (or lack of other documentation) in the Pi are really just using that as an excuse to do nothing.

Guilty, someone has been reading some of my old Pi posts :lol:
I don't really want open source, I just want a documented interface.

However this guy knows some stuff, going back to earlier VC's
https://github.com/popcornmix

Herman has some questions re VC4 back in 2012
https://github.com/hermanhermitage/videocoreiv/issues/3

This grabbed my attention
2d blits for baremetal folk (to give them an easy way of accelerating graphics without going all the way to VG/GL)

He now works for RPI?
https://github.com/raspberrypi/firmware
More 2D stuff
https://github.com/raspberrypi/firmware/issues/84

Having the QPU's doing 2D acceleration - bitblting would be handy but there does seem to be latency issues between VC4 and ARM.
This would indicate to me to let the QPUs handle 2D sprites, with 12 QPU's that could be a bunch of sprites.
Not just sprites but useful for the Windowing Manager?

Not sure if this will help with the QPU FFT post?
https://www.raspberrypi.org/forums/view ... 1&p=550759

But here is proof blitting worked on VC
https://github.com/raspberrypi/firmware/issues/91
It was mame37b5. The source would do you no good - it was for an earlier VideoCore chip, and you don't have the tools to build it. It also depends on lots of GPU libraries I can't release.

So not much use, excepting knowing it can be done :lol:

Had not thought of checking Mame before
https://sourceforge.net/projects/mame4allpi/files/
Looks like it is using OpenGLES so not much help for baremetal.
https://github.com/squidrpi/pifba/tree/master/rpi

Just looking at some of the newest games is very depressing, these guys have been doing this for decades :shock:
Time to go back to these and see if it makes just a little bit more sense
http://elinux.org/Raspberry_Pi_VideoCore_APIs
VCOS - hmmm 2012- abstraction layer to change the OS from Nucleus to ThreadX :D
Seems like Nucleus ran on VC01, any old code floating around?
User avatar
Ultibo
Site Admin
Posts: 1476
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Re: Ultibo game programming

Postby Ultibo » Tue Jun 13, 2017 9:46 am

Gavinmc42 wrote:Guilty, someone has been reading some of my old Pi posts :lol:

I really didn't mean you, but if you have been complaining about lack of GPU documentation then consider yourself guilty as well ;)

Seriously though, I've read a lot of information looking for useful details on the GPU and if even ten percent of the people who complain about the closed source and lack of documentation actually took some practical action then there could be an enormous amount of bare metal GPU information around today.
Ultibo.org | Make something amazing
https://ultibo.org

Return to “Graphics”

Who is online

Users browsing this forum: No registered users and 1 guest