Jump to content

Radial Blur and Radial Masked Blur


Paul Thomas
 Share

Recommended Posts

index.php?app=downloads&module=display&section=screenshot&id=37

File Name: Radial Blur and Radial Masked Blur

File Submitter: Eternal Crisis

File Submitted: 23 Dec 2009

File Category: Materials

Resolution: 512x512

 

Free for use with any Leadwerks Engine game or project.

 

 

 

Directions for Framewerk with engine version 2.8:

 

Field filter_radialblur:TShader
Field filter_radialmaskedblur:TShader

Field radialblur_enabled:Int = False
Field radialblur_blur:Float = 0.0070

Field radialmaskedblur_enabled:Int = False
Field radialmaskedblur_mask:TTexture
Field radialmaskedblur_opacity:Float = 1.0
Field radialmaskedblur_blur:Float = 0.0075

 

Within the Draw method:

 

If radialblur_enabled
DrawEffectRadialBlur(postbuffer[1-cb].colorbuffer[0])
EndIf

If radialmaskedblur_enabled
DrawEffectRadialMaskedBlur(postbuffer[1-cb].colorbuffer[0])
EndIf

 

 

The methods:

 

Method DrawEffectRadialBlur(colortexture:TTexture)
	If Not filter_radialblur filter_radialblur = LoadShader("abstract::radialblur.vert","abstract::radialmaskedblur.frag")

SetShader(filter_radialblur)
SetShaderFloat(filter_radialblur, "blur", radialblur_blur)

colortexture.bind(0)
DrawFlippedImage(colortexture)
EndMethod

Method DrawEffectRadialMaskedBlur(colortexture:TTexture)
	If Not filter_radialmaskedblur filter_radialmaskedblur = LoadShader("abstract::radialmaskedblur.vert","abstract::radialmaskedblur.frag")
	If Not radialmaskedblur_mask radialmaskedblur_mask = LoadTexture("abstract::radialmask_full.dds")

SetShader(filter_radialmaskedblur)
SetShaderFloat(filter_radialmaskedblur, "opacity", radialmaskedblur_opacity)
SetShaderFloat(filter_radialmaskedblur, "blur", radialmaskedblur_blur)

colortexture.bind(0)
radialmaskedblur_mask.bind(1)
DrawFlippedImage(colortexture)
EndMethod

 

 

 

This effect doesn't play nicely while submerged, so it's best to disable the effect when you're submerged, and turn it back on (if it was on when going submerged) when you're no longer submerged.

For the radialmaskedblur you can change the radialmaskedblur_mask texture to use different effects. The zip file provides six different textures that will provide the blur within specific locations. Feel free to play around with them and/or make your own.

If anyone makes any improvements to the shader or improvements with the shader in combination with framewerk, please let me know.

 

Click here to download this file

  • Upvote 1
Link to comment
Share on other sites

Excellent, Thanks EC :) most generous of you, much appreciated.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Not a problem them. This effect is seen in most games, such as Crysis and Far Cry 2. Can be used for multiple types of situations.

 

 

I most definately have a use for this, I was following your shader work on the old forum and on your Blog, all very impressive. :)

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Thanks man :) I'll be releasing more shaders once I finish them. I have a lot more work in the post-processing area just for my own project but I'll be sharing most of them. I think the next shader I'll be working on is water/rain screen splats.

 

 

Wasn't hnphan doing some work on raindrops .. splats .. water things ? I seem to recall a purple based screenie with oil drums but can't remember much more than that.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Yeah. Several months ago I asked if I could get the source to it but he said he was too busy at the time. I then continued my conversion from HLSL to GLSL learning curve, lol.

 

 

lol ..

 

 

I found the thread ... I was right purple and oildrums :) certainly an effect worth having. I look forward to your work in this area.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

The code to his shaders for the chromatic dispersion is included in the HNPHAN folder in every single Leadwerks distro.

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...