Public Sub doBump()
Dim lx As Long, ly As Long, c As Long, r As Long
Dim xdelta As Long, ydelta As Long
Dim tByte As Integer
lx = -cx + 15 + b_wid
For c = 1 To pic_w
ly = cy - 274 + b_hgt
For r = 1 To pic_h
xdelta = lx + PixL(c - 1, r) - PixL(c + 1, r)
ydelta = (ly + r) + PixL(c, r - 1) - PixL(c, r + 1)
With Pix2(c, r)
If ydelta And 65280 Or xdelta And 65280 Then
.g = 0
.r = 0
.B = 0
Else
tByte = phong(xdelta, ydelta)
If tByte > 255 Then tByte = 255
.r = tByte * cz
.g = tByte * cz
.B = tByte * cz
End If
End With
Next
lx = lx + 1
Next
DrawOnTex Tex, Pix2(), 256
End Sub
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 31