Just like to say this is one cool shader. I'm using it in DBP but it won't display anything unless I paste the camera effect texture to the screen. (It's as if the screen quad isn't being displayed) Any ideas?
I'm using the quad.fx from dark shader with your bloom shader. My code is below...
Width# = 640.0 : Height# = 480.0
Set Display Mode Int( Width# ), Int( Height# ), 32
Backdrop On : Color Backdrop 0 : Sync On : Sync Rate 0 : Sync : Autocam Off
Set Camera Aspect Width# / Height#
Reload Display Pointer
Load Image "wall_U4_05.bmp", 1
Load Image "niro.jpg", 2
Load Image "Sand.jpg", 3
Set Ambient Light 12
SetupBloom()
Obj = MakeSegment( 1, 0.0, 0.0, 0.0, 0.0, 3, 1, 2, RGB( 128, 128, 255 ) )
Position Camera 0.0, 10.0, 43.0
Do
X# = 0.0 + 10.0 * Sin( Timer() * 0.0125 )
Z# = 0.0 + 10.0 * Cos( Timer() * 0.0125 )
Position Camera X#, 10.0, Z#
Point Camera 0.0, 10.0, 0.0
Text 0, 0, Str$( Screen FPS() )
UpdateBloom()
Loop
Function SetupBloom()
Global ScreenQuadImage
Global ScreenQuad
Global BloomCam = 1
Global BloomEffect = 1
Global QuadEffect = 1
ScreenQuadImage = GetBlankImgNo() : Make Camera BloomCam : Color Backdrop BloomCam, 0 : Load Camera Effect "post-bloom.fx", BloomEffect, 0 : Set Camera Effect BloomCam, BloomEffect, ScreenQuadImage
ScreenQuad = GetBlankObjNo() : Make Object Plain ScreenQuad, 2, 2, 1 : Load Effect "quad.fx", QuadEffect, 0 : Set Object Effect ScreenQuad, QuadEffect
Null = Make Vector4( 1 ) : Set Vector4 1, Int( Width# / 2.0 ), Int( Height# / 2.0 ), 0, 0 : Set Effect Constant Vector QuadEffect, "ViewSize", 1 : Null = Delete Vector4( 1 ) : Texture Object ScreenQuad, 0, ScreenQuadImage
EndFunction
Function UpdateBloom()
If Not BloomCam Then ExitFunction
If Not ScreenQuad Then ExitFunction
Position Camera BloomCam, Camera Position X( 0 ), Camera Position Y( 0 ), Camera Position Z( 0 )
Rotate Camera BloomCam, Camera Angle X( 0 ), Camera Angle Y( 0 ), Camera Angle Z( 0 )
Hide Object ScreenQuad
Sync Camera BloomCam
Show Object ScreenQuad
Sync Camera 0
Paste Image ScreenQuadImage, 0, 0
EndFunction
Function MakeSegment( SegType, X#, Y#, Z#, YAng#, FloorTex, WallTex, CeilingTex, LightCol )
Length# = 60.0 : TexScale# = Length# / 20.0
Obj1 = GetBlankObjNo() : Make Object Plain Obj1, 20.01, Length# : Position Object Obj1, X#, Y#, Z# : XRotate Object Obj1, 90 : Fix Object Pivot Obj1 : YRotate Object Obj1, YAng# : Texture Object Obj1, FloorTex : Scale Object Texture Obj1, 1, TexScale#
Obj = GetBlankObjNo() : Make Object Plain Obj, 19.01, Length# : Position Object Obj, X#, Y# + 20, Z# : XRotate Object Obj, 90 : Fix Object Pivot Obj : YRotate Object Obj, YAng# : Texture Object Obj, CeilingTex : Scale Object Texture Obj, 1, TexScale#
Obj = GetBlankObjNo() : Make Object Plain Obj, Length#, 19.51 : Position Object Obj, X#, Y# + 9.75, Z# : YRotate Object Obj, 90 : Fix Object Pivot Obj : YRotate Object Obj, YAng# : Move Object Left Obj, 10.0 : Texture Object Obj, WallTex : Scale Object Texture Obj, TexScale#, 1
Obj = GetBlankObjNo() : Make Object Plain Obj, Length#, 19.51 : Position Object Obj, X#, Y# + 9.75, Z# : YRotate Object Obj, 90 : Fix Object Pivot Obj : YRotate Object Obj, YAng# : Move Object Right Obj, 10.0 : Texture Object Obj, WallTex : Scale Object Texture Obj, TexScale#, 1
Obj = GetBlankObjNo() : Make Object Plain Obj, Length#, 0.7 : Position Object Obj, X#, Y# + 19.755, Z# : YRotate Object Obj, 90 : XRotate Object Obj, 45 : Fix Object Pivot Obj : YRotate Object Obj, YAng# : Move Object Left Obj, 9.75 : Set Object Emissive Obj, LightCol
Obj = GetBlankObjNo() : Make Object Plain Obj, Length#, 0.7 : Position Object Obj, X#, Y# + 19.755, Z# : YRotate Object Obj, 90 : XRotate Object Obj, 135 : Fix Object Pivot Obj : YRotate Object Obj, YAng# : Move Object Right Obj, 9.75 : Set Object Emissive Obj, LightCol
EndFunction Obj1
It doesn't really matter about the textures as the bloomable bit is an object with no texture anyway. Just rem out the 'Paste Image ScreenQuadImage, 0, 0' line in the 'UpdateBloom()' function
My signature is NOT a moderator plaything! Stop changing it!