Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / "edge of screen" blur shader?

Author
Message
thenerd
15
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 7th Jul 2009 17:12
is there any way to make it so that the edge of the screen would be blurred? Not really a depth-of-field effect, but something like these:
In this one, a perfect example. it's a little hard to see, but the area around the sniping scope is blurred. That's what i want to do.


another example:


a shader, maybe?

Now is better than never.
Although never is often better than *right* now.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 7th Jul 2009 17:21
You could use a refractive shader from evolved and set a mask so it only effects the outer edge of the screen, and apply it to a locked plain attached to the camera..

Your signature has been erased by a mod because it is way too awesome!
thenerd
15
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 7th Jul 2009 17:37
wouldn't that just distort the edge of the screen instead of blur it?

Now is better than never.
Although never is often better than *right* now.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 7th Jul 2009 17:49
Depends on the shader.

Your signature has been erased by a mod because it is way too awesome!
Serial Velocity
15
Years of Service
User Offline
Joined: 24th Aug 2008
Location:
Posted: 7th Jul 2009 18:10 Edited at: 7th Jul 2009 18:16
I guess one way to achieve the effect Mirrors Edge has is to first of all apply a fullscreen shader that reads a mask and that mask determines how much the edge blurs.

Here is the type of mask im talking about, I rushed it so it isnt perfectly centered:


What you do is texture that mask onto the onscreen quad (a plain object positioned so it covers the screen exactly, locked) using tex. layer 1 (tex. layer 0 is going to be the screen rendered to an image), then use the shader to read the brightness of that pixel from 0 to 1 and use that as a multiplier for how much it blurs. Like for example (Psuedocode):



The Sniper effect could be done using a mask that has a solid black part where the scope is, and the blurred part is white.

If you want I can write up an example with a shader

thenerd
15
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 7th Jul 2009 18:35
could you?
I have FX Composer, but I only know a little HLSL.

Now is better than never.
Although never is often better than *right* now.
thenerd
15
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 7th Jul 2009 19:26
sorry for the double post, but do you need a shader to use an apha map, or is there a command?

Now is better than never.
Although never is often better than *right* now.
Serial Velocity
15
Years of Service
User Offline
Joined: 24th Aug 2008
Location:
Posted: 7th Jul 2009 19:27
Just load an image with an alpha layer, then simply call this:

Set Object Transparency Obj, 2

thenerd
15
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 7th Jul 2009 20:00
thank you. can you still write the shader?

Now is better than never.
Although never is often better than *right* now.
Serial Velocity
15
Years of Service
User Offline
Joined: 24th Aug 2008
Location:
Posted: 7th Jul 2009 20:00
Im working on it, its harder than I thought

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Jul 2009 00:08
Quote: "Im working on it, its harder than I thought "


Watch this space.
thenerd
15
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 8th Jul 2009 00:57
->

Now is better than never.
Although never is often better than *right* now.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Jul 2009 15:05 Edited at: 8th Jul 2009 15:07
Try this.

It doesn't include the overlay, but you should see that the objects near the centre of the screen are unblurred.

This version is a resource hog - I'm sure a much faster version could be produced by combining the blurring and masking steps. But it's a start.

Attachments

Login to view attachments
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Jul 2009 15:06
Screenshot

Attachments

Login to view attachments
thenerd
15
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 8th Jul 2009 19:58
the screenshot looks good, but I still have the trial version of dbpro, so "set camera effect" does not exist.
I'll come back to it, and use the source later.
can you upload an exe?

Now is better than never.
Although never is often better than *right* now.
Serial Velocity
15
Years of Service
User Offline
Joined: 24th Aug 2008
Location:
Posted: 8th Jul 2009 20:44
Here ya go.

Awesome shader GG, beat me to it

Attachments

Login to view attachments
thenerd
15
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 8th Jul 2009 20:48 Edited at: 8th Jul 2009 20:49
that's just what I want!
thank you for making an exe.
and, of course Green Grandolf for making the shader.

Now is better than never.
Although never is often better than *right* now.

Login to post a reply

Server time is: 2024-04-26 22:29:48
Your offset time is: 2024-04-26 22:29:48