wmaass Posted December 8, 2009 Share Posted December 8, 2009 Playing with DOF settings with FrameWerk. I can't seem to find settings that are satisfactory. For example the settings found in the tutorial (that does not use FrameWerk) produce en entirely blurry image. fw.GetRenderer().SetNearDOF(true); fw.GetRenderer().SetFarDOF(true); fw.GetRenderer().SetNearDOFRange(Vec2(10,15)); fw.GetRenderer().SetFarDOFRange(Vec2(25,30)); Anybody have any experience with this? I want near objects to be in focus. Quote Link to comment Share on other sites More sharing options...
Scott Richmond Posted December 8, 2009 Share Posted December 8, 2009 You might want to take a look at the DoF video Josh made on his blog/the wiki. Quote Programmer, Modeller Intel Core i7 930 @ 3.5GHz | GeForce 480 GTX | 6GB DDR3 RAM | Windows 7 Premium x64 Visual Studio 2008 | Photoshop CS3 | Maya 2009 Website: http://srichnet.info Link to comment Share on other sites More sharing options...
macklebee Posted December 8, 2009 Share Posted December 8, 2009 Playing with DOF settings with FrameWerk. I can't seem to find settings that are satisfactory. For example the settings found in the tutorial (that does not use FrameWerk) produce en entirely blurry image. fw.GetRenderer().SetNearDOF(true); fw.GetRenderer().SetFarDOF(true); fw.GetRenderer().SetNearDOFRange(Vec2(10,15)); fw.GetRenderer().SetFarDOFRange(Vec2(25,30)); Anybody have any experience with this? I want near objects to be in focus. To keep the near objects in focus, you want to set the FarDOF to make things in the background blurry, so: fw.GetRenderer().SetFarDOF(true); fw.GetRenderer().SetFarDOFRange(Vec2(5,8)); fw.GetRenderer().SetFarDOFStrength(1.0); This will make anything past the starting point of 5 meters from the camera blurry... its hard to tell if the ending range makes much differences other than it obviously needs to be a higher number than the starting range. I assume it does a gradient of blurring between the two ranges. The strength is what is crucial and sets the amount of blur, where it appears 1.0 is the highest value and 0.0 is the lowest. ***Edit-- wmaass, are you using bmax? If so the commands you need are: fw.Renderer.SetFarDOF(1) fw.Renderer.SetFarDOFRange(Vec2(5,8)) fw.Renderer.SetFarDOFStrength(1.0) Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
wmaass Posted December 9, 2009 Author Share Posted December 9, 2009 To keep the near objects in focus, you want to set the FarDOF to make things in the background blurry, so: fw.GetRenderer().SetFarDOF(true); fw.GetRenderer().SetFarDOFRange(Vec2(5,8)); fw.GetRenderer().SetFarDOFStrength(1.0); This will make anything past the starting point of 5 meters from the camera blurry... its hard to tell if the ending range makes much differences other than it obviously needs to be a higher number than the starting range. I assume it does a gradient of blurring between the two ranges. The strength is what is crucial and sets the amount of blur, where it appears 1.0 is the highest value and 0.0 is the lowest. ***Edit-- wmaass, are you using bmax? If so the commands you need are: fw.Renderer.SetFarDOF(1) fw.Renderer.SetFarDOFRange(Vec2(5,8)) fw.Renderer.SetFarDOFStrength(1.0) Thanks guys for setting me straight. Macklebee, I normally use BMax but for this project I am using c++. Quote Link to comment Share on other sites More sharing options...
wmaass Posted December 9, 2009 Author Share Posted December 9, 2009 Hmm, still getting poopy results. The best I can do is lower the strength. Here are some shots at various settings. Quote Link to comment Share on other sites More sharing options...
macklebee Posted December 9, 2009 Share Posted December 9, 2009 are you still setting your nearDOF as well? if you are, don't. here's what i get with a range set at 5,8 and the strength at 1 Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
wmaass Posted December 9, 2009 Author Share Posted December 9, 2009 That is what I am looking for, not getting it though. I'm only using farDOF and I should mention this is 2.27. I have 2.3, just have not bothered to update this project to it. fw.GetRenderer().SetFarDOF(true); fw.GetRenderer().SetFarDOFRange(Vec2(5,8)); fw.GetRenderer().SetFarDOFStrength(1.0); Quote Link to comment Share on other sites More sharing options...
macklebee Posted December 9, 2009 Share Posted December 9, 2009 That is what I am looking for, not getting it though. I'm only using farDOF and I should mention this is 2.27. I have 2.3, just have not bothered to update this project to it. fw.GetRenderer().SetFarDOF(true); fw.GetRenderer().SetFarDOFRange(Vec2(5,8)); fw.GetRenderer().SetFarDOFStrength(1.0); actually that example is from 2.28 and its bmax... i will try the 2.27 and see if that makes any difference for me... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
macklebee Posted December 9, 2009 Share Posted December 9, 2009 here's 2.27 with the same settings... its working fine for me in bmax... it really looks like the neardof is on in your screenshots... or are you sure you are actually close enough to the tree so parts of it are closer than the start value for the farDOFrange? Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
wmaass Posted December 9, 2009 Author Share Posted December 9, 2009 I must be doing something wrong. I might try BMax. I took the nearDOF stuff out. I can try a simpler app, this one has a bunch of other non-LE related code in it. I'm right on top of the tree in this shot. Quote Link to comment Share on other sites More sharing options...
wmaass Posted December 9, 2009 Author Share Posted December 9, 2009 Here is the image. Quote Link to comment Share on other sites More sharing options...
macklebee Posted December 9, 2009 Share Posted December 9, 2009 Here is the image. huh... thats really weird... maybe something else is conflicting? or its a problem in C++? any way you can try a simplified example in C++ and bmax to determine if its language related? Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
wmaass Posted December 9, 2009 Author Share Posted December 9, 2009 Here is simplified version using c++. Thanks for your help by the way. #include "framewerk.h" #include "ProcessScene.h" using namespace leadwerks; int main( int argn, char* argv[] ) { Initialize() ; TMesh mesh; TLight light; TMaterial material; RegisterAbstractPath("C:/Program Files/Leadwerks Engine SDK"); Graphics(800,600); Framewerk fw; if( !fw.Create() ) { MessageBoxA(0,"Failed to initialize engine.",NULL,0); //return 1; } fw.GetRenderer().SetSkybox( LoadMaterial("abstract::FullskiesBlueClear0016_2_L.mat") ); fw.GetRenderer().SetSSAO( true ); fw.GetRenderer().SetGodRays(true); fw.GetRenderer().SetBloom(true); fw.GetRenderer().SetHDR(true); fw.GetRenderer().SetAntialias(false); fw.GetRenderer().SetWater(true); fw.GetRenderer().SetWaterHeight(1.0); fw.GetRenderer().SetWaterSoftness(0.8); fw.GetRenderer().SetWaterAmplitude(2.1); fw.GetRenderer().SetDistanceFog(true); fw.GetRenderer().SetDistanceFogColor(Vec4(1,1,1,0.7)); fw.GetRenderer().SetDistanceFogRange(Vec2(10,75)); fw.GetRenderer().SetFarDOF(true); fw.GetRenderer().SetFarDOFRange(Vec2(5,8)); fw.GetRenderer().SetFarDOFStrength(1.0); material = LoadMaterial("abstract::cobblestones.mat"); mesh = CreateCube(); PaintEntity( mesh, material ); PositionEntity(mesh,Vec3(0.0f,2.0f,0.0f)); light = CreateDirectionalLight(); RotateEntity( light, Vec3(45) ); PositionEntity( fw.GetMain().GetCamera(), Vec3(0,2,-1.5) ); // Game loop while( !KeyHit() && !AppTerminate() ) { if( !AppSuspended() ) // We are not in focus! { TurnEntity( mesh, Vec3(AppSpeed()*0.5f) ); fw.Update(); fw.Render(); // Send to screen Flip(0) ; } } // Done return Terminate() ; } Quote Link to comment Share on other sites More sharing options...
macklebee Posted December 9, 2009 Share Posted December 9, 2009 turn off all of your other postprocessing like bloom, ssao, hdr, distancefog... and see what you get... if its good turn one back on at a time and see what happens actually i would still load your scene... a stationary camera looking at one cube will make it hard to see DOF Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
wmaass Posted December 9, 2009 Author Share Posted December 9, 2009 You got it, it was the HDR borking it. Check it out now. Thanks! Quote Link to comment Share on other sites More sharing options...
macklebee Posted December 9, 2009 Share Posted December 9, 2009 hey that looks nice... weird. it seems maybe there is an issue with c++'s hdr? I don't have that problem in bmax... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Marleys Ghost Posted December 9, 2009 Share Posted December 9, 2009 hey that looks nice... weird. it seems maybe there is an issue with c++'s hdr? I don't have that problem in bmax... I have the same problem with C++, HDR effects the DOF, but no problems with it in Bmax. Quote 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 More sharing options...
wmaass Posted December 9, 2009 Author Share Posted December 9, 2009 I have the same problem with C++, HDR effects the DOF, but no problems with it in Bmax. Interesting. Must be something different between the versions of Framewerk. Quote Link to comment Share on other sites More sharing options...
DaDonik Posted December 11, 2009 Share Posted December 11, 2009 I also have this problem in C++. Looks like it's an Framewerk issue, when it works in BMax. Quote (Win7 64bit) && (i7 3770K @ 3,5ghz) && (16gb DDR3 @ 1600mhz) && (Geforce660TI) Link to comment Share on other sites More sharing options...
Recommended Posts
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.