- Home /
World View Projection in Shaders
I'm trying to port some HLSL shaders to Unity, but I'm stuck as the original shader access the matrix "g_matWVP" and Unity only has Model View Projection, is there a simple way I could access to it without changeing too much of the shader ?
Answer by tanoshimi · Jul 16, 2015 at 06:30 PM
You can transform from object to world coordinates by multiplying by the _Object2World matrix.
Example at https://en.m.wikibooks.org/wiki/Cg_Programming/Unity/Shading_in_World_Space
Your answer
Follow this Question
Related Questions
Scale Vertices propotional to Camera Frustum 0 Answers
SurfaceOutput.viewDir not the same in deferred 1 Answer
How to create a "wrapping" world in Unity? 4 Answers
Best Way to Implement an Exaggerated Horizon Curve to 3D Endless Runner? 0 Answers
How to force the compilation of a shader in Unity? 5 Answers