Page 2 of 2

Posted: Wed Jul 18, 2007 2:45 pm
by afecelis
Looks impressive blindside! however I got errors when running it so I decided to build the example you're including, but it´s missing the following header:
"shadowWrapper.h"
Could you please upload it ;)

regards,
Alvaro

Posted: Thu Jul 19, 2007 7:27 am
by BlindSide
Woops, this is a small mistake. Simply change the "shadowWrapper.h" to "effectWrapper.h" in the file, as I changed the name halfway through but forgot to change it in the source! :oops:

(It should be fixed in the new one but maybe I forgot to change something in the example code.)

PS: You say you got an error running the binary? Please tell me what kind of error and also your graphics card/operating system.

Cheers

Posted: Sun Jul 22, 2007 10:50 pm
by afecelis
Thanks for replying!

I'll rename it and see what happens, but I'll also redownload the latest version. Thanks a bunch.

I got the error trying to run on an Nvidia Geforce FX5900 ultra 256 mb, so perhaps it doesn't support your shader version. Will try on the other PC with a 6800 GT 256 Mb. They say it's the minimum to run this sort of apps ;)

cheers!

Posted: Sun Jul 22, 2007 11:30 pm
by hybrid
I'm quite busy these days, but I'll have a look at this stuff maybe next weekend - I'm really interested in this stuff. What a pity that there are so much other things that are bothering me right now. :(

Posted: Mon Jul 23, 2007 1:04 am
by afecelis
@Blindside: indeed it was the video card. Runs great (115-120fps) on the 6800 GT. Cool work!
And the app now compiles just fine, after renaming the header file.

Gotta start checking those shaders! (and finally find the time to learn-understand them!) ;)

thanks a lot. :D

regards,
Alvaro

Posted: Fri Jul 27, 2007 10:41 am
by BlindSide
To fix the 16 bit issue, open up the desirted shader and change

Code: Select all

OUT.RealDistance[0] = (SMPos.z/MaxD) - 0.01f;
to

Code: Select all

OUT.RealDistance[0] = (SMPos.z/MaxD) - 0.03f;
This will increase the offset to subtract from the depth buffer in order to reduce artifacts due to depth inaccuracy.

Also you can change all the "tex2D( ShadowMapSampler,ShadowMapSamplingPos ).x" to "tex2D( ShadowMapSampler,ShadowMapSamplingPos ).y" so that it reads from the Green component, which should give you 6 bits instead of 5 in 16 bit mode.

Subtracting from the depth buffer causes more of the shadow to get cut off under sydney's feet, so maybe setting it up so it only loads the 16 bit one under 16 bit mode is best. (Shouldn't be hard to modify the wrapper to do this).

Posted: Sun Aug 19, 2007 12:42 pm
by jingquan
Great stuff, Blindside. Any plans to support GLSL for the shadows? Cound save me some trouble converting them. :wink:

Thanks.

Posted: Sun Aug 19, 2007 2:13 pm
by BlindSide
I have already kind of converted it, but I need to convert all the filtering types and release the wrapper in a nice way. Unfortunately lately I have not had much time for this kind of stuff. I'll try to get it out sometime soon.

Posted: Mon Jan 17, 2011 2:34 pm
by jiedi123
this is my code

the effect is so good,
but when the node moved is error,
why? please help me.
///////////////////////////////////////////////////////////////////////////////////
IAnimatedMesh* mesh = smgr->getMesh("body.b3d");
IAnimatedMeshSceneNode* snode = smgr->addAnimatedMeshSceneNode( mesh );
effect->addEffectToNode(snode,EET_PHONG);
while(device->run())
{
driver->beginScene(true,true,SColor(0,0,0,0));
effect->getLightCamera()->setPosition(snode->getAbsolutePosition());
effect->setLightTarget(snode->getAbsolutePosition());
effect->update();
smgr->drawAll();
driver->endScene();
}
///////////////////////////////////////////////////////////////////////////////////


snode moved

Image
snode not moved,postion is 0,0,0

Image[/img]

Posted: Sat Jan 29, 2011 12:02 am
by Granyte
in my case i get an even more interesting effect wich seem to be a conflict between this shader and the water shader