xml based postprocessing framework
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
Wow! Thanks! That little detail made it work (using prepare before)
Now it work! Here is the invert filter working at last! Now it's integrated in my current project. Thanks! I'll put your name in the credits.
If this is not added to IRRlicht, it should at least goes into IRRext!
Anybody have a hint how to create a post shader that could draw occluded part of a character over the geometry? I will also have to find out when the character is hidden by something. I was thinking of using the depth buffer as a mask...
Here is an example (taken from Left 4 Dead)
I would like to have the same thing in my current project (IRB), when the character is behind something.
Now it work! Here is the invert filter working at last! Now it's integrated in my current project. Thanks! I'll put your name in the credits.
If this is not added to IRRlicht, it should at least goes into IRRext!
Anybody have a hint how to create a post shader that could draw occluded part of a character over the geometry? I will also have to find out when the character is hidden by something. I was thinking of using the depth buffer as a mask...
Here is an example (taken from Left 4 Dead)
I would like to have the same thing in my current project (IRB), when the character is behind something.
Re: xml based postprocessing framework
i'm getting a wierd issue
1>PostProcessManager.cpp(91): error C2039: 'empty' : is not a member of 'irr::core::string<T>'
1> with
1> [
1> T=wchar_t
1> ]
1>PostProcessMan
when i try to compile the original project
any hint or anything?
1>PostProcessManager.cpp(91): error C2039: 'empty' : is not a member of 'irr::core::string<T>'
1> with
1> [
1> T=wchar_t
1> ]
1>PostProcessMan
when i try to compile the original project
any hint or anything?
Re: xml based postprocessing framework
the empty method is not available in the irrlicht 1.7.2 version, but in the svn trunk.
replace
with
then it should compile with the current 1,7.2 version (the alternative is to compile against the irrlicht development trunk)
hope this will help you
replace
Code: Select all
if (strDummy.emtpty())
Code: Select all
if (strDummy == "")
hope this will help you
Re: xml based postprocessing framework
i switched to the SVN trunk because there were other issues to solve to adapt it to 1.7.2 and while i'm at it it keep my code up to date
but now i have a new issue i tryed to add an aditional test shader but i can't get it to work properly
i added it to Effect.xml and PostProcessManager.h but nothing show up when i try to run it i would at least expect some randoom artifact if my shader code was wrong
do i neet to define aditional RTT in the config file even if the shader should use aux input and ox output?
but now i have a new issue i tryed to add an aditional test shader but i can't get it to work properly
i added it to Effect.xml and PostProcessManager.h but nothing show up when i try to run it i would at least expect some randoom artifact if my shader code was wrong
do i neet to define aditional RTT in the config file even if the shader should use aux input and ox output?
Re: xml based postprocessing framework
Hello Granyte,
if you don't need an additional texture for your shader, there is no need to touch the rtt.xml.
In the effect.xml you must take care that your effect id corresponds to the newly added effect enum.
Please post the effect section of the effect.xml with your new effect. Maybe it helps solving this issue.
Another possibility is that your shader does not compile correctly ...
if you don't need an additional texture for your shader, there is no need to touch the rtt.xml.
In the effect.xml you must take care that your effect id corresponds to the newly added effect enum.
Please post the effect section of the effect.xml with your new effect. Maybe it helps solving this issue.
Another possibility is that your shader does not compile correctly ...
Re: xml based postprocessing framework
Code: Select all
<!-- EPPE_FAKESSAO = 25 -->
<Effect id="24" name="FakeSSAO">
<ShaderPostProcess name="Fakessao" vsFile="vertex.fx" vsType="0" psFile="SSAOish v2.fx" psType="4" >
<PixelShaderConstant name="curve_base" value="-6" />
<Texture index="0" textureClamp="1" />
<RenderSource path="auxIn" />
<RenderTarget path="auxOut" />
</ShaderPostProcess>
</Effect>
Code: Select all
EPPE_DEPTH_OF_FIELD,
EPPE_VIGNETTE,
EPPE_FAKESSAO,
EPPE_COUNT
};
Code: Select all
uniform sampler2D SceneBuffer : register(s0);
uniform int curve_base;
float4 main( float2 texCoord : TEXCOORD0 ) : COLOR
{
float4 Color, Mask, Final;
float lum,dev,curve;
Color = tex2D( SceneBuffer, texCoord );
//calc the luminosity of each pixel, channel independent (gives a grayscale)
lum = ( Color.r + Color.g + Color.b ) / 3;
//curve the colors (use the lum map)
lum = 4 - ( lum * ( 1 / pow( lum, 2 ) ) );
lum = smoothstep(curve_base, 3, lum);
curve = (0.15 * pow(lum,3)) + 0.85;
//curve = 1-curve;
curve += 0.075;
Color = Color * curve;
return Color;
//return (255,50,50,255);
}
the commented return was a desesperate atempt to see some sort of artifact to be sure something was showing up but no avail that to failed
Re: xml based postprocessing framework
Code: Select all
<!-- EPPE_FAKESSAO = 25 -->
<Effect id="24" name="FakeSSAO">
<ShaderPostProcess name="Fakessao" vsFile="vertex.fx" vsType="0" psFile="SSAOish v2.fx" psType="4" >
<PixelShaderConstant name="curve_base" value="-6" />
<Texture index="0" textureClamp="1" />
<RenderSource path="auxIn" />
<RenderTarget path="auxOut" />
</ShaderPostProcess>
</Effect>
Code: Select all
<Effect id="24" name="FakeSSAO">
Code: Select all
<Effect id="25" name="FakeSSAO">
regarding shader constants you have the choice:
Code: Select all
enum E_SHADER_CONSTANT
{
ESC_TIME = 0x1,
ESC_RANDOM = 0x2,
ESC_BUFFERWIDTH = 0x4,
ESC_BUFFERHEIGHT = 0x8,
ESC_PROJECTION = 0x10,
ESC_VIEW = 0x20,
ESC_WORLD = 0x40,
ESC_WORLDVIEW = 0x80,
ESC_WORLDVIEWPROJ = 0x100
};
Code: Select all
<ShaderPostProcess name="Fakessao" vsFile="vertex.fx" vsType="0" psFile="SSAOish v2.fx" psType="4" psUseWorldViewProj="1">
Code: Select all
uniform float4x4 WorldViewProjMatrix;
Re: xml based postprocessing framework
the shader i originaly tryed updating is the one from Xeffect and it really use the viewproj matrix not the world view proj so i tryed passing the view and the proj matrix and combining them but ... fail so i tryed adding the view proj to your code fail to on my side
anyway i now have the fake ssao working and it's a failt to the shader output a white background but that's propably the shader i use i'll get working on it since now it at least work
i can't belive i missed the =24 thanks for that
anyway i now have the fake ssao working and it's a failt to the shader output a white background but that's propably the shader i use i'll get working on it since now it at least work
i can't belive i missed the =24 thanks for that
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
Re: xml based postprocessing framework
Have somebody tested that on OPEN GL with an ATI/intel cards? I was trying my application my Zino HD HTPC (Use a ATI RADEON HD 5450) (I have a NVidia card in my main computer), and I see compilation failing messages for all the shaders... Are the shaders designed only for NVidia? (Most of the compilation failure come back as syntax errors?!)
EDIT: Tested my card with the GPU CAP VIEWER and it report that the card current driver support OPENGL 4.0 and GLSL 4.0. So it should not be a driver issue with open gl.
Have another question, Is there a way to "fade" the shader effect?
EDIT: Tested my card with the GPU CAP VIEWER and it report that the card current driver support OPENGL 4.0 and GLSL 4.0. So it should not be a driver issue with open gl.
Have another question, Is there a way to "fade" the shader effect?
Last edited by christianclavet on Wed Aug 10, 2011 7:41 pm, edited 1 time in total.
Re: xml based postprocessing framework
is there open gl update like there is for directX?
i have the same issue using open GL (running dual 4850 mobility in cfx) but it does not surprise me amd and open GL on windows have never really been friend
i have the same issue using open GL (running dual 4850 mobility in cfx) but it does not surprise me amd and open GL on windows have never really been friend
Re: xml based postprocessing framework
sure you just need to send a "blend" constant to a shader wich receives as input the screenshot before "myShader" is applied and after the "myShader" was applied and then just mix the two inputs according to the blend factor.
This is not the best way for fading displacement shader such as the water shader. In that case you should reduce the strenght of the effect gradually and then remove the post-p effect-
This is not the best way for fading displacement shader such as the water shader. In that case you should reduce the strenght of the effect gradually and then remove the post-p effect-
Re: xml based postprocessing framework
I'm not sure whether this has been discussed before, but a problem (=crash) occurs when
trying to render after some nodes, which had previously been added to the depth pass, have been deleted.
This seems to happen because the nodes had been added to DepthPassNodes by addNodeToDepthPass() and do not get removed from it
when the node is being removed.
This small function fixes the error, it should be called before the remove() function of the node:
trying to render after some nodes, which had previously been added to the depth pass, have been deleted.
This seems to happen because the nodes had been added to DepthPassNodes by addNodeToDepthPass() and do not get removed from it
when the node is being removed.
This small function fixes the error, it should be called before the remove() function of the node:
There might be some faster implementations, though.void CPostProcessManager::removeNodeFromDepthPass(irr::scene::ISceneNode *node)
{
int n=DepthPassNodes.binary_search(node);
if(n!=-1)
DepthPassNodes.erase(n);
};