Jump to content


Photo

Depth Of Field Effect


  • Please log in to reply
12 replies to this topic

#1 OpticalLiam

OpticalLiam

    GMC Member

  • New Member
  • 782 posts

Posted 05 May 2007 - 01:30 PM

<span style='font-size:21pt;line-height:100%'> Depth Of Field</span><span style='font-size:16pt;line-height:100%'> | Effect</span>

Posted Image

Download: Mirror 1 (Working)
Download: Mirror 2

This is a little example that attempts to emulate the Depth of Field effect you may have seen in games such as Crysis. Depth of field is about how the eyes focus and how things become blurry depending on how far away they are and where you are focusing, this example trys to replicate that in a 2D environment. Fairly useless, but pretty damn cool.

Enjoy.

Edited by OpticalLiam, 25 March 2010 - 09:59 PM.

  • 0

#2 BrainWare

BrainWare

    Adrenaline

  • GMC Member
  • 791 posts

Posted 05 May 2007 - 03:58 PM

Nice work Opticalliam =)
It's really pretty, I don't think I have a use for it tho.

Keep up the good work.
  • 0

#3 Pie Person!

Pie Person!

    GM 6+ Lover

  • GMC Member
  • 1973 posts

Posted 05 May 2007 - 04:13 PM

Iv'e been thinking about doing almost the same effect you did but in 3D for a while. Anyway- atleast you got it done in 2D!
  • 0
Cool.

#4 9_6

9_6

    Guest

  • GMC Member
  • 3627 posts

Posted 05 May 2007 - 04:48 PM

Not exactly depth, more like a blur with a ring-shaped area that looks sharp.
Dof would be if only the treetips would be sharp, everything else blurred or the other way around.
You know, depending on how far an object 'sticks out' to the player.
You could even use the depth variable for that.
  • 0

#5 tobi

tobi

    GMC Member

  • New Member
  • 119 posts

Posted 05 May 2007 - 06:05 PM

Well depth of field or not, i looks great :)
  • 0

#6 OpticalLiam

OpticalLiam

    GMC Member

  • New Member
  • 782 posts

Posted 05 May 2007 - 06:13 PM

Not exactly depth, more like a blur with a ring-shaped area that looks sharp.
Dof would be if only the treetips would be sharp, everything else blurred or the other way around.
You know, depending on how far an object 'sticks out' to the player.
You could even use the depth variable for that.

<{POST_SNAPBACK}>


You're right, you can't actually do real DOF in 2D anyway, this is just a stab at making that sort of effect. You could elaborate it further if you want, though I think the effect looks pretty good with out over complicating it. You can make it more subtle too by playing with the alpha mask.
  • 0

#7 IamCalle

IamCalle

    GMC Member

  • GMC Member
  • 444 posts

Posted 05 May 2007 - 07:44 PM

It can always be done in 3D too, but not as efficient as this, I guess.

Nice effect btw!

Edited by IamCalle, 05 May 2007 - 07:45 PM.

  • 0

#8 sHarivaRi

sHarivaRi

    GMC Member

  • New Member
  • 25 posts

Posted 04 July 2007 - 02:24 PM

hmmm, nice example, but if i would use titlesets and no backgrounds, i have to use screen_redraw()?
  • 0

#9 str1ker-

str1ker-

    GMC Member

  • New Member
  • 155 posts

Posted 31 July 2007 - 04:52 AM

That is the coolest thing I've ever seen...

I don't care about it not really being depth of field (it's 2D, it never will be), but that is the coolest 2D blurring effect yet done in Game Maker...

One question: Would you like credit for this, if I put it in one of my games?
  • 0

#10 OneWayTM

OneWayTM

    GMC Member

  • New Member
  • 154 posts

Posted 08 February 2009 - 09:57 AM

That is the coolest thing I've ever seen...

I don't care about it not really being depth of field (it's 2D, it never will be), but that is the coolest 2D blurring effect yet done in Game Maker...




AMAZING !!!! :blink:


dude your a genius !

you need credits if i put this in my game?
  • 0


#11 boxingpuss

boxingpuss

    GMC Member

  • New Member
  • 42 posts

Posted 12 August 2009 - 11:41 PM

I took the time to look up all of your topics, because it seems to me that every example
that you have done is really really nice. Thanks for this DOF effect also.
  • 0

#12 iluvfuz

iluvfuz

    GMC Member

  • GMC Member
  • 1452 posts
  • Version:GM:Studio

Posted 16 August 2009 - 12:48 AM

This would work very well if you use it with a scope in a platformer or TDS.
  • 0

#13 Sinister95

Sinister95

    GMC Member

  • New Member
  • 313 posts

Posted 16 August 2009 - 05:27 AM

Nice effect, but how would you switch it to draw the centre at the player rather than at the mouse cords? I tried and it keeps coming up with a surface draw error.
  • 0

If I have taken time to help you, you could help me by taking your time to register here: GM Lord or/and ACAnimate It takes a couple of seconds and is painless :)