Page 2 of 2

Re: depth of field shader

Posted: 11 Mar 2010, 22:37
by very_bad_soldier
Looks cool. Somehow 3D.

Re: depth of field shader

Posted: 12 Mar 2010, 14:43
by Tribulex
BWAHAHAA TILT SHIFT LULZ!!!!!!!!!!!!!!!!!!!!!!!

Re: depth of field shader

Posted: 22 Sep 2012, 09:33
by Forboding Angel
So playing GW2 game me an idea about this.

That game does a very minor blurring on objects that are a certain distance away, and it makes the game look even more incredible. Something like that could benefit this?

Re: depth of field shader

Posted: 23 Feb 2013, 17:53
by Floris
I'm trying to shoot video footage and maybe adding some DoF would be neat, but if the scripts fail... I'm nowhere.

jk's widget:

[f=0025595] Error in DrawScreenEffects(): [string "LuaUI\Widgets\gfx_dof.lua"]:284: bad argument #1 to 'Uniform' (number expected, got nil)
[f=0025595] Removed widget: DepthOfField

hmm it seems to work now, if only jK's widget is called and satrik isn't

but it still has some quirck when dragging the camera around:
Seems this only happens at the sky image..

and... what line should i edit to change the strenght of the blur?

satrik's v2 widget:

[f=0025585] Error in Initialize(): [string "LuaUI\Widgets\gfx_dof2.lua"]:250: bad argument #1 to 'GetUniformLocation' (number expected, got nil)
[f=0025585] Removed widget: DepthOfField2

my setup (copied relevant infolog parts):
[CMyMath::Init] CPU SSE mask: 127, flags:
SSE 1.0: 1, SSE 2.0: 1
SSE 3.0: 1, SSSE 3.0: 1
SSE 4.1: 1, SSE 4.2: 1
SSE 4.0A: 0, SSE 5.0A: 0
using streflop SSE FP-math mode, CPU supports SSE instructions
OS: Microsoft Windows
Microsoft Windows 7 Home Premium Edition, 64-bit Service Pack 1 (build 7601)
Intel(R) Core(TM) i7 CPU Q 720 @ 1.60GHz; 4084MB RAM, 8167MB pagefile
OS: emulated 32bit mode
[Watchdog] Installed (HangTimeout: 10sec)
Available log sections: KeyBindings, CSMFGroundTextures, RoamMeshDrawer, BumpWater, DynWater, SkyBox, FarTextureHandler, Model, Piece, ModelDrawer, OBJParser, WorldObjectModelRenderer, Texture, Font, CollisionVolume, GroundMoveType, Path, UnitScript, AutohostInterface, ArchiveScanner, VFS, Sound, LuaSocket
Enabled log sections: Sound(LOG_LEVEL_INFO)
Enable or disable log sections using the LogSections configuration key
or the SPRING_LOG_SECTIONS environment variable (both comma separated).
Use "none" to disable the default log sections.
LogOutput initialized.
Spring 91.0 (MT-Sim)
Build date/time: Aug 30 2012 21:06:37
Build environment: boost-104800, GNU libstdc++ version 20100429
Compiler: gcc-4.4.4

Supported Video modes: 2048x1536, 1920x1440, 1920x1200, 1920x1080, 1800x1440, 1800x1350, 1792x1344, 1600x1200, 1280x1024, 1280x800, 1280x768, 1280x720, 1152x864, 1024x768, 1024x600, 800x600, 800x480, 720x480, 640x480
Video mode set to 1920x1080/32bit
[f=0000000] SDL version: 1.2.10
[f=0000000] GL version: 3.3.11653 Compatibility Profile Context FireGL
[f=0000000] GL vendor: ATI Technologies Inc.
[f=0000000] GL renderer: ATI Mobility Radeon HD 4670
[f=0000000] GLSL version: 3.30
[f=0000000] GLEW version: 1.5.8
[f=0000000] Video RAM: total 680MB, available 905MB
[f=0000000] GL info:
haveARB: 1, haveGLSL: 1, ATI hacks: 1
FBO support: 1, NPOT-texture support: 1, 24bit Z-buffer support: 0
maximum texture size: 8192, compress MIP-map textures: 0
maximum SmoothPointSize: 63, maximum vec4 varying/attributes: 32/16
maximum drawbuffers: 8, maximum recommended indices/vertices: 16777215/2147483647
number of UniformBufferBindings: 45 (64kB)
[f=0000000] VSync disabled
[f=0000000] Joysticks found: 0
[f=0000000] Warning: Joystick 0 not found
[f=0000000] CPU Cores: 8
[f=0000000] CPU affinity not set

Re: depth of field shader

Posted: 23 Feb 2013, 20:55
by Satirik
add "Spring.Echo(gl.GetShaderLog())" next to the shader creation (line 229) in my version to see what's wrong, it will print the shader compilation error logs in the console

Re: depth of field shader

Posted: 23 Feb 2013, 21:44
by Floris

[f=0000000] Loading: LuaUI\Widgets\gfx_dof2.lua
[f=0000000] Fragment shader failed to compile with the following errors:
ERROR: 0:40: error(#160) Cannot convert from 'uniform float' to 'mediump int'
ERROR: error(#273) 1 compilation errors. No code generated

[f=0000000] false
[f=0000000] Error in Initialize(): [string "LuaUI\Widgets\gfx_dof2.lua"]:261: bad argument #1 to 'GetUniformLocation' (number expected, got nil)
[f=0000000] Removed widget:

#160: if (not canShader) then
#273: if (gl.DeleteTextureFBO) then
#261: focusLoc = gl.GetUniformLocation(dofShader,"focus")

Re: depth of field shader

Posted: 24 Feb 2013, 10:44
by Satirik
try this one

Re: depth of field shader

Posted: 24 Feb 2013, 13:50
by Floris
works! It looks more real than the jK one but it eats a lot of fps. I guess fiddling with the options would be a good idea then.

... it still breaks down jK's widget if you switch from yours to his afterwards.

Re: depth of field shader

Posted: 24 Feb 2013, 14:21
by Satirik
if you want to play with the options you need to comment line 128-131

Code: Select all

  --options.quality.value  = data.quality or 2.
  --options.intensity.value = data.intensity or 1.
  --options.focusCurveExp.value = data.focusCurveExp or 2.
  --options.focusRangeMultiplier.value = data.focusRangeMultiplier or 1.

Re: depth of field shader

Posted: 27 Feb 2013, 19:13
by Floris
thnx for all the help

The rezbot-monk can finally focus on meditation now.


But i still have a request, can somebody make it toggable via shortcut?

This will greatly help position the camera smoothly, and then start the slideshow with the dof toggle and capture video/take screenshto and toggle off again

and... if so, also as a bonus make a shortcut/mwheel to in/decrease dof intensity?

-- edit:
I'm already working on this myself... posting file later

Re: depth of field shader

Posted: 02 Mar 2013, 00:46
by Floris
Added key bindings:
- F10 = toggle widget rendering on/off
- CTRL+[ or ] = de/increase intensity
Added console commands:
- dofQuality #number
- dofIntensity #number

And changed some default option values

Re: depth of field shader

Posted: 03 Mar 2013, 16:29
by Floris
The widget is doing great for making new loadscreens.

But.... It only allows the focal point to be at the center of the screen.

What vars do I need to change to be able to attach the focal point to the users mouse cursor?

"The sentinels are approaching Zion!"

Re: depth of field shader

Posted: 03 Mar 2013, 20:21
by Satirik
here it is