I have a source, i think this is what you are looking for:
Graphics3D 800,600,32,2
;Must let the DLL know a few things about Blitz3D!
d3d=SystemProperty$("Direct3D7")
dev7=SystemProperty$("Direct3DDevice7")
draw7=SystemProperty$("DirectDraw7")
hwnd=SystemProperty$("AppHWND")
instance=SystemProperty$("AppHINSTANCE")
If SetSystemProperties(d3d,dev7,draw7,hwnd,instance) RuntimeError "Error setting 1 or more System Propertys!"
;Does the hardware support bump mapping, and luminance bump mapping?
If Not SupportsBumpMapping() Then RuntimeError("No Hardware support for Bump Mapping!")
If Not SupportsLumiBumpMapping() Then RuntimeError("No Hardware support for Luminance Bump Mapping!")
; Camera.. Light(s).. Action!
cam=CreateCamera()
PositionEntity cam,0,0,-2
CameraRange cam,.01,10
CameraClsColor cam,100,120,200
sphere=CreateSphere(32)
RotateEntity sphere,0,90,0
colorTex = CreateTexture(1,1)
SetBuffer TextureBuffer(colorTex)
c=255
Color 155,120,20
Rect 0,0,1,1,True
SetBuffer BackBuffer()
;Load a bump map. Bump maps for this type of bump mapping are nothing
;more than normal maps. The blue channel/pixels can be used to set the
;Luminance is the bump mode is 0 (see below)
bumpTex = LoadTexture("bumpmap.png",1+256)
;cubemap
envTex=LoadTexture("cubemap\cloudyhills.jpg",1+128+256)
;Set blend mode for cubemap to Add
TextureBlend envTex,3
;Apply the 3 textures
EntityTexture sphere,colorTex,0,0
EntityTexture sphere,bumpTex,0,1
EntityTexture sphere,envTex,0,2
;The bump settings
;If bumpMode = 0, the luminance is taken from the textures Blue channel/pixels
;If bumpMode = 1, luminance is set via lumScale and lumOffset
bumpMode=1
lumScale#=1.5
lumOffset#=0
m00#=1:m10#=-1
m01#=-1:m11#=1
MoveMouse 400,300
fps=0
counter=0
timer=MilliSecs()
While Not KeyDown(1)
If MouseDown(1) TurnEntity sphere,0,-.05,0
v#=.001
If KeyDown(42) v=.0005
If KeyDown(30) MoveEntity cam,-v,0,0
If KeyDown(32) MoveEntity cam,v,0,0
If KeyDown(17) MoveEntity cam,0,0,v
If KeyDown(31) MoveEntity cam,0,0,-v
RotateEntity cam,(400+MouseY())*.5, -(MouseX()-400)*.5,0
If KeyHit(57)
m00=0:m01=0
m10=0:m11=0
End If
s#=.002
If KeyDown(2)
m00=m00 - s
m01=m01 + s
End If
If KeyDown(3)
m00=m00 + s
m01=m01 - s
End If
If KeyDown(4)
m10=m10 - s
m11=m11 + s
End If
If KeyDown(5)
m10=m10 + s
m11=m11 - s
End If
If KeyDown(200) lumScale=lumScale+.001
If KeyDown(208) lumScale=lumScale-.001
If KeyDown(205) lumOffset=lumOffset+.001
If KeyDown(203) lumOffset=lumOffset-.001
SetBumpInfo m00,m01,m10,m11,lumScale,lumOffset,bumpMode
;This function forces settings for the next geometry rendered
;It makes texture layer 1 use bump mapping
EnableRenderBumpTexture
RenderWorld
;Return texture layer 1 to normal Blitz3D settings
DisableRenderBumpTexture
;Update FPS counter
counter=counter+1
If MilliSecs() - timer > 999
fps=counter
counter=0
timer=MilliSecs()
End If
Color 0,0,0
Text 0,0,"FPS: "+fps
Text 0,12,"w,s,a,d,mouse to move/look, LMB to spin sphere"
Text 0,40,"1,2 and 3,4 adjust the bump matrix. Cursors adjust scale & offset"
Text 0,52,"SPACE sets the bump matrix to 0,0,0,0"
Text 0,64,"m00: "+m00+" , m01: "+m01
Text 0,76,"m10: "+m10+" , m11: "+m11
Text 0,88,"scale: "+lumScale
Text 0,100,"offset: "+lumOffset
Flip 0
Wend
End
or download the archive with bumpmaps + dll:
http://www.t3k-entertainment.com/freefiles/bumpy_text_demo.zip
|