| |
Bitbreaker
Registered: Oct 2002 Posts: 508 |
Compotime: Show me your (vector)balls
After several comments arised that such an amiga-ball can be filled faster, i now want to call out a filler-compo for our coders.
Requirements:
The vector must be rendered in hires, background is white, foreground is dark red.
There's a raster-irq running that splits the screen at $2d and $f2 to set the background and border color to white and black, as seen in the screenshot. Means, there is a charline free in the bottom, that is where the benchmark results are displayed with the system charset. Displaying the result with screencodes is enough for us coders, but hex or decimal values are okay too.
The animation will be precalculated to see the power of your filler only. Therefore a data.bin is provided that contains all animationsteps for all faces with culling etc. already done.
The data structure may be altered to your needs, but not the animation itself, obvious isn't it?
The structure of data.bin is as follows:
byte x1 | $80
byte y1
byte x2
byte y2
byte x3
byte y3
byte x4 (optional, depending on if we have a triangle or quad)
byte y4 (optional, depending on if we have a triangle or quad)
As you can see faces can have 3 or 4 vertices, the first vertice is marked with bit 7 set, to be able to determine if a face consists of 3 or 4 vertices and to have a break out point for a finished frame, which is marked with the value $ff. If there's further questions about the data-format, don't hesitate to contact Bitbreaker
The filling must happen fullframe and fullsize, means, no interlacing or other cheap tricks with reducing resolution.
A counter for benchmarking must be implemented to count the frames until 256 frames have been displayed, it must be made visible in the bottom line.
The lowest value achieved counts (as there might be some jitter), for that, each entry must run in an endless loop.
The whole mem can be used, but every free byte of mem gives extra kudos.
Deadline is June 25th 0:00.
If the deadline is extended, a severe drama is expected, if not, you are out. Also i'll participate with an own entry, make a drama about it! :-)
Entries must be handed in to Bitbreaker and must not be released beforehand. They all will then released after the deadline, for maximum thrill and drama :-)
Each entry must be executeable with run.
SO DO YOU HAVE THE BALLS? |
|
... 166 posts hidden. Click here to view all posts.... |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1409 |
Do entries need to render from data.bin directly, or can they be preprocessed?
If preprocessing is allowed, can it be at assembly time, or must it be after the demo has loaded?
What timezone is the deadline in? |
| |
Oswald
Registered: Apr 2002 Posts: 5095 |
this compo rather tests line drawing speed than filling. :) I see many obvious optimizations, dont know if I'd give away if write it there, most decent coders know them already. some of these are almost on the animation side... no wonder jackie is testing it in java :)
maybe rules should be extended that frames may not deviate more than X% from some original rendering ? algorithm will make a lossy char anim of this in no time :) |
| |
Bitbreaker
Registered: Oct 2002 Posts: 508 |
Quote: this compo rather tests line drawing speed than filling. :) I see many obvious optimizations, dont know if I'd give away if write it there, most decent coders know them already. some of these are almost on the animation side... no wonder jackie is testing it in java :)
maybe rules should be extended that frames may not deviate more than X% from some original rendering ? algorithm will make a lossy char anim of this in no time :)
data.bin can be preprocessed even before linked to the part, as said, it can be adopted to your needs, it's just important that faces appear at the same place (i bit of inaccuracy is okay, as you can also see from my screenshot), as there's when bluntly using data.bin. Deadline is June 25th 2013 0:00 MET.
any blocky animation will be deteced within no time and a serious drama will be generated upon it, be sure about that! :-) If not it will be downvoted and the drama begins! |
| |
HCL
Registered: Feb 2003 Posts: 728 |
Oh, so it's not about doing the fastest filler, it's about getting peoples votes? That changed the field drastically :P. |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1409 |
Oops, I missed that line; my bad. Thanks for the clarifications, on both counts. |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1409 |
Are we permitted to plot into a 16x16 grid of characters, or must it be in standard bitmap mode? |
| |
enthusi
Registered: May 2004 Posts: 677 |
So the code is supposed to handle exactly those vertices in whatever format? Preprocessing should not include data as i.e. horizontal on/offs? |
| |
Bitbreaker
Registered: Oct 2002 Posts: 508 |
you are free to choose any mode, and yes, it fits into a 16x16 charfield for maybe a good reason :-) Actually i don't want to restrict too much and keep space for playing around :-)
And yes, you may create any new data from the data.bin that suits your needs better, but you'll understand that just dividing all numbers by two might be a bad idea in regards to the outcoming result, but feel free to build any new dataset from it, like for e.g. swap x/y, change clockwiseness or whatever or save more bytes if you feel for it as long as the outcome on the screen is the same as if using the original data. Of course there's no need then to include the original data.bin if you found your own, better format. Also you can preprocess the data with whatever you want, it must not be the task of your .prg to do so, but of course can, if you got BALLS :-) |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
To preview the data you may use this piece of java-code which reads data.bin directly:
import java.awt.*;
import java.io.*;
public class Reference extends Frame {
private static final int ZOOM = 4;
private byte data[];
private int dataPointer = 2;
private int next() {
int r = ((int)data[dataPointer++])&0xff;
if (dataPointer >= data.length)
dataPointer=2;
return r;
}
private int peek() {
return ((int)data[dataPointer])&0xff;
}
public Reference() {
super("Bitbreaker's filler compo");
try {
File f = new File("data.bin");
FileInputStream fis = new FileInputStream(f);
data = new byte[(int)f.length()];
fis.read(data);
fis.close();
}
catch (IOException e) {
e.printStackTrace();
System.exit(1);
}
setLayout(new BorderLayout());
final Panel p = new Panel() {
public void paint(Graphics g) {
g.setColor(Color.WHITE);
g.fillRect(0,0,getWidth(),getHeight());
g.setColor(Color.RED);
int x[] = new int[4];
int y[] = new int[4];
while(peek()!=0xff) {
int nbrVertices = 0;
do {
y[nbrVertices] = (next() & 0x7f)*ZOOM;
x[nbrVertices] = (next())*ZOOM;
nbrVertices++;
} while ((peek()&0x80)==0);
g.fillPolygon(x, y, nbrVertices);
}
next();
}
public Dimension getPreferredSize() {
return new Dimension(128*ZOOM, 128*ZOOM);
}
};
add(p, BorderLayout.CENTER);
pack();
setResizable(false);
setVisible(true);
Thread t = new Thread() {
public void run() {
while(true) {
try {
p.repaint();
Thread.sleep(1000/50);
}
catch (InterruptedException e) {
}
}
}
};
t.start();
}
public static void main(String[] args) {
new Reference();
}
}
|
| |
chatGPZ
Registered: Dec 2001 Posts: 11391 |
not very interested in coding hires fillers atm - but i might use this dataset as input for my mod converter and make a sequel of It's All Your Fault with it =P |
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | ... | 18 - Next |