8th October 2003 06:51 UTC
Texer Suggestions
I have a few ideas for Texer which could make it 1/0 times better.
Faster renderer
1. Scan the image for pixels, and store them in an array with each non-black pixel's x,y,r,g,b values.
2. Go through per-pixel and check if any bitmaps from points in the array intersect with the pixel, and add their respective r,g,b bitmap values together and output at the current pixel.
It's a trade off, basically it enables much larger bitmaps to be drawn without a trade off in speed, but more of them makes it slower.
[Possible toggle option perhaps?]
Example (Psuedocode):
sub main
ScanImage
RenderImage
end sub
function ScanImage
for y = 0 to avswin.height
for x = 0 to avswin.width
if PixelColour is not black then
add PixelPos,PixelColour to array
end if
next x
next y
end function
function RenderImage
for y = 0 to avswin.height
for x = 0 to avswin.width
set FinalPixelColour to black
for n = 0 to NumberInArray
if (abs(x-pixelx(n)) <= bitmap.width) and (abs(y-pixely(n)) < bitmap.height) then
add PixelColour(n) to FinalPixelColour
end if
next n
plot FinalPixelColour at (x,y)
next x
next y
end function
New "Texer Modes"
With this new rendering method, several new "texer modes" are possible. Here are some of my ideas:
1. RGB -> XYB scaling
This is basically where BLUE maps to the brightness, and the RED and GREEN components of a points colour are mapped to a scalar of X and Y axis respectively. It should probably be mapped to an inverse of w and h respectively. This is equivalent to a formula of xscale=w/(red*2-1) and yscale=h/(green*2-1). This would also make the texer non pixel scale dependant. It's also fairly simple to implement, just change the functions for finding whether the pixel is intersecting the point in the bitmap, and the function for getting the colour from that pixel for the point in the bitmap.
2. RGB -> TZB Rotation/Scaling
Similar to the above, but with RED mapping to THETA and GREEN mapping to a Z scalar. The Z scalar is calculated the same as the x/y scalars in the above example. The THETA value is calculated as simply theta=red*pi*2.
3. I'm sure there are other things someone could think of.
Hopefully you'll consider my ideas UnConeD.