S
Skybuck Flying
Brett Davis said:This sort of technology is used for green screen masking of video.
I worked on such code. You should know that long thin polys can
have horrible performance on some graphics hardware.
A bias toward squarish shapes will give better throughput despite
sometimes more boxes to render.
Entry 5 has a bug, in the center left is a large brown box, that
box should have grown down one pixel into the pink box.
It's not really a bug, it's probably an algorithm inefficiency... from the
high number of boxes it can be seen that wasn't ofcourse efficient and I
tried to point that out... meanwhile that algorithm has been made more
efficient and entry6 proves that.
A truly greedy algorithm should have given up some width to steal
half of the blueGreen boxes space. Bias toward most pixels grabbed.
A 2x10 is way better than a 1x12, etc.
Could be a heuristic.. but doubtfull... area doesn't really play a role that
much... sometimes it might be better to make a line to get rid of those
pesky little pixels/boxes which happen to fall on the same line but just one
pixel different... none-the-less area or ratio might still be a nice
heuristic.
You can probably cut the item count of your render list by a third
by including polys. An area greedy algorithm will leave you with
lots of 3 and 6 pixel right triangles, and similar stuff that
explodes into lots of little boxes.
This is a novel idea, for opengl and physics this could make sense.
It's a bit risky though... if the polygon/triangle because to large and it
has a flat angle like so:
.
.............
Then the diagonal that would result from that would describe too many
pixels...
The diagonal would look something like:
-------
-----.......
So it starts to describe non-existing pixels.
But for very small pixels like
.
...
it might work.
Perhaps also something like:
.
..
...
.....
As long as the pixel describe a perfect triangle/diagonal such an idea might
be possible.
So I will consider it when I start the physics testing !
Thanks for this idea, most appreciated !
Bye,
Skybuck.