I want to share my (from c++ to net) converted version of this
Note: I only converted this code. I used a modified version by polygon9
There is now a wiki page: http://www.ogre3d.org/tikiwiki/Dof+shader+in+Mogre
How to use it:
There are three classes:
DepthOfField - This is the class which controls the dof shader and the underlying compositor script.
Lens - This is a class which makes it easier to control the DeathOfField class (makes it more natural)
dofmanager - This class combines both other classes to an automatic dof shader: create a new instance and set mode=automatic and everything runs out of the box
1. Copy the folder "dof" and its files (in dof.zip) to your media folder
2. Add a reference of the folder "dof" either in code or in the resource file
3. create a dofmanager instance (and set the values you need) or do it by hand with DeathOfField [and Lens]
These are some pictures from the original thread.
The original source is here
Nice would be to create a wiki page related your code.
So people have a better chance to find you useful work - even after month and years.
Ok, it's on my todo list.
Just one question: Where should it be? In the snippet section?
... And good idea.
I would suggest to add it as child to:
Libraries » Alternative Languages » MOGRE » Mogre HOWTO's and Snippets
The page you can create with easy by "add page" from here:
Nice work! But no need to kill the poor field, as it's actually "depth of field" instead of death.
Great work - it's looking really well.
Thank you very much.
Additionally it's nice to see that you added both, C# and VS.
I'm trying to implement DOF with Mogre 1.7.4, but when I try to Render my Scene, I receive this error message:
"The native class that implements Ogre::Renderable isn't a subclass of CLRObject. Cannot create the CLR wrapper object."
Anyone has a sugestion?
- When I implemented DepthOfFieldEffect class, I can't declare RenderTargetListener RenderTargetListener and CompositorInstance.Listener Listener, because I have a compilation error: Cannot declare a variable of static class.
But these 2 variables are not used in this class, so I commented these 2 lines.
- I'm using DX9
- The Ogre.log does not show any error. All shaders are compiling well