[Solved] VisibilityMask bug on different shadow passes

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Post Reply
xrgo
OGRE Expert User
OGRE Expert User
Posts: 1148
Joined: Sat Jul 06, 2013 10:59 pm
Location: Chile
x 168

[Solved] VisibilityMask bug on different shadow passes

Post by xrgo »

EDIT: it was nothing, just a stupid typo in my code :P

------------------

Hello! I separate the dynamic and static objects like this:

Code: Select all

        item->setVisibilityFlags( (node->isStatic()) ?  0x00000004 : 0x00000003 );
then in my shadowNode I want to render static objects in one shadow and dynamic ones in another shadow.
So I have a directional light with pssm shadows and a spotlight with focused shadows, the idea is to render dynamic objects only in the pssm shadows and static ones in the focused.
I do this to have better performance using a static shadow for my static objects, and it works just fine!... but only when pssm splits is 2 :S

if split count is 3 or 4 I get both shadows for the dynamic objects... its like if the VisibilityMask for the scene pass of the second shadow is taken from the first one =(

I am doing my shadow node stuffs by code but I was able to reproduce the problem using the ShadowMapDebuggingShadowNode from the samples in my workspace, I just added:

Code: Select all

.............
	shadow_map_target_type directional
	{
		shadow_map 0 1 2 // 0 1
		{
			pass render_scene
			{
			visibility_mask      0x00000003
			}
		}
	}

	shadow_map_target_type directional spot
	{
		shadow_map 3 4 // 2 3
		{
			pass render_scene
			{
			visibility_mask      0x00000004
			}
		}
	}
	...........
and it works with num_splits 2 but no 3 or 4

any ideas?
Post Reply