Jump to content
  • Advertisement
Sign in to follow this  
evillgames

PCSS troubles

This topic is 2623 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

ok guys.. i just fuck my head with that bug:

i use nvidia composer code and that does not work as it needs

[color="#00ffff"]http://dl.dropbox.co.../pcssf.d001.jpg


[color="#000000"]i do not understand - why do i get harsh edges of shadow ,when pcf has to blur my shadow edges softly.. and here we see sharp..
that looks like blocker's zone is incorrect.. i do not know

there is formulas:

float BlockersearchWidth = SceneScale * LightSize / zReceiver;

float penumbraWidth = (receiver - Blocker) * LightSize / Blocker;

i suppose: SceneScale , LightSize are not correct - but in which limits these values must be ?


[font="Lucida Console"][font="Lucida Console"][/font][/font]

Share this post


Link to post
Share on other sites
Advertisement
You have not posted any code that could be used to help you.
The only code that should be of use is the code that interpolates the samples together, and you omitted it.


L. Spiro

Share this post


Link to post
Share on other sites

You have not posted any code that could be used to help you.
The only code that should be of use is the code that interpolates the samples together, and you omitted it.


L. Spiro



sorry - had not understood...

i have 3 functions -

findBlocker
estimatePenumbra
PCF_Filter at last step

which part do you mean ?

thx

Share this post


Link to post
Share on other sites

[color="#00ffff"][color="#000000"]i do not understand - why do i get harsh edges of shadow ,when pcf has to blur my shadow edges softly.. and here we see sharp..
that looks like blocker's zone is incorrect.. i do not know


Are you trying to use hardware PCF? Your depth texture needs typically to be created with a specific FourCC code (INTZ, i think?) to indicate to the drivers that tex2Dproj maps to the PCF comparison.

Share this post


Link to post
Share on other sites


numSamples=8
filterWidth=result from penumbra procedure
bias - not used
uv - gl_TexCoord[2].xy/gl_TexCoord[2].w;
LP - gl_TexCoord[2]

gl_TexCoord[2] - lightmvp vertex (i am sure it is ok)

float PCF_Filter(float2 uv, float4 LP,
uniform float bias, float filterWidth, float numSamples)
{
// compute step size for iterating through the kernel
float stepSize = 2 * filterWidth / numSamples;

// compute uv coordinates for upper-left corner of the kernel
uv = uv - float2(filterWidth,filterWidth);

float sum = 0; // sum of successful depth tests

// float incommingDepth = LP.z/LP.w;

// now iterate through the kernel and filter
for (int i=0; i<numSamples; i++)
{
for (int j=0; j<numSamples; j++)
{
// get depth at current texel of the shadow map
vec2 jittered = uv + float2(i*stepSize,j*stepSize);

// accumulate result
sum += LP.z < texture2D(simpleShadowMap, jittered ).x ;
//sum += EVSM(jittered,incommingDepth);
}
}

// return average of the samples
return sum / (numSamples*numSamples);
}



i do not use hardware pcf - all samplers are set to point / nearest ,that means not to use any filtering,you know

Share this post


Link to post
Share on other sites
I remember the following from tinkering with PCSS a year ago:

Your PCF radius is too big for your number of samples

Stuff to try:
- scale down the radius
- increase the number of samples
- sample non-regularly. Poisson disk with rotation worked for me

Also try brightening the shadow so 100% in-shadow isn't that dark. Could make the whole thing less noticeable.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!