xml based postprocessing framework
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
Re: xml based postprocessing framework
Hi,
I can confirm that the current GLSL shaders ARE NOT compatible with ATI hardware as they contain syntax errors (NVidia video cards seem to forgive a lot!)
I found a shader debugger and was able to fix all of the GLSL shaders syntax so they work correctly. (They should all work now). I tested some of them on my main rig (NVidia) and my HTPC (Radeon HD 5950) and now the HTPC doesnt give any error and the shaders I tested worked.
Here is a link to the corrected shaders, just replace the ones you have with theses ones and it should work on both platforms now.
http://www.clavet.org/files/download/glsl_fix.zip 32.8kb
I will try to check the HLSL shaders and see if they compile (our project don't use DX but OpenGL). Since the shader debugger can also work with HLSL files, I could try to fix the errors.
EDIT: Tested all the HLSL shader for a ATI/AMD radeon card with only support PS2/VS2 and all shader compiled. So I think for the DX side it ok.
Can someone that have the same problem with the GLSL shaders with ATI/AMD videocard hardware confirm that with this it work on their end?
I can confirm that the current GLSL shaders ARE NOT compatible with ATI hardware as they contain syntax errors (NVidia video cards seem to forgive a lot!)
I found a shader debugger and was able to fix all of the GLSL shaders syntax so they work correctly. (They should all work now). I tested some of them on my main rig (NVidia) and my HTPC (Radeon HD 5950) and now the HTPC doesnt give any error and the shaders I tested worked.
Here is a link to the corrected shaders, just replace the ones you have with theses ones and it should work on both platforms now.
http://www.clavet.org/files/download/glsl_fix.zip 32.8kb
I will try to check the HLSL shaders and see if they compile (our project don't use DX but OpenGL). Since the shader debugger can also work with HLSL files, I could try to fix the errors.
EDIT: Tested all the HLSL shader for a ATI/AMD radeon card with only support PS2/VS2 and all shader compiled. So I think for the DX side it ok.
Can someone that have the same problem with the GLSL shaders with ATI/AMD videocard hardware confirm that with this it work on their end?
Re: xml based postprocessing framework
i'll give it a go when i will get around fixing my project that use it
Re: xml based postprocessing framework
I had a deeper look into the performance.
As always when renering to rtt antialiasing is a painful issue.
In my original framework I rendered into a rtt which was scaled twice the screensize
downscaling2x2 in the finalpass leads to an acceptable antialiasing effect (at the cost of framerate).
Now I experimented with the fxaa algorithm designed by Timothy Lottes (http://timothylottes.blogspot.com/2011/ ... eased.html).
I included it into the framework and it gave me a significant boost in terms of framerate.
rtt.xml now look like this:
You can find the project here
http://www.mediafire.com/?9g9cr1n75364zr5.
with the fixed glsl code by christianclavet (big thank you for this!!! )
I made some minor changes to the code. (final pass is now a pp in the effect.xml)
DirectX with hlsl works fine but unfortunately I didn't get it to work with openl. Maybe somone of you has got an idea...
As always when renering to rtt antialiasing is a painful issue.
In my original framework I rendered into a rtt which was scaled twice the screensize
Code: Select all
<!-- default auxiliary buffers (auxIn, auxOut and rttDepth)-->
<RenderTarget id="auxIn" colorFormat="10" scale="2.0" />
<RenderTarget id="auxOut" colorFormat="10" scale="2.0" />
Now I experimented with the fxaa algorithm designed by Timothy Lottes (http://timothylottes.blogspot.com/2011/ ... eased.html).
I included it into the framework and it gave me a significant boost in terms of framerate.
rtt.xml now look like this:
Code: Select all
<!-- default auxiliary buffers (auxIn, auxOut and rttDepth)-->
<RenderTarget id="auxIn" colorFormat="10" scale="1.0" />
<RenderTarget id="auxOut" colorFormat="10" scale="1.0" />
http://www.mediafire.com/?9g9cr1n75364zr5.
with the fixed glsl code by christianclavet (big thank you for this!!! )
I made some minor changes to the code. (final pass is now a pp in the effect.xml)
DirectX with hlsl works fine but unfortunately I didn't get it to work with openl. Maybe somone of you has got an idea...
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
Re: xml based postprocessing framework
Is the FXAA algorithm is a postprocess shader that you added to the framework?
Re: xml based postprocessing framework
yes, in the download I included the fxaa.h (located in the shader dir)
I added another effect
and the update method now looks like this
also I modified the screenquad.fx
I added another effect
Code: Select all
<!-- EPPE_FINAL_PASS = 25 -->
<Effect id="25" name="Render To Screen">
<ShaderPostProcess name="FinalPass" vsFile="vertex.fx" vsType="1" psFile="screenquad.fx" psType="7" psEntry="finalPassFXAA" psUseBufferWidth="1" psUseBufferHeight="1">
<Texture index="0" textureClamp="1" />
<RenderSource path="auxIn" />
<RenderTarget path="" />
</ShaderPostProcess>
</Effect>
Code: Select all
void CPostProcessManager::update()
{
// render the final pass
render(EPPE_FINAL_PASS);
}
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
Re: xml based postprocessing framework
Hi, Just checked about this. This is really fast. I did not see a drop in FPS while it was used (hlsl)
You could check this for the GLSL shader. They were able to make it work, perhap their shader code would help. I've also read that the FXAA was developped by NVIDIA but it can run on ATI hardware.
http://www.geeks3d.com/20110405/fxaa-fa ... geforce/3/
You could check this for the GLSL shader. They were able to make it work, perhap their shader code would help. I've also read that the FXAA was developped by NVIDIA but it can run on ATI hardware.
http://www.geeks3d.com/20110405/fxaa-fa ... geforce/3/
Re: xml based postprocessing framework
Hi Christian,
I will will ceck this out immediataly...
I will will ceck this out immediataly...
Re: xml based postprocessing framework
For the DOF, how do you control the focal depth? In the PostProcessManager, I tried playing with this a bit
DepthMaterial->setVertexShaderConstant("DistanceScale", 0.0006f);
but the results were not stunning. For larger values everything is blurred. A range of -0.0002 to 0.0002 seems fine for distance scale. Is there another value that I should be modifying instead?
DepthMaterial->setVertexShaderConstant("DistanceScale", 0.0006f);
but the results were not stunning. For larger values everything is blurred. A range of -0.0002 to 0.0002 seems fine for distance scale. Is there another value that I should be modifying instead?
Re: xml based postprocessing framework
hey i've been looking deep in your code searching for a screenquad exemple and i noted something is it me or you create and destroy a screen quad for every effect every frame?
Re: xml based postprocessing framework
I'm unsure about if this is my fault or well, what it could be...
Anyhow, the problem I am having is that whenever I try to include this into my project I get the following error:
Unsure of why this could be :/ I am trying to run this on mingw on Code::Blocks... Any ideas?
Anyhow, the problem I am having is that whenever I try to include this into my project I get the following error:
Code: Select all
C:\Users\Kristoffer\Desktop\ChannelIrrlicht\include\irrMap.h|488|error: non-static reference member 'irr::core::map<irr::core::string<wchar_t, irr::core::irrAllocator<wchar_t> >, irr::video::ITexture*>& irr::core::map<irr::core::string<wchar_t, irr::core::irrAllocator<wchar_t> >, irr::video::ITexture*>::AccessClass::Tree', can't use default assignment operator|
Re: xml based postprocessing framework
Hi Granyte
The render function uses this screenquad.
This means:
Every Effect has got its own screenquad (oncly created in the constructor) an the screenquad is reused in every frame.
Hope this helps.
Every Effect is basically derived from IPostProcess. IPostProcess itself owns a screenquad.hey i've been looking deep in your code searching for a screenquad exemple and i noted something is it me or you create and destroy a screen quad for every effect every frame?
Code: Select all
// screend quad mesh
video::S3DVertex Vertices[4];
u16 Indices[6];
Code: Select all
void CShaderPostProcess::render()
{
// clear the projection matrix
Engine->getVideo()->setTransform(video::ETS_PROJECTION, core::IdentityMatrix);
// clear the view matrix
Engine->getVideo()->setTransform(video::ETS_VIEW, core::IdentityMatrix);
// set the transform
Engine->getVideo()->setTransform(video::ETS_WORLD, core::IdentityMatrix );
// select the post proccess material
Engine->getVideo()->setMaterial(getMaterial());
// render the screen quad
Engine->getVideo()->drawIndexedTriangleList(Vertices, 4, Indices, 2);
}
Every Effect has got its own screenquad (oncly created in the constructor) an the screenquad is reused in every frame.
Hope this helps.
Re: xml based postprocessing framework
nice well i ended up using the sceen quad exemple from an other post processing exemple cause all i suceded was getting more and more lost lol
anyway thanks for explaining
anyway thanks for explaining
Re: xml based postprocessing framework
Hi Justei,
Perhaps changing the definition of the RenderTargetMap could help
In PostProcessManager.h change
to
I could not evaluate it, because I don't have a testbed for mingw/CodeBlocks ...
I don't know exactly, but I guess this could be a const issue.I'm unsure about if this is my fault or well, what it could be...
Anyhow, the problem I am having is that whenever I try to include this into my project I get the following error: .....
Perhaps changing the definition of the RenderTargetMap could help
In PostProcessManager.h change
Code: Select all
// additional render target textures (defined in rtt.xml)
core::map<core::stringw, video::ITexture*> RenderTargetMap;
Code: Select all
// additional render target textures (defined in rtt.xml)
core::map<const core::stringw, video::ITexture*> RenderTargetMap;
Re: xml based postprocessing framework
Didn't seem to change anything unfortunately :/. Any other ideas xD?tbw wrote:Hi Justei,
I don't know exactly, but I guess this could be a const issue.I'm unsure about if this is my fault or well, what it could be...
Anyhow, the problem I am having is that whenever I try to include this into my project I get the following error: .....
Perhaps changing the definition of the RenderTargetMap could help
In PostProcessManager.h changetoCode: Select all
// additional render target textures (defined in rtt.xml) core::map<core::stringw, video::ITexture*> RenderTargetMap;
I could not evaluate it, because I don't have a testbed for mingw/CodeBlocks ...Code: Select all
// additional render target textures (defined in rtt.xml) core::map<const core::stringw, video::ITexture*> RenderTargetMap;
-
- Posts: 1010
- Joined: Mon Oct 24, 2011 10:03 pm
- Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d
Re: xml based postprocessing framework
nice, but what about stability and/or bugs. is it fully tested (Even all obscure shader combinations)?
I will download it, because it is awesome.
I will download it, because it is awesome.
"this is not the bottleneck you are looking for"