Can anyone point me to a blitz3d prog/demo with the source which demos on how to do bump maping, we tryed adding normal maps but it slowed down the game to much, will bump maps work any better?
Thanks
Thanks
x#=entityX(myMesh)-entityX(light)
y#=entityY(myMesh)-entityY(light)
z#=entityZ(myMesh)-entityZ(light)
td=entitydistance(myMEsh,light)
x=x/td
y=y/td
z=z/td
entityColor myMesh,128+128*x,128+128*y,128+128*z



Graphics3D 640,480,16,2:HidePointer SetBuffer BackBuffer():MoveMouse 320,240 ;load And prep mesh For mapping ta =LoadMesh("3d/a.b3d") ;load mesh ScaleMesh ta,1,1,1 ;This is specific to the statue rob used. Remove or adjust for alternative media. ;nm=LoadTexture("normal.png") ;Normal map. If using rob's statue, it's the same one he used. nm=LoadTexture("3d/n2.png") t2=LoadTexture("3d/diffusemap.png") t1=LoadTexture("t1.jpg") ;TextureBlend nm,4 ;dot3 blendng EntityTexture ta,nm,0,0 ;set as base texture. EntityTexture ta,t2,0,1 TextureBlend nm,4 TextureBlend t2,3 HideEntity ta num=40 ;number of statues/meshes for tv=1 To num ti=CopyEntity(ta) RotateEntity ti,0,Rnd(160),0 PositionEntity ti,Rnd(-1000,1000),15,Rnd(-1000,1000) h.h=New h h\id=ti Next ;- Type h Field id End Type AntiAlias False Dither False ;- ;-end of bump-mapping prep. vcam=CreateCamera() cp=CreatePivot() ;just something for the camera to focus on PositionEntity cp,0,25,0 lp=CreateSphere() FitMesh lp,-2,-2,-2,4,4,4 PointEntity vcam,cp ;centre on the statue. PositionEntity vcam,0,15,-120 PointEntity vcam,cp p=CreatePlane() EntityTexture p,t1 ScaleTexture t1,10,10 AmbientLight 128,128,128 Repeat xa#=xa+0.2 If MouseDown(2) PositionEntity lp,EntityX(vcam),EntityY(vcam)+5,EntityZ(vcam) If MouseDown(1) PositionEntity lp,Cos(xa)*60,15,Sin(xa)*60 fr=fr+1 ms=MilliSecs() If ms>ls ls=ms+1000 fps=fr fr=0 EndIf TurnEntity vcam,MouseYSpeed(),-MouseXSpeed(),0 RotateEntity vcam,EntityPitch(vcam),EntityYaw(vcam),0 MoveMouse 320,240 FlushMouse RenderWorld Text 10,10,fps If KeyDown(17) MoveEntity vcam,0,0,0.3 If KeyDown(31) MoveEntity vcam,0,0,-0.3 If KeyDown(30) MoveEntity vcam,-0.3,0,0 If KeyDown(32) MoveEntity vcam,0.3,0,0 For h.h=Each h entitylight( h\id,lp) Next Text 1,30,"Tris>"+TrisRendered() Text 1,45,fps Flip False Until KeyDown(1) Function entityLight(entity,light) ;call every frame. ox=EntityX(light) oy=EntityY(light) oz=EntityZ(light) TFormPoint ox,oy,oz,light,entity PositionEntity light,TFormedX(),TFormedY(),TFormedZ() ;Transpose light into dx# =EntityX(light)-EntityX( entity) dy# =EntityY(light)-EntityY( entity) dz# =EntityZ(light)-EntityZ( entity) nl#=Sqr(dx*dx+dy*dy+dz*dz) nx#=dx/nl ny#=dy/nl nz#=dz/nl nl=(255-nl)/255.0 ;fall off. nl=1-nl If nl>1 nl=1 If nl<0 nl=0 nx=nx*nl ny=ny*nl nz=nz*nl EntityColor entity,128+(128*nx),128+(128*nz),128+(128*ny) PositionEntity light,ox,oy,oz ;return light. End Function



