Vector graphics on the Oric

The Oric video chip is not an easy beast to master, so any trick or method that allows to achieve nice visual results is welcome. Don't hesitate to comment (nicely) other people tricks and pictures :)
Godzil
Squad Leader
Posts: 774
Joined: Sat May 21, 2011 7:21 pm
Location: Between UK and France
Contact:

Vector graphics on the Oric

Post by Godzil »

Do you think that we can acheive good performance 2D vector graphic on the Oric?
User avatar
Chema
Game master
Posts: 3013
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Vector graphics on the Oric

Post 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....
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Vector graphics on the Oric

Post by Dbug »

You can take a look at the LineBench thread:
http://forum.defence-force.org/viewtopi ... ne+drawing
Godzil
Squad Leader
Posts: 774
Joined: Sat May 21, 2011 7:21 pm
Location: Between UK and France
Contact:

Re: Vector graphics on the Oric

Post 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
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Vector graphics on the Oric

Post 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/
User avatar
Chema
Game master
Posts: 3013
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Vector graphics on the Oric

Post 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!
Godzil
Squad Leader
Posts: 774
Joined: Sat May 21, 2011 7:21 pm
Location: Between UK and France
Contact:

Re: Vector graphics on the Oric

Post 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
User avatar
Xeron
Emulation expert
Posts: 426
Joined: Sat Mar 07, 2009 5:18 pm
Contact:

Re: Vector graphics on the Oric

Post 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.
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Vector graphics on the Oric

Post by Dbug »

That's basically what I used in Barbitoric for that part:
Image
Post Reply