Tag Info

New answers tagged


unity_LightPosition is in Model-View space. To convert it into world space you'll have to multiply it by the inverse matrix of UNITY_MATRIX_MV. Here's some code that might be helpful in inverting a matrix: http://answers.unity3d.com/questions/218333/shader-inversefloat4x4-function.html Example: float4 worldLightPos = mul( inverse(UNITY_MATRIX_MV), ...


You can easily add custom fields to your vertex data, one of which could be a vertex ID. You could also place those IDs in a separate vertex stream so you can use them with any mesh. The standard way to animate a face (or any other 3D model) would be to use some sort of skeletal animation (also called skinning) which generally means that each vertex stores ...

Top 50 recent answers are included