Unfortunately this shader seems to have a bug in maya related to scaling the object. I can correct for this in Unity with * unity_Scale.w, but i am not sure how to extract the object scale in maya just yet. It is possible to work around this by freezing the transforms of the object though. Since you should be freezing your transforms prior to export anyway, and it otherwise works fine...¯\_(ツ)_/¯ Should i find a solution to the scaling issue or a better implementation that works in a different way, i will update the shader to reflect this. At this point i think its a better use of my time to ask for help and move on.
EDIT: 1-14 - I figured it out. I reversed the matrix and the camera position while converting the camera position to object space and that screwed everything up. Oops.
Maya CGFX File:
phongnormalparallax.cgfx |
Unity SHADER File:
phongnormalparallax.shader |