More NEON examples - GLSL without GLSL
Kuemmel (439) 384 posts |
Hi there, I coded some more VFP/Neon examples. This time due to the lack of any Open GL hardware support I tried my luck in reverse engineering some GLSL code into assembler. The result is kind of slow as I can hardly fight the amount of shader cores of the GPU’s with on single ARM core ;-) …but it was fun to code and I learned some more tricks about NEON. I got three examples, a raymarched 3d grid, some sine waves overlay effect and finally the famous Mandelbulb. The Mandelbulb has some interactivity, check out the !Help files of the apps. You can find all 3 in one zip here → http://www.mikusite.de/riscos/GLSL_without_GLSL.zip The original shader code is also there. If you are interested in shader coding, you can start right away coding and watching sometimes true software art magic here (should have a WebGL capable browser and recent GPU, so impossible on Risc OS, but I think even mobile phones nowdays can manage that at low resolution)→ |
Malcolm Hussain-Gambles (1596) 811 posts |
That’s not too bad, as you say it’s kind of slow. |
Kuemmel (439) 384 posts |
Thanks! I’m trying to do some more stuff and also set up a section of my website to list some of the optimisation ideas I used soon. I also found it quite helpfull to use a paper sheet, listing all the NEON register mappings on one page where you can put in your variables by classic handwriting…one get’s easily confused when there are 64 floats to handle. I will include that sheet as a pdf on my website also soon. |
David Feugey (2125) 2709 posts |
Good idea, but a small problem: On Panda, it’s quite difficult to change of screen mode. The one the demos use seems not to be available in my MDF… And we have no clue of wich one it is. |
Kuemmel (439) 384 posts |
I used 640×480 or 800×600 (True Colour). Windowed mode would be an option, but I’m not really what you would call an experienced WIMP programmer, may be somebody elso can do a windowed mode example for me to port my stuff ? |
David Feugey (2125) 2709 posts |
That’s strange. These mode should work… there is no easy solution… I should try on my Pi. |
Kuemmel (439) 384 posts |
@David: The Pi CPU doesn’t have the NEON extension, so no chance to run my code there, sorry… |
David Feugey (2125) 2709 posts |
Arggg! |
Kuemmel (439) 384 posts |
As announced before I set up a VFP/NEON coding information section on my web page, just a start for now, including links, a register mapping pdf, some optimisations. You can go there directly here |
Kuemmel (439) 384 posts |
…years later ;-) I found some time during Christmas porting/coding another nice piece of some GLSL code to NEON enhanced assembler. This time it’s a kind of 3d ball that looks like moving in some kind of fluid using a huge 4 MByte texture. You can find it here You can choose from some usual resolutions at the start. If you want to add others and can code in BASIC it’s quite easy to change some code lines. Should work on all NEON capable systems. Runs at around 20 FPS on a RPI2 at 800×600, and quite flies on my IGEPv5 at around 50 to 100 FPS at 800×600. Maybe somebody with at Titanium board could confirm that it runs okay there, too. It takes care of correct screen mode switch and checks if colours are RGB or BGR. |
Chris Gransden (337) 1202 posts |
Runs OK on the Titanium board. |
Raik (463) 2059 posts |
Curiously, I tried on my Pi2 and my Pandora. Although on the Pandora looked better/faster than on the Pi2 but were displayed only 8-10 FPS. |
George T. Greenfield (154) 748 posts |
What fun! 20fps @ 800×600 with VSync on, 25fps with VSync off (Pi2 with RC14, force_turbo=1, 900/250/450). VSync off looked a bit smoother. |