-
Notifications
You must be signed in to change notification settings - Fork 109
/
Dreamfilter.bb
50 lines (41 loc) · 1.34 KB
/
Dreamfilter.bb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Global ark_blur_image%, ark_blur_texture%, ark_sw%, ark_sh%
Global ark_blur_cam%
Function CreateBlurImage()
;Create blur Camera
Local cam% = CreateCamera()
CameraProjMode cam,2
CameraZoom cam,0.1
CameraClsMode cam, 0, 0
CameraRange cam, 0.1, 1.5
MoveEntity cam, 0, 0, 10000
ark_blur_cam = cam
ark_sw = GraphicWidth;GraphicsWidth()
ark_sh = GraphicHeight;GraphicsHeight()
CameraViewport cam,0,0,ark_sw,ark_sh
;Create sprite
Local spr% = CreateMesh(cam)
Local sf% = CreateSurface(spr)
AddVertex sf, -1, 1, 0, 0, 0
AddVertex sf, 1, 1, 0, 1, 0
AddVertex sf, -1, -1, 0, 0, 1
AddVertex sf, 1, -1, 0, 1, 1
AddTriangle sf, 0, 1, 2
AddTriangle sf, 3, 2, 1
EntityFX spr, 17
ScaleEntity spr, 2048.0 / Float(ark_sw), 2048.0 / Float(ark_sw), 1
PositionEntity spr, 0, 0, 1.0001
EntityOrder spr, -100000
EntityBlend spr, 1
ark_blur_image = spr
;Create blur texture
ark_blur_texture = CreateTexture(2048, 2048, 256)
EntityTexture spr, ark_blur_texture
End Function
Function UpdateBlur(power#)
EntityAlpha ark_blur_image, power#
;CopyRect ark_sw / 2 - 1024, ark_sh / 2 - 1024, 2048, 2048, 0, 0, BackBuffer(), TextureBuffer(ark_blur_texture)
CopyRect 0, 0, GraphicWidth, GraphicHeight, 1024.0 - GraphicWidth/2, 1024.0 - GraphicHeight/2, BackBuffer(), TextureBuffer(ark_blur_texture)
End Function
;~IDEal Editor Parameters:
;~F#3#26
;~C#Blitz3D