March 04, 2021, 01:04:03 AM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
Forum
Help
Search
Gallery
Login
Register
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
3D Graphics - Effects
»
[bb] FastExt postprocess to groups by GIB3D [ 1+ years ago ]
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: [bb] FastExt postprocess to groups by GIB3D [ 1+ years ago ] (Read 780 times)
BlitzBot
Jr. Member
Posts: 1
[bb] FastExt postprocess to groups by GIB3D [ 1+ years ago ]
«
on:
June 29, 2017, 12:28:42 AM »
Title :
FastExt postprocess to groups
Author :
GIB3D
Posted :
1+ years ago
Description :
Use a postprocess effect such as glow, on certain objects.
Code :
Code: BlitzBasic
Include
"FastExt.bb"
Const
RG_Normal =
1
Const
RG_Glow =
2
Global
Camera
Global
GlowStick
Global
GlowOverlay
InitMedia
Main
Function
Main
(
)
While
Not
KeyDown
(
1
)
pxRenderPhysic
30
,
0
TurnEntity
GlowStick,
0
,
1
,
0
,
1
UpdateWorld
;1. Render Glow Objects with Black Objects
;2. Put into overlay texture
;3. Cls
;4. Render normal objects
;5. Place glow overlay
ColorFilter
0
,
0
,
0
RenderGroup RG_Normal,Camera,
1
ColorFilter
RenderGroup RG_Glow,Camera,
0
SpecialRender
CopyRectStretch
0
,
0
,
GraphicsWidth
(
)
,
GraphicsHeight
(
)
,
0
,
0
,
TextureWidth
(
GlowOverlay
)
,
TextureHeight
(
GlowOverlay
)
,
BackBuffer
(
)
,
TextureBuffer
(
GlowOverlay
)
RenderGroup RG_Normal,Camera,
1
CustomPostprocessOverlay
(
1
,
1
,
255
,
255
,
255
,GlowOverlay
)
RenderPostprocess
(
FE_Overlay
)
;CopyRectStretch 0,0,TextureWidth(GlowOverlay),TextureHeight(GlowOverlay),0,0,256,256,TextureBuffer(GlowOverlay),BackBuffer()
Flip
Wend
End Function
Function
InitMedia
(
)
Graphics3D
800
,
600
,
0
,
2
InitExt
(
)
SetBuffer
BackBuffer
(
)
Local
Light =
CreateLight
(
)
GroupAttach RG_Normal,Light
GroupAttach RG_Glow,Light
Camera =
CreateCamera
(
)
PositionEntity
Camera,
0
,
5
,-
10
RotateEntity
Camera,
30
,
0
,
0
GlowStick =
CreateCylinder
(
)
PositionMesh
GlowStick,
0
,
1
,
0
PositionEntity
GlowStick,
2
,-
1
,
4
ScaleEntity
GlowStick,.125,
2
,.125
RotateEntity
GlowStick,
30
,
0
,
0
EntityFX
GlowStick,
1
GroupAttach RG_Glow,GlowStick
Local
Sphere =
CreateSphere
(
8
)
PositionEntity
Sphere,
2
,
1
,-
2
EntityColor
Sphere,
255
,
80
,
0
EntityFX
Sphere,
4
GroupAttach RG_Glow,Sphere
Local
Ground =
CreatePlane
(
)
EntityTexture
Ground,GTexture
(
100
,
50
,
20
)
GroupAttach RG_Normal,Ground
Local
Obstruction =
CreateCube
(
)
ScaleMesh
Obstruction,
1
,
4
,
1
EntityColor
Obstruction,
150
,
50
,
10
EntityFX
Obstruction,
1
GroupAttach RG_Normal,Obstruction
GlowOverlay =
CreateTexture
(
1024
,
1024
,
1
+
16
+
32
)
End Function
Function
GTexture
(
r,g,b
)
; Green Checkered Texture
Local
T =
CreateTexture
(
64
,
64
)
SetBuffer
TextureBuffer
(
T
)
Color
r,g,b
Rect
0
,
0
,
64
,
64
Color
r*
1.14
,g*
1.14
,b*
1.14
Rect
32
,
0
,
32
,
32
Rect
0
,
32
,
32
,
32
SetBuffer
BackBuffer
(
)
ScaleTexture
T,
4
,
4
PositionTexture
T,.25,.25
Return
T
End Function
Function
SpecialRender
(
)
CustomPostprocessGlow
(
1
,
0
,
4
)
CustomPostprocessGlowEx
(
2
,
2
)
RenderPostprocess
(
FE_Glow
)
End Function
Comments :
puki(Posted 1+ years ago)
I'll just mention that "GIB3D" has offered this code for use with FastExtension: <a href="
http://fastlibs.com/
." target="_blank">
http://fastlibs.com/
.[/url]FastExtension being an awesome way to extend the capabilities of Blitz3D.
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
3D Graphics - Effects
»
[bb] FastExt postprocess to groups by GIB3D [ 1+ years ago ]
SimplePortal 2.3.6 © 2008-2014, SimplePortal