Page 1 of 1

Vector graphics on the Oric

Posted: Fri Jun 12, 2015 2:46 pm
by Godzil
Do you think that we can acheive good performance 2D vector graphic on the Oric?

Re: Vector graphics on the Oric

Posted: Fri Jun 12, 2015 6:39 pm
by Chema
It depends on what you call 'good performance' and what you want to achieve. In 1337 1/3 of the total frame time was spent on the double buffer. I can't remember exactly but drawing all the lines was dominating the rest of CPU time.

If you can live with drawing/erasing with EOR and a smaller image area, you can get an idea of what is achievable....

Re: Vector graphics on the Oric

Posted: Fri Jun 12, 2015 8:51 pm
by Dbug
You can take a look at the LineBench thread:
http://forum.defence-force.org/viewtopi ... ne+drawing

Re: Vector graphics on the Oric

Posted: Mon Jun 15, 2015 8:59 pm
by Godzil
DBug: thanks!

But I wonder if for triangle we really need arbitrari line drawing, a simple horizontal line drawing is sufficient (to draw plain triangle of course)

I will look at that

Re: Vector graphics on the Oric

Posted: Tue Jun 16, 2015 7:19 am
by Dbug
You did not specify what you meant by "Vector", so I assumed wireframe.
Now if you are talking of horizontal rasterization, did you mean that http://forum.defence-force.org/viewtopic.php?f=4&t=395 ?

The source code for the line and triangle code is on the svn server:
http://miniserve.defence-force.org/svn/ ... erization/

Re: Vector graphics on the Oric

Posted: Tue Jun 16, 2015 9:07 am
by Chema
Yeah, I also understood wireframe...

I even made some tests with that routines for 3D shapes. They are really fast, though slower than wireframe (if I recall correctly). The BIG trick of the demo is the usage of alternate lines to draw/erase, which made it really impressive!

Re: Vector graphics on the Oric

Posted: Tue Jun 16, 2015 9:33 am
by Godzil
Sorry, that's true that my original post wasn't clear, I'm think about vector graphic with filled triangle as primitive and not direct wireframe graphics

Re: Vector graphics on the Oric

Posted: Thu Jun 18, 2015 6:18 am
by Xeron
I thought about a technique to do really fast horizontal line drawing, but it would (probably) only be good where you are not doing adjacent or overlapping shapes (so I'm thinking of an x-rotator effect, or with precalculated slices a chessboard wobbler for example).

This is where you draw the first six pixels as normal (from a table) then in the next byte put a control code to set the background to the foreground colour, then another to set the foreground to the background colour. Then at the end of the line you draw the last byte as normal (but in inverse) and the byte after that sets the background back to normal.

Obviously, for lines that span less than 4 bytes, you draw as normal.

But for any line longer than that, it takes a constant (small) time to draw. Also, to clear the line you just redraw those few bytes, so that becomes faster too.

Re: Vector graphics on the Oric

Posted: Thu Jun 18, 2015 7:37 am
by Dbug
That's basically what I used in Barbitoric for that part:
Image