Jump to content

DOF Settings


wmaass
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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)

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

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++.

Link to comment
Share on other sites

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);

Link to comment
Share on other sites

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...

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

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?

 

fardof227.jpg

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

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() ;
}

Link to comment
Share on other sites

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

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

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.

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

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...