Little glass and refraction effect (Fake)

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

Filax(Posted 2004) [#1]


http://www.blitz3dfr.com/tempo/Glass.zip

This is fake, but funny :)


Picklesworth(Posted 2004) [#2]
Cool.


Perturbatio(Posted 2004) [#3]
dunno about funny, but it is kinda cool.


Clyde(Posted 2004) [#4]
Indeedly Cool!
welldone Filax :D


BlitzSupport(Posted 2004) [#5]
Yet another fine blitz3dfr production -- looks good!


Sunteam Software(Posted 2004) [#6]
Very nice!


puki(Posted 2004) [#7]
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.


Filax(Posted 2004) [#8]
Thanks guys :) but i'm not really the creator of this effect :)

look this very nice code :

http://www.blitzbasic.com/codearcs/codearcs.php?code=578

I have modify a little bit the norc code :) enjoy :)

The fake refraction effect is very easy to add :)

PointEntity F\Camera,F\EntityIn
PositionEntity F\Camera,EntityX(F\EntityIn,1),EntityY(F\EntityIn,1),EntityZ(F\EntityIn,1),1

Add this line ;
RotateEntity F\Camera,-EntityPitch(F\EntityIn,1),-EntityYaw(F\EntityIn,1),EntityRoll(F\EntityIn,1),1


_PJ_(Posted 2004) [#9]
I think it looks really nice.


Damien Sturdy(Posted 2004) [#10]
i assume it uses cubemapping, which restarts my machine? cool. it restarted :p


Looks great, ive done a few things like this myself! il check it on a modern machine later on :)


Clyde(Posted 2004) [#11]
Lovely stuff folks! :)
Welldone!


Damien Sturdy(Posted 2004) [#12]
i just gave it a go on a decent system... works very well mate! nice work!!!


jfk EO-11110(Posted 2004) [#13]
Yep, looks cool :) A lot better than mine.


Drey(Posted 2004) [#14]
mmm, nothing showed up on mine. ATI 8500le...