Depth of Field demo release
- andrea147
- Deactivated User
- Posts: 1
- Joined: Mon Sep 26, 2011 1:31 pm
Re: Depth of Field demo release
Yes it would be nice if smn do this....
- lordsme
- Gremlin
- Posts: 167
- Joined: Sun Mar 11, 2007 1:11 pm
- Location: Turin, Italy
- x 10
- Contact:
Re: Depth of Field demo release
While writing code to support DoF with multiple cameras, I'm experiencing a problem when I resize my application main viewport with DoF enabled:
cameras lose their correct aspect ratio.
Here's the code line that makes this happen:
Anyone ever experienced anything like this?
cameras lose their correct aspect ratio.
Here's the code line that makes this happen:
Code: Select all
m_pDepthViewport->setCamera(new_camera);
My Portfolio
http://davidedigiannantonio.weebly.com
MESH - Mise-en-scene Helper
http://www.mesh-project.org/
ASALab @ Virtual Reality & Multimedia Park
http://www.vrmmp.it
http://davidedigiannantonio.weebly.com
MESH - Mise-en-scene Helper
http://www.mesh-project.org/
ASALab @ Virtual Reality & Multimedia Park
http://www.vrmmp.it
- lordsme
- Gremlin
- Posts: 167
- Joined: Sun Mar 11, 2007 1:11 pm
- Location: Turin, Italy
- x 10
- Contact:
Re: Depth of Field demo release
It seems that adding this line of code when resizing the main viewport solves the problem:
Code: Select all
m_pDepthViewport->setDimensions(
m_pViewer->getViewport()->getActualLeft()
, m_pViewer->getViewport()->getActualTop()
, m_pViewer->getViewport()->getActualWidth()
, m_pViewer->getViewport()->getActualHeight()
);
My Portfolio
http://davidedigiannantonio.weebly.com
MESH - Mise-en-scene Helper
http://www.mesh-project.org/
ASALab @ Virtual Reality & Multimedia Park
http://www.vrmmp.it
http://davidedigiannantonio.weebly.com
MESH - Mise-en-scene Helper
http://www.mesh-project.org/
ASALab @ Virtual Reality & Multimedia Park
http://www.vrmmp.it
- Tubulii
- Gnoblar
- Posts: 5
- Joined: Tue Jul 19, 2011 11:52 am
Re: Depth of Field demo release
I tried to run the shader but I always get
But
19:32:40: * Supported Shader Profiles: hlsl ps_1_1 ps_1_2 ps_1_3 ps_1_4 ps_2_0 ps_2_a ps_2_b ps_2_x ps_3_0 vs_1_1 vs_2_0 vs_2_a vs_2_x vs_3_0 (Ati radeon 5770)
And
for all parameters. It doesn't matter which CG dof version in this thread i use. It's always the same.
I have read something that parameters are "kicked out" if they seem not to be used. How ever I have no idea how to fix this.
Has anybody an idea? Thanks!
Code: Select all
19:29:09: Attempted to load Cg program 'DoF_DepthVP_cg', but no suported profile was found.
Code: Select all
vertex_program DoF_DepthVP_cg cg
{
source Dof.cg
entry_point DoF_DepthVP_cg
profiles vs_3_0
default_params
{
param_named_auto worldViewProj worldviewproj_matrix
}
}
19:32:40: * Supported Shader Profiles: hlsl ps_1_1 ps_1_2 ps_1_3 ps_1_4 ps_2_0 ps_2_a ps_2_b ps_2_x ps_3_0 vs_1_1 vs_2_0 vs_2_a vs_2_x vs_3_0 (Ati radeon 5770)
And
Code: Select all
19:29:09: OGRE EXCEPTION(2:InvalidParametersException): Parameter called worldViewProj does not exist. in GpuProgramParameters::_findNamedConstantDefinition at ..\src\OgreGpuProgram.cpp (line 1097)
19:29:09: Compiler error: invalid parameters in DoF.material(9): setting of constant failed
I have read something that parameters are "kicked out" if they seem not to be used. How ever I have no idea how to fix this.
Has anybody an idea? Thanks!
- Mind Calamity
- Ogre Magi
- Posts: 1255
- Joined: Sat Dec 25, 2010 2:55 pm
- Location: Macedonia
- x 81
Re: Depth of Field demo release
This works for me, it's a different material, but still contains the world view projection matrix parameter, try it like this:
Just remove the default_params.
Code: Select all
vertex_program_ref outline_vs_cg
{
param_named_auto worldViewProjMatrix worldviewproj_matrix
param_named size_value float 0.2
}
BitBucket username changed to iboshkov (from MindCalamity)
Do you need help? What have you tried?
- xavier
---------------------
HkOgre - a Havok Integration for OGRE | Simple SSAO | My Blog | My YouTube | My DeviantArt
Do you need help? What have you tried?
- xavier
---------------------
HkOgre - a Havok Integration for OGRE | Simple SSAO | My Blog | My YouTube | My DeviantArt
- Tubulii
- Gnoblar
- Posts: 5
- Joined: Tue Jul 19, 2011 11:52 am
Re: Depth of Field demo release
Mm, interesting, removing default_params worked but I am still geting this:
I think this means that,
profile vs_3_0 is not supported by my graphics card but why the log says:
Does this mean only hlsl shader vs_3_0 is supported by my ati 5770? The manual says "Cg (3.1.5 Cg programs) (an API- and card-independent, high-level language which lets you write programs for both OpenGL and DirectX for lots of cards)"
Now i am confused...
Edit: I did a fresh restart and with version 1.7.3 it seems to run fine, out of the box. I will now compare the working example with my other project. I hope it is only a typo or a missing file... nevertheless thank you!
Code: Select all
Attempted to load Cg program 'DoF_DepthOfFieldFP_cg', but no suported profile was found.
profile vs_3_0 is not supported by my graphics card but why the log says:
Code: Select all
Supported Shader Profiles: hlsl (...) ps_3_0 (...) vs_3_0
Now i am confused...
Edit: I did a fresh restart and with version 1.7.3 it seems to run fine, out of the box. I will now compare the working example with my other project. I hope it is only a typo or a missing file... nevertheless thank you!
- Mind Calamity
- Ogre Magi
- Posts: 1255
- Joined: Sat Dec 25, 2010 2:55 pm
- Location: Macedonia
- x 81
Re: Depth of Field demo release
Check your plugins.cfg file, see if it contains this line: Plugin=Plugin_CgProgramManager, I think that's what fixed it for me last time...
BitBucket username changed to iboshkov (from MindCalamity)
Do you need help? What have you tried?
- xavier
---------------------
HkOgre - a Havok Integration for OGRE | Simple SSAO | My Blog | My YouTube | My DeviantArt
Do you need help? What have you tried?
- xavier
---------------------
HkOgre - a Havok Integration for OGRE | Simple SSAO | My Blog | My YouTube | My DeviantArt
- Tubulii
- Gnoblar
- Posts: 5
- Joined: Tue Jul 19, 2011 11:52 am
Re: Depth of Field demo release
And if cg.dll is copied into the right folder: i think that was my mistake. Thanks again.Mind Calamity wrote:Check your plugins.cfg file, see if it contains this line: Plugin=Plugin_CgProgramManager, I think that's what fixed it for me last time...
- Mind Calamity
- Ogre Magi
- Posts: 1255
- Joined: Sat Dec 25, 2010 2:55 pm
- Location: Macedonia
- x 81
Re: Depth of Field demo release
Yupp, cg.dll has to be in the same folder as the Cg plugin.
BitBucket username changed to iboshkov (from MindCalamity)
Do you need help? What have you tried?
- xavier
---------------------
HkOgre - a Havok Integration for OGRE | Simple SSAO | My Blog | My YouTube | My DeviantArt
Do you need help? What have you tried?
- xavier
---------------------
HkOgre - a Havok Integration for OGRE | Simple SSAO | My Blog | My YouTube | My DeviantArt
- Beauty
- OGRE Community Helper
- Posts: 767
- Joined: Wed Oct 10, 2007 2:36 pm
- Location: Germany
- x 39
- Contact:
Re: Depth of Field demo release
I just want to mention that Mr. Tubulii created a C# port of this code for usage with Mogre and .NET.
Details are here:
http://www.ogre3d.org/addonforums/viewt ... =8&t=15042
Thanks to all people who helped to develop and improve the DepthOfField code.
Details are here:
http://www.ogre3d.org/addonforums/viewt ... =8&t=15042
Thanks to all people who helped to develop and improve the DepthOfField code.
Help to add information to the wiki. Also tiny edits will let it grow ...
Add your country to your profile ... it's interesting to know from where of the world you are.
Add your country to your profile ... it's interesting to know from where of the world you are.
- Beauty
- OGRE Community Helper
- Posts: 767
- Joined: Wed Oct 10, 2007 2:36 pm
- Location: Germany
- x 39
- Contact:
Re: Depth of Field demo release
On yesterday I motivated Tubulii to create a wiki page for the Mogre port.
Today he created a sweet page for Mogre DOF.
Thanks !!
Look here:
http://www.ogre3d.org/tikiwiki/Dof+shader+in+Mogre
Today he created a sweet page for Mogre DOF.
Thanks !!
Look here:
http://www.ogre3d.org/tikiwiki/Dof+shader+in+Mogre
Help to add information to the wiki. Also tiny edits will let it grow ...
Add your country to your profile ... it's interesting to know from where of the world you are.
Add your country to your profile ... it's interesting to know from where of the world you are.
-
- Gnoblar
- Posts: 16
- Joined: Sun Dec 18, 2011 11:13 pm
Re: Depth of Field demo release
Hi,
I have a problem with implementing DOF to my project. I have added correct Lens and DepthOfFieldEffect classes to the project and additionally created a class that is called Realistic Camera. From there i try to create an instance of both DepthOfFieldEffect and Lens, but I get:
C:\Users\Ryba\Documents\QtOgre-build\..\QtOgre\source\RealisticCamera.cpp:41: błąd:C2259: 'DepthOfFieldEffect' : cannot instantiate abstract class
due to following members:
'bool Ogre::RenderQueue::RenderableListener::renderableQueued(Ogre::Renderable *,Ogre::uint8,Ogre::ushort,Ogre::Technique **,Ogre::RenderQueue *)' : is abstract
This is akward, because every project I have seen uses this class like that. What can be the problem?
I have a problem with implementing DOF to my project. I have added correct Lens and DepthOfFieldEffect classes to the project and additionally created a class that is called Realistic Camera. From there i try to create an instance of both DepthOfFieldEffect and Lens, but I get:
C:\Users\Ryba\Documents\QtOgre-build\..\QtOgre\source\RealisticCamera.cpp:41: błąd:C2259: 'DepthOfFieldEffect' : cannot instantiate abstract class
due to following members:
'bool Ogre::RenderQueue::RenderableListener::renderableQueued(Ogre::Renderable *,Ogre::uint8,Ogre::ushort,Ogre::Technique **,Ogre::RenderQueue *)' : is abstract
This is akward, because every project I have seen uses this class like that. What can be the problem?
-
- Greenskin
- Posts: 100
- Joined: Tue Aug 01, 2006 6:50 am
- Location: Canada
- x 6
- Contact:
Re: Depth of Field demo release
This is a common programming error unrelated to the DoF release. In plain English the error means the class called DepthOfFieldEffect has not been fully defined.C:\Users\Ryba\Documents\QtOgre-build\..\QtOgre\source\RealisticCamera.cpp:41: błąd:C2259: 'DepthOfFieldEffect' : cannot instantiate abstract class
due to following members:
'bool Ogre::RenderQueue::RenderableListener::renderableQueued(Ogre::Renderable *,Ogre::uint8,Ogre::ushort,Ogre::Technique **,Ogre::RenderQueue *)' : is abstract
This class inherits from RenderableListener and the RenderableListener class defines a set of pure virtual methods (they start with the keyword virtual and end with '= 0;' ). When ever you inherit from a class with pure virtual members you _must_ provide a definition for them- or you get this error.
I suggest reading up on C++ object oriented programming, it will make your programming life much easier
Edit:
To fix:
In DepthOfField.h
Code: Select all
virtual bool renderableQueued(Renderable* rend, Ogre::uint8 groupID, Ogre::ushort priority, Technique** ppTech, RenderQueue* pQueue);
Code: Select all
bool DepthOfFieldEffect::renderableQueued(Renderable* rend, Ogre::uint8 groupID, Ogre::ushort priority, Technique** ppTech, RenderQueue* pQueue)
{
// Replace the technique of all renderables
*ppTech = mDepthTechnique;
return true;
}
-
- Gnoblar
- Posts: 16
- Joined: Sun Dec 18, 2011 11:13 pm
Re: Depth of Field demo release
I knew what were virtual functions, I just didn't realise that the actual implemention of it changed. Thanks a lot
Now I have another akward problem. The whole script runs, I can succesfully modify the lenses parameters. However no matter what I choose, the image with DOF effect is always blurred. It is visible in the image below:
In the log displayed on the right it is visible, that initial focus distance was 300 and it was modified using a ray cast to set it properly (all valuesa are in millimeters). However even after recalculation of dofParams, the effect stays the same.
What could cause the problem?
Now I have another akward problem. The whole script runs, I can succesfully modify the lenses parameters. However no matter what I choose, the image with DOF effect is always blurred. It is visible in the image below:
In the log displayed on the right it is visible, that initial focus distance was 300 and it was modified using a ray cast to set it properly (all valuesa are in millimeters). However even after recalculation of dofParams, the effect stays the same.
What could cause the problem?
-
- Gnoblar
- Posts: 2
- Joined: Tue Jan 22, 2013 10:54 am
Re: Depth of Field demo release
Hi all,
Im a noobie. Trying to get this to work on a dual screen system and all seems to work up until the point it calls the previewport function after I create a new DepthOfFieldEffect class.
Thanks
Im a noobie. Trying to get this to work on a dual screen system and all seems to work up until the point it calls the previewport function after I create a new DepthOfFieldEffect class.
It basically hits the assert() in the function. Can anyone help please?D3D9RenderWindow* D3D9Device::getPrimaryWindow()
{
RenderWindowToResorucesIterator it = mMapRenderWindowToResoruces.begin();
while (it != mMapRenderWindowToResoruces.end() && it->second->presentParametersIndex != 0)
++it;
assert(it != mMapRenderWindowToResoruces.end());
return it->first;
}
Thanks
-
- Gnoblar
- Posts: 2
- Joined: Tue Jan 22, 2013 10:54 am
Re: Depth of Field demo release
Is there not simple plugin that works with 1.7.4+ for GL/DX C++? I don't know that's why I'm asking; If I'm being too presumptious please let me know. I just don't know if one exists.
Many Thanks in advance.
Many Thanks in advance.