XEffects - (Indoor Soft-Shadows + Post-Processing)
there are some accuracy problem here. I'm running the demo using Windows XP, with a graphic card nvidia geforce 8800 GTX. the setting for the demo is 4096 pixel shadow map and the filtering at 16PCF.
OpenGL:
DirectX:
OpenGL:
DirectX:
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
Yeah that happens in OpenGL, it is just the shadow on the backside of the mesh. I personally don't think it looks so bad when the image is moving, or if the geometry is not so square (Look at the dwarfs.). It is best remedied by adjusting the lighting to fit the shadow colour on the opposite side of the light, that is probably what's happening in DX as it's lighting model slightly differes from OpenGL.
You can also improve the accuracy by reducing the depth-offset (This is used to cancel out any depth-buffer caused artifacts that occur.). I'll add an adjustable parameter for this in the next release if you really think it's a problem.
Cheers
EDIT:
Ok, to reduce the depth offset do this.
For DX:
Open up ShadowPass2P.hlsl in the shaders folder and change
to
on line 55.
For OpenGL:
Open up ShadowPass2V.glsl in the shaders folder and change
to
on line 23.
That should get rid of most of the problems. Be careful because reducing the depth offset can cause artifacts to appear, a safer way to do this would be reducing the far value and increasing the near value of the shadow camera, so that more depth accuracy is obtained over the length of the frustum.
Cheers
You can also improve the accuracy by reducing the depth-offset (This is used to cancel out any depth-buffer caused artifacts that occur.). I'll add an adjustable parameter for this in the next release if you really think it's a problem.
Cheers
EDIT:
Ok, to reduce the depth offset do this.
For DX:
Open up ShadowPass2P.hlsl in the shaders folder and change
Code: Select all
MVar[0] -= 0.01f;
Code: Select all
MVar[0] -= 0.004f;
For OpenGL:
Open up ShadowPass2V.glsl in the shaders folder and change
Code: Select all
OUT.MVar.x = (OUT.ShadowMapSamplingPos.z / MaxD) - 0.01;
Code: Select all
OUT.MVar.x = (OUT.ShadowMapSamplingPos.z / MaxD) - 0.005;
That should get rid of most of the problems. Be careful because reducing the depth offset can cause artifacts to appear, a safer way to do this would be reducing the far value and increasing the near value of the shadow camera, so that more depth accuracy is obtained over the length of the frustum.
Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
i can't find getVenderInfo
i compile xeffect with irrlicht 1.4.1>CShaderPre.cpp
1>d:\chuck\enigma4d\trunk\xeffect\cshaderpre.cpp(188) : error C2039: 'getVendorInfo' : is not a member of 'irr::video::IVideoDriver'
1> d:\chuck\enigma4d\trunk\sdk\irrlicht\include\ivideodriver.h(76) : see declaration of 'irr::video::IVideoDriver'
It should be in Irrlicht 1.4.1, are your header files up to date? Else you can just comment any lines that use it, it doesn't really have any use atm.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
ShadowMap resolution
over than 512 X512
there is error
but your sample .exe file work well(ShadowMap.exe) over 512
my compile version meet error
[/quote]
over than 512 X512
there is error
why?Error: Tried to set a render target texture which is bigger than the screen.
Error: Tried to set a render target texture which is bigger than the screen.
Error: Tried to set a render target texture which is bigger than the screen.
but your sample .exe file work well(ShadowMap.exe) over 512
my compile version meet error
i complied with svn trunk versionError: Tried to set a render target texture which is bigger than the screen.
[/quote]
Last edited by gbox on Mon Jul 07, 2008 3:58 pm, edited 1 time in total.
Code: Select all
IrrlichtDevice* device = createDevice(dType,dimension2d<s32>(800,600),32);
Code: Select all
//dimension2d<s32> ScreenRTT = (driver->getVendorInfo().equals_ignore_case("NVIDIA Corporation")) ? driver->getScreenSize() : dimension2d<s32>(512,512);
//dimension2d<s32> ScreenRTT = driver->getScreenSize();
dimension2d<s32> ScreenRTT = dimension2d<s32>(512,512);
ex> dimension2d<s32>(1024,1024);
image is low res image
so i can't make hi res shadow like 1024,2048...
This is an Irrlicht limitation, it doesn't allow an RTT size greater than the screen size in D3D mode. It should work in OpenGL unless you have an old ATI card.
My executable is using a patched Irrlicht DLL, to allow for larger RTT sizes in D3D, you can find a patch for this in the Code Snippets forum.
My executable is using a patched Irrlicht DLL, to allow for larger RTT sizes in D3D, you can find a patch for this in the Code Snippets forum.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
So in OpenGL on your 8600GT the console outputs:
That definately shouldn't be happening, I'm sure that message can only be displayed in D3D.
Or is this another problem we are talking about now?
BTW: I like the models made in your game academy, very nice. Reminds me of Tekken
Code: Select all
Error: Tried to set a render target texture which is bigger than the screen.
Or is this another problem we are talking about now?
BTW: I like the models made in your game academy, very nice. Reminds me of Tekken
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
opengl do not outputsBlindSide wrote:So in OpenGL on your 8600GT the console outputs:
That definately shouldn't be happening, I'm sure that message can only be displayed in D3D.Code: Select all
Error: Tried to set a render target texture which is bigger than the screen.
Or is this another problem we are talking about now?
BTW: I like the models made in your game academy, very nice. Reminds me of Tekken
'Error: Tried to set a render target texture which is bigger than the screen.'
message
but result is wrong
[img]
http://www.jga.or.kr/SBoard/PDS/BOARD/d ... gl2048.jpg
[/img]
too bright
depth is not work right
here is my source and binary
http://jga.or.kr/sboard/download.asp? ... ta&idx=89
finnaly i success
i Success DX9 , shadowmap 4096 size
this is screen shot~
http://www.jga.or.kr/SBoard/PDS/BOARD/d ... dx4096.jpg
patched irrlicht engine
http://jga.or.kr/sboard/download.asp?bo ... ata&idx=92
sample code (correct memory rick bug)
http://jga.or.kr/sboard/download.asp?bo ... ata&idx=93
but screen shot so bright? why?
i will more try now
thanks BlindSide
this is screen shot~
http://www.jga.or.kr/SBoard/PDS/BOARD/d ... dx4096.jpg
patched irrlicht engine
http://jga.or.kr/sboard/download.asp?bo ... ata&idx=92
sample code (correct memory rick bug)
http://jga.or.kr/sboard/download.asp?bo ... ata&idx=93
but screen shot so bright? why?
i will more try now
thanks BlindSide
That's because of the bloom effect. Just remove the bloom effect if you don't want it.
Just comment these lines:
It does look brighter than normal though, I wonder why that is...
Just comment these lines:
Code: Select all
effect->addPostProcessingEffectFromFile(core::stringc("shaders/BlurHP") + shaderExt);
effect->addPostProcessingEffectFromFile(core::stringc("shaders/BlurVP") + shaderExt);
effect->addPostProcessingEffectFromFile(core::stringc("shaders/BloomP") + shaderExt);
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
[quote="Virion"]there are some accuracy problem here. I'm running the demo using Windows XP, with a graphic card nvidia geforce 8800 GTX. the setting for the demo is 4096 pixel shadow map and the filtering at 16PCF.
quote]
Hi Virion, I look the picture, I feel that the cube and dwarf are not just right on the ground, there is a small gap between the ground and the cube or dwarf. It looks they fly in the air. May be this is the cause.
quote]
Hi Virion, I look the picture, I feel that the cube and dwarf are not just right on the ground, there is a small gap between the ground and the cube or dwarf. It looks they fly in the air. May be this is the cause.
Code: Select all
3>d:\engine\demod4\vhfos\viet heroes - fight or surrender\cshaderpre.cpp(187) : error C2039: 'getVendorInfo' : is not a member of 'irr::video::IVideoDriver'
3> d:\engine\irrlicht-1.4\include\ivideodriver.h(76) : see declaration of 'irr::video::IVideoDriver'
3>Generating Code...
at
DefineMap[driver->getVendorInfo()] = "";
gbox wrote:i can't find getVenderInfo
i compile xeffect with irrlicht 1.4.1>CShaderPre.cpp
1>d:\chuck\enigma4d\trunk\xeffect\cshaderpre.cpp(188) : error C2039: 'getVendorInfo' : is not a member of 'irr::video::IVideoDriver'
1> d:\chuck\enigma4d\trunk\sdk\irrlicht\include\ivideodriver.h(76) : see declaration of 'irr::video::IVideoDriver'
Project homepage: http://fosp.wordpress.com/
Project Forum URL: http://forum.gamedev.vn/index.php?showforum=74
Project Google Group: http://groups.google.com/group/fosproject
Engine Project: http://code.google.com/p/fosengine/
Project Forum URL: http://forum.gamedev.vn/index.php?showforum=74
Project Google Group: http://groups.google.com/group/fosproject
Engine Project: http://code.google.com/p/fosengine/