Page 10 of 12

Posted: Sat Jun 28, 2008 7:36 am
by 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.

OpenGL:

Image

Image

DirectX:

Image

Posted: Sat Jun 28, 2008 2:02 pm
by BlindSide
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

Code: Select all

MVar[0] -= 0.01f;
to

Code: Select all

MVar[0] -= 0.004f;
on line 55.

For OpenGL:
Open up ShadowPass2V.glsl in the shaders folder and change

Code: Select all

OUT.MVar.x = (OUT.ShadowMapSamplingPos.z / MaxD) - 0.01;
to

Code: Select all

OUT.MVar.x = (OUT.ShadowMapSamplingPos.z / MaxD) - 0.005;
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

Posted: Mon Jul 07, 2008 5:43 am
by gbox
i can't find getVenderInfo

>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'
i compile xeffect with irrlicht 1.4.1

Posted: Mon Jul 07, 2008 11:18 am
by BlindSide
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.

Posted: Mon Jul 07, 2008 12:24 pm
by gbox
ShadowMap resolution
over than 512 X512

there is error
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.
why?

but your sample .exe file work well(ShadowMap.exe) over 512


my compile version meet error
Error: Tried to set a render target texture which is bigger than the screen.
i complied with svn trunk version
[/quote]

Posted: Mon Jul 07, 2008 12:50 pm
by gbox

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);

i cant make over 512
ex> dimension2d<s32>(1024,1024);
image is low res image :cry:

so i can't make hi res shadow like 1024,2048...

Posted: Mon Jul 07, 2008 9:13 pm
by BlindSide
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.

Posted: Mon Jul 07, 2008 10:06 pm
by hybrid
The ATI FBO patch is now also in SVN trunk. so it's just the d3d patch whih is missing.

Posted: Tue Jul 08, 2008 12:40 am
by gbox
thanks for answer!

but opengl make wrong scene too(i have gforce 8600gt)

i will try patch!!

Posted: Tue Jul 08, 2008 4:52 am
by BlindSide
So in OpenGL on your 8600GT the console outputs:

Code: Select all

Error: Tried to set a render target texture which is bigger than the screen. 
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 8)

Posted: Tue Jul 08, 2008 5:38 am
by gbox
BlindSide wrote:So in OpenGL on your 8600GT the console outputs:

Code: Select all

Error: Tried to set a render target texture which is bigger than the screen. 
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 8)
opengl do not outputs
'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

Posted: Tue Jul 08, 2008 7:13 am
by gbox
i Success DX9 , shadowmap 4096 size :D

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 :evil:

thanks BlindSide

Posted: Tue Jul 08, 2008 11:14 am
by BlindSide
That's because of the bloom effect. Just remove the bloom effect if you don't want it.

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);
It does look brighter than normal though, I wonder why that is...

Posted: Thu Jul 10, 2008 2:31 am
by wuallen
[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.

Posted: Thu Jul 10, 2008 9:36 am
by doqkhanh

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...
I don't know why, but my compiler has same error

at
DefineMap[driver->getVendorInfo()] = "";
gbox wrote:i can't find getVenderInfo

>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'
i compile xeffect with irrlicht 1.4.1