Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 03 Feb 2009
Offline Last Active May 02 2013 09:51 AM

Topics I've Started

Variable-radius Gaussian blur in GLSL

03 April 2013 - 08:04 AM

I wanted to do a simple depth-of-field postprocessing shader, that blurred the image by a value that was related to the depth buffer.  That is, the closer an object is, the more it's blurred.  Most of the Gaussian blur shaders I found were fixed-radius though, so they would blur the entire image by the same amount.
I looked at depth-of-field shaders, but they're a lot more complex than what I'd need, since they typically contain the functionality to blur distant objects more than close objects.  (In layman's terms, my shader should be farsighted, not nearsighted)
I was able to get a decent depth map, where white is close and black is far away, by using the following GLSL vertex shader:
varying float depth;
void main(void)
   gl_Position = ftransform();
   depth = 1.0 / gl_Position.z;
I can tweak the "1.0" value to adjust the falloff.  Now I want to use that depth value to determine the blur radius, or something equivalent.
I found an example of what seems to be what I'd need here:
But I don't really understand it well enough yet to know whether I'm on the right track.  This seems to be a pretty basic shader that I need, so either I'm thinking too hard or not thinking hard enough.  Anyone care to enlighten me?

Forcing a DirectX window into full screen mode

03 September 2009 - 03:32 PM

I've seen plenty of examples of people forcing a full-screen directX application to run in windowed mode, but right now I'm interested in finding out if I can force windowed DX applications to run in full-screen mode. Reason is, I just got a pair of those nVidia shutter glasses that let you see any full-screen directX application in actual 3D. Of course, there are a couple of applications that only run in windowed mode, albeit with resizable windows, and I'm interested in forcing them into full-screen mode so I can get the shutter glasses to work. If I can get either DX9 or DX10 applications to work, that's good enough for me, although I would prefer to get DX10 working. I've tried using some dxhook.dll, but presumably that won't work under Vista or Windows 7, one of which is necessary for using the nVidia shutter glasses. My next thought is to try and interface with the DXGI system (DirectX Graphics Infrastructure) in order to try and link to my application window and set it to full screen. After reading some of Microsoft's documentation on DXGI, (at the link at the bottom) it seems like I might be on the right track, but I still don't know how easy it would be to create one application specifically to control another application. So any ideas anyone? Thanks in advance. http://msdn.microsoft.com/en-us/library/cc835730(VS.85).aspx