Overview Features Instructions Performance Forum Downloads Products OrderV4 Reseller Contact

Welcome to the Apollo Forum

This forum is for people interested in the APOLLO CPU.
Please read the forum usage manual.



All TopicsNewsPerformanceGamesDemosApolloVampireAROSWorkbenchATARIReleases
Performance and Benchmark Results!

3d Performance On Vapire With Opengl

Ozzy Boshi

Posts 6
15 Jun 2020 11:34


Hello vampires

Today it's my day off and I spent the whole morning playing with my vampire.
Playing means not to play games but see what I can do with mi v600, at the end i came up with a little C program that draws some rodoneas into a coffin window.
I took the math equations from here

EXTERNAL LINK 
and i ended up representing in memory almost all the points of this roses

https://it.wikipedia.org/wiki/Rodonea#/media/File:Rose-rhodonea-curve-7x7-chart.svg

Actually this post is not about for showing off my clumsy attempts to do something good with a vampire but to ask you how would you paint this stuff.

In my tests i used some magic inside a file called libGl.a that artzi gave me some time ago (in the community it's a very well known guy for his amiga ports you should know him very well).

All the code was compiled with bebbo's gcc using fastmath and fpu enabling switches.

Now, in opengl I found out there is a function called glutTimerFunc(...) and its first parameter (for my understanding) it's the time to wait before executing a function , so , callig glutTimerFunc recursively in serial with glutPostRedisplay() should yeld me something like an animation.

In addiction to this i used libsdl playmusic function to have a nice background music.
The thing is, when i give glutTimerFunc first parameter a value less than more or less 100ms, the music disappears.
This is true with flowers made of 720 points, so, in other word it seems the vampire cannot handle moving 720 points quickly while playing music.

So, at the end what I am asking to the people in this forum is... how would you quiclky draw a rodonea (or more in general 2d images rotating in a 3d space) to screen in vampires? Are there alternatives out there instead of using opengl implementation?
Maybe it's only my code so messy and bad written and could be optimized i dont know, if you are about this you can download the whole zip

EXTERNAL LINK 
inside there is my c code, some libs to make him run on amiga and a m68k executable, if you have coffin you should just unzip it and double click on the executable.

I know that it would be way better to rewrite all this stuff in asm but i am not very m68k asm fluent and would take me a lot of time.
On the other hand I deem opengl (lecgacy opengl in this case) very elegant and well documented, furthermore there are plenty of examples and tutorials on the internet.

I know it exists minigl for the amiga, i dont now how to use, actually i dont even know how arti compiled this libGL.a file but it works pretty well. I assume it's just a redirection to gl*.library that I really dont know what is inside, probably someone wrote a software implementation of legacy opengl for amiga bbut I dont know if this is somewhat related to minigl stored in aminet.
I'd like to hear your comments about my frenzy.
Greets from Italy



Denis Markovic

Posts 4
21 Jun 2020 23:49


Hi Ozzy,

nice background music. In general for just drawing single points to the screen I would probably not use OpenGL or any library at all but just hard-code everything directly
on Amiga (i.e. do all the 2D -> 3D -> 2D calculations myself and then just set the
pixels directly in the display buffer, maybe use double buffering).

The reason for this is that I am not sure how efficient the OpenGL implementation is on classic Amiga's (and for me a Vampire is a classic Amiga on steroids); as there is no
dedicated HW support for 3D yet, an OpenGL implementation together with SDL has to be software based, so unless SDL and OpenGL are highly optimised and your code is not, it might be possible that a direct implementation is faster than using the libraries.

I also wanted to learn a bit more about Vampire programming and maybe also refresh my Amiga coding skills a bit, if you like we could do some experiments together to see, how fast we could get your program by using more direct code instead of OpenGL?



Ozzy Boshi

Posts 6
22 Jun 2020 08:16


Hi Denis Markovic and thank you for your reply.
First of all I want to point out that the music is not mine, it's just a remix from a theme from turrican 2 I downloaded from amigaremix.com, I like the music and I thought would fit well on my demo so...

I agree with you about OpenGL on Amiga, it seems very slow but maybe for very small things could be useful even without HW support, drawing some points could be the case.
The main goal of my work is to understand what can I do with vampire and Opengl and see how far I can go with them.
I posted on this forum just to see if anyone could do some sort of little code review and tell me why adding sound support slows down the amiga so much because without wav reproduction for me Opengl could fit well for drawing a 360 points rodonea on screen and rotating it.

I am testing other alternatives though, try this
EXTERNAL LINK  This is the same demo for stock amigas, you can see here positions are precalculated, for me there is no way a stock 68000 can rotate 360 points at each frame, however things change a lot when you run this stuff on a vampire.
This file outputs video from the rgb port, it's just an old school demo with no rtg and a mod playing in the background, but it's not what i wanted at the end.
WARNING : for unknown reasons this file does not run well con coffinOS, if you want to try it you must boot another OS, with wb3.1 works as expected.

I have another experiment:
EXTERNAL LINK  This is a rodonea painted on a rtg window but WITHOUT opengl.
In this demo i used intuition + lib cybergraphics, all it does is to create a bitmap with setAPen() + move() + draw() and blit the result into a viewport.
In this latter demo the rodonea does not spin because I cant figure out how to set a framerate without opengl (in other words i need a corresponding settimerfunc() in this environment, but it could be a faster implementation.

If you are interested in this topic and you want to play around with your vampire with me you can find me privately on whatever platform (skype, irc discord ecc ecc).

Thank you for your interest.



Gunnar von Boehn
(Apollo Team Member)
Posts 4796
22 Jun 2020 08:54


Ozzy boshi wrote:

I posted on this forum just to see if anyone could do some sort of little code review and tell me why adding sound support slows down the amiga so much because without wav reproduction for me Opengl could fit well for drawing a 360 points rodonea on screen and rotating it.

I my experience not all frameworks have good performance.
Some frameworks are not tuned at all
and a bad framework can waste a lot of resources.

For example:
To play a 16bit wave on the recent V4 cores all you need to do a a few MOVE instruction to start it, the rest will be fully done by the HW using DMA. This means play back of a complete WAVE music is 100% free on Vampire if you code it using the HW.

Also the 3D performance can reach very good level is the right code is used.
I have seen some people writing ASM using the FPU to calculate the 3D on Vampire.
These demos rendered 3D pixel/voxel demos exactly like you did.

The pixel count in these demos was rotating 30,000 - 50,000 pixels per frame, and to render them.



Thellier Alain

Posts 117
23 Jun 2020 07:02


See
EXTERNAL LINK 
For a simple C example to draw a 3d object with GL/glut



Steve Ferrell

Posts 393
23 Jun 2020 08:20


thellier alain wrote:

  See
    EXTERNAL LINK   
    For a simple C example to draw a 3d object with GL/glut
   
 

 
Nice!  And completely portable code too.  After downloading and extracting the source code I had the EXE built in Visual Studio in around 15 seconds.
 
EXTERNAL LINK

posts 6