Massive shadow over everything?

Can I anyone explain this,

I’m using pssm shadow renderer in my scene, which also uses fog, which are rendered into their own viewport.



It all looks fine except when I move the camera at certain angles everything seems to get covered in shadow.



Here are the 2 results, right and wrong…







uh…;the second shot looks like it’s depth output to the screen.



could you explain “which are rendered into their own viewport.”?

and maybe provide a test case

thanks

hi,

here’s some bits of code

[java]

frameBuffer2 = new FrameBuffer(screenwidth, screenheight, 0);

frameBuffer2.setDepthBuffer(Format.Depth);

sceneTexture2 = new Texture2D(screenwidth, screenheight, Format.RGBA8);

frameBuffer2.setColorTexture(sceneTexture2);

depthTexture2 = new Texture2D(screenwidth, screenheight, Format.Depth);

//fog

fpp = new FilterPostProcessor(assetManager);

fog = new MyFogFilter();

fog.setFogColor(new ColorRGBA(.6f, .6f, 1.f, 1f));

fog.setFogDistance(40);

fog.setFogDensity(1.25f);

fpp.addFilter(fog);

ViewPort view2 = renderManager.createMainView("view 2", cam);

view2.setClearColor(true);

view2.setClearDepth(true);

view2.setBackgroundColor(ColorRGBA.Black);

view2.setOutputFrameBuffer(frameBuffer2);

pssmRenderer = new PssmShadowRenderer(assetManager, 1024, 3);

pssmRenderer.setDirection(new Vector3f(-1, -1, -1).normalizeLocal());

pssmRenderer.setLambda(0.55f);

pssmRenderer.setShadowIntensity(0.6f);

pssmRenderer.setCompareMode(CompareMode.Software);

pssmRenderer.setFilterMode(FilterMode.Bilinear);



rootNode.setShadowMode(ShadowMode.Off);

view2.addProcessor(pssmRenderer);

view2.addProcessor(fpp);

view2.attachScene(sceneNode);

[/java]

i then render the framebuffer onto a fullscreen quad.

i’ll try and put a test case together if needed.

test cases are the best way to get a real problem fixed

Do you have the same issue if you render directly the scene to the screen?

yeah i’ll try that tomorrow as well thanks…

ok, i’m still trying to isolate the problem in a test case, but in the meantime i have found this…



when i switch to hardware mode it works fine, except -



if any of the objects (floor or spheres) DON’T have casting in their shadowmode - then the same problem arises.



e.g. (my floor)

pillarNode.setShadowMode(ShadowMode.Receive);

…appears blacked out



but…

pillarNode.setShadowMode(ShadowMode.CastAndReceive);

…appears okay



or with

pillarNode.setShadowMode(ShadowMode.Receive); // (appearing blacked out)



but then I shoot a ball into the scene with

ball_geo.setShadowMode(ShadowMode.CastAndReceive);



it then works as soon as this happens…

one further thing - going to hardware mode seems lessen the darkness of the ‘big shadow’ problem - at least now you can see the textures







like i said, as soon as i shoot a ball into the scene that has casting - the scene looks fine…

i’ve also just noticed (which might be the overall problem) that as move close to my geometry, the camera seems to be casting a shadow, or at least messing with pssm somehow…



I had a similar problem a few months ago. It resulted in this :

I solved it by updating my graphics card drivers.

thanks kaizo,

i’m on a mac book air, and everything’s updated,

i don’t want to use the hardware mode for compatibility issues anyway, just hoping i can get the software mode working eventually - for now i’m moving on to other things - i’ll come back to the ‘shadow of death’ at some stage…

Can this issue be reproduced in the TestPssmShadow test? If not, what changes need to be done to reproduce it?

Yeah I started to do that with the testpssmshadow test, but couldn’t isolate it yet, i’ll get back to it soon.