ColinLeung-NiloCat / UnityURPUnlitScreenSpaceDecalShader

Unity unlit screen space decal shader for URP. Just create a new material using this shader, then assign it to a new unity cube GameObject = DONE, now you have unlit decal working in URP
MIT License
1.26k stars 129 forks source link

Usage with Isometric Orthographic Projection Matrix #38

Open ThomThomson opened 3 years ago

ThomThomson commented 3 years ago

I'm attempting to use this shader to create screenspace decals with a custom Isometric camera I created by shifting one of the elements of the camera's projection matrix.

I have _SupportOrthographicCamera turned on, and the decal works great with an orthographic camera with no lens shift, but as soon as I apply the lens shift, the decal disappears. The line of code which applies the lens shift looks like:

targetMatrix.m12 = isoLensShiftY / camera.orthographicSize;

I'm thinking that there must be somewhere in the shader where I could inject similar code to get the decal to show up.

If you could help to point me in the right direction, that you be much appreciated, thanks!