Little glass and refraction effect (Fake)

Blitz3D Forums/Blitz3D Programming/Little glass and refraction effect (Fake)

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Here's a "puki" version - NOTE: Doesn't work on all versions of Blitz3D - so you might just see a black cube and sphere. Plus, you might have to faff with it to get it rotating at desirable speed:
;another 2003 demo by puki - inspired by Mak's Multitexturing demo
;
Graphics3D 800,600,32,1
SetBuffer BackBuffer()
AmbientLight 255,255,255
;use whatever picture you like - some work better than others
path$="C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\water lilies.jpg"
i=LoadTexture( path$,64)
s = LoadSprite(path$)
ScaleSprite s,4,3
cube=CreateCube()
EntityTexture cube,i,0,2
UpdateNormals cube
PositionEntity cube,0,0,-1
;It looks better with a detail texture on the sphere to visually show rotation
;On my computer I use a glass one that shows slight blemishes and shadowing in the sphere
;without doing this, it doesn't visually look like the sphere is rotating
sphere=CreateSphere(32)
ScaleMesh sphere,1.3,1.3,1.3
EntityTexture sphere,i,0,2
UpdateNormals sphere
PositionEntity sphere,0,0,-1
camera=CreateCamera()
PositionEntity camera,0,0,-4
b1=2
b2=2
TextureBlend i,b2
While Not KeyHit(1)
TurnEntity cube,.1,.1,.1
TurnEntity sphere,.1,.2,.3
   UpdateWorld
   RenderWorld
   Flip
Wend
FreeEntity cube
FreeEntity sphere
FreeEntity camera
FreeTexture i
End


EDIT:
Actually, it works okay in 16bit - it didn't before. Blitz3D had problems with multitexturing in one of the recent updates I think - something like that and this type of effect was broken and wouldn't work for some people who had the *duff* version of Blitz3D.