Coding competition!

BlitzPlus Forums/BlitzPlus Programming/Coding competition!

Hansie(Posted 2004) [#1]
I have an idea for a very tough competition:

Competition:
To code a demo which fades a fullscreen 800x600 16-bit image to/from black - using NOTHING but BlitzPlus/B2D commands!


big pete(Posted 2004) [#2]
tough? :)
Graphics 800,600,16,1
picta=LoadImage("anything.bmp")
ResizeImage picta,800,600
DrawImage picta,0,0

While Not KeyDown(1)
	timer#=timer#+.1
	aa=(255.0*Sin(timer#))
	ZetGamma(aa)	
	UpdateGamma
Wend

Function ZetGamma(ax)
	For a=0 To 255
		SetGamma a,a,a,a+ax,a+ax,a+ax
	Next
End Function



puki(Posted 2004) [#3]
Perhaps "Hansie" just wanted to know how to do it - so he thought he would hide that fact inside a pretend competition (why make up a competition for something like this, unless you want someone to code it for you?)

Well done "big pete".

"Hansie" any other competitions you want to start? - f'nar.

"Hansie" - Correct me if I'm wrong.


Hansie(Posted 2004) [#4]
@big pete
Your sample code is for Blitz3D, and *not* BlitzPlus as required.

@Puki
my f'nar friend. you underestimate me bigtime
I know how to make a fade-to-black myself, and would never you other people's code since we only publish commercial products. But indeed I wanted to compare the entires with the speed of our own version, and because its BlitzPlus, not B3D, its actually not quite that easy, my friend :-)


Kuron(Posted 2004) [#5]
Your sample code is for Blitz3D, and *not* BlitzPlus as required.
WTF are you smoking dude? Do you even have Blitz Plus, and if so have you read the manual? ALL of those are Blitz Plus commands. ;c)


Floyd(Posted 2004) [#6]
Okay, here is a version suitable for both BlitzPlus and Blitz3D.
Graphics 800, 600, 16, 1
SetBuffer BackBuffer()    ; needed for Blitz3D, automatic in BlitzPlus

picta=LoadImage( "whatever.bmp" )
ResizeImage picta, 800, 600
DrawImage picta, 0, 0
Flip

While Not KeyDown( 1 )
	timer# = ( timer# + 0.2 ) Mod 360.0
	aa# =  Abs( Cos( timer ) )
	ZetGamma( aa )	
	UpdateGamma
Wend

Function ZetGamma( ax# )
	For a = 0 To 255
		b = a * ax
		SetGamma a,a,a, b,b,b
	Next
End Function



Hansie(Posted 2004) [#7]
@all

Sorry, you were correct. of course they work with my BlitzPlus. Both samples are not what I thought they were though, I wanted a "slow" fading effect like credits in demo's and films ...


big pete(Posted 2004) [#8]
Change
	timer#=timer#+.1
to
	timer#=timer#+.00001
to make the fade 10,000 times slower (for example).

Is that slow enough?


xlsior(Posted 2004) [#9]
Unfortunately the Gamma solution has one major drawback: only works in fullscreen, not windows mode...


Warren(Posted 2004) [#10]
He only specified fullscreen in the requirements.


MagicalTux(Posted 2004) [#11]
you think someone would manage to do the same in windowed 800x600 mode with only Blitz+ and no DLL call ?

Looks like "Try to code it without using your hands" ... mmh..


Kanati(Posted 2004) [#12]
I got one...

Code a demo that runs in full screen 800x600x32 mode.

It has to do pixel shading, bump mapping, and use directx 9 only. And it has to run at 60fps or better and have at last 100 3D animated models moving on screen at once (50,000 poly meshes and up). And you gotta do it ONLY in BlitzPlus.

The prize... A 2004 lamborghini diablo... model. kit.


Hansie(Posted 2004) [#13]
@all

And deadline is in 24 hours!


Hansie(Posted 2004) [#14]
has anyone tried the fade stuff using readpixel() and writepixel()?


WoeIsMe(Posted 2004) [#15]
ahem...
Cls

It's the best I can do! :P


Hansie(Posted 2004) [#16]
@woeisme

you win the award for the shortest demo ever made.

here - take your prize. a copy of XXXX BXXXC :-D


WoeIsMe(Posted 2004) [#17]
:D