# How camera.cullingMatrix work

**URL:** <https://discussions.unity.com/t/how-camera-cullingmatrix-work/943574>\
**Category:** Camera\
**Tags:** Unity-Documentation, Conversation\
**Created:** [April 3, 2024, 6:54am UTC](https://discussions.unity.com/t/how-camera-cullingmatrix-work/943574 "2024-04-03T06:54:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yzhuangaa](https://avatars.discourse-cdn.com/v4/letter/y/e0b2c6/32.png) [@yzhuangaa](https://discussions.unity.com/u/yzhuangaa)\
**Post date:** [April 3, 2024, 6:54am UTC](https://discussions.unity.com/t/how-camera-cullingmatrix-work/943574/1 "2024-04-03T06:54:12Z")

</div>

From the web documentation [https://docs.unity3d.com/ScriptReference/Camera-cullingMatrix.html,the](https://docs.unity3d.com/ScriptReference/Camera-cullingMatrix.html,the) demo script use projectmatrix times worldToCamera to set the culling matrix.Which is obvious a VP matrix.

So,I assume,to query whether a point is culled by cullingMatrix,unity just do cullingMatrix.MultiplyPoint(pointPosition) and if the xyz value’s value is within [-1,1],then the point will not be culled.

Now I have my custom culling matrix,which is actually made so that I can determine if something is within my custom culling shape.Noticed that this matrix is not derived from VP matrix calculation BUT i manage to make it behave just like normal cullingMatrix  
(Which is that if a point is within the culling shape,result of cullingMatrix.MultiplyPoint(pointPosition) will have xyz components both in [-1,1],and vice versa).

I test the above custom culling matrix in script and everything is correct.However when i assign it to camera.cullingMatrix,culling job does not work as expected.So i want to know how camera.cullingMatrix work.

If any unity guy or whoever know about it here,help plz.

---

<div class="post-metadata">

**Author:** ![yzhuangaa](https://avatars.discourse-cdn.com/v4/letter/y/e0b2c6/32.png) [@yzhuangaa](https://discussions.unity.com/u/yzhuangaa)\
**Post date:** [April 8, 2024, 10:45am UTC](https://discussions.unity.com/t/how-camera-cullingmatrix-work/943574/2 "2024-04-08T10:45:06Z")

</div>

It is wired that my culling matrix eventually work after mutiply all elements by -1.(We know that doing so will not change the result.First the result sign should not change because dividing w will make two negtive result become positive.Second,even if the sign change,original range,which is in [-1,1],will still be [-1,1]).
