Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
my cel-shader
#1
i made a program to "flatten colors" and as it turns out, i made a sort of a cel-shader. well when the colors do get compressed there is this weird fringe crap that is rather unsightly. how the hell can this be fixed?


Code:
screenres 1024,768,32,2,1
dim as double i,c,y,x,a
dim aa(1000000)
Dim garray(4 * (x*y) + 4) As Byte
Bload "picture.bmp", @garray(0)

Put (0,0),garray(0)

'-------------------------
fixam = 9'-- edit this
'-------------------------

if fixam > 255 then fixam = 255
sleep

for y = 0 to 767
for x = 0 to 1023
  a = point(x,y)
  r = int(a/65536)
  a = a - r * 65536
  g = int(a/256)
  a = a - g * 256
  b = a
  
  ir = fixam*(int(r/fixam))
  ig = fixam*(int(g/fixam))
  ib = fixam*(int(b/fixam))
  
  if r - ir < (ir +fixam) - r then r = ir
  if r - ir > (ir +fixam) - r then r = ir + fixam
  if r - ir = (ir +fixam) - r then r = ir
  if r > 255 then r = 255
  if g - ig < (ig +fixam) - g then g = ig
  if g - ig > (ig +fixam) - g then g = ig + fixam
  if g - ig = (ig +fixam) - g then g = ig
  if g > 255 then g = 255
  if b - ib < (ib +fixam) - b then b = ib
  if b - ib > (ib +fixam) - b then b = ib + fixam
  if b - ib = (ib +fixam) - b then b = ib
  if b > 255 then b = 255
  if rgb(r,g,b) = 0 then b = 1
  pset(x,y),rgb(r,g,b)
next
next
sleep
for y = 0 to 767
for x = 0 to 1023
  a = point(x,y)
  for yy = y-1 to y+1
  for xx = x-1 to x+1
    if point (xx,yy) > 0 then if point(xx,yy) <> a then q = q +1
    
  next
  next
  if q > 2 then pset(x,y),0
  q = 0
next
next
sleep
for y = 0 to 767
for x = 0 to 1023
  if point(x,y) > 0 then pset(x,y),8^8-1
next
next

sleep
ii=1
for y = 0 to 767
for x = 0 to 1023
  ii+=1
  aa(ii) = point(x,y)
next
next
cls

Put (0,0),garray(0)
ii=1
for y = 0 to 767
for x = 0 to 1023
  ii+=1
  if aa(ii) = 0 then pset (x,y),aa(ii)
next
next
sleep
quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
Reply
#2
nothing?
quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
Reply
#3
I basically ignore any questions I can't immediately answer on this particular forum. I might look at it eventually.

EDIT: Nah, never mind. You're on your own.
Reply
#4
at leats provide everything to run it, or go to the FB FORUM, a couple more people go there, you know.
Reply
#5
i see. however, this would require more work than i had anticipated.


now i regret being born.
quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
Reply
#6
._.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)