|
|
|
|
|
|
{ |
|
|
|
ppdParam.uv = layerTexCoord.base.uv; // For planar it is uv too, not uvXZ |
|
|
|
|
|
|
|
#ifdef SURFACE_GRADIENT |
|
|
|
float3x3 worldToTangent = input.worldToTangent; |
|
|
|
|
|
|
|
#ifdef SURFACE_GRADIENT |
|
|
|
float3x3 worldToTangent = input.worldToTangent; |
|
|
|
#else |
|
|
|
float3x3 worldToTangent = input.worldToTangent; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
float3 viewDirTS = isPlanar ? float3(uvXZ, V.y) : TransformWorldToTangent(V, worldToTangent); |
|
|
|
NdotV = viewDirTS.z; |
|
|
|
|
|
|
ppdParam.uv[2] = layerTexCoord.base2.uv; |
|
|
|
ppdParam.uv[3] = layerTexCoord.base3.uv; |
|
|
|
|
|
|
|
#ifdef SURFACE_GRADIENT |
|
|
|
float3x3 worldToTangent = input.worldToTangent; |
|
|
|
|
|
|
|
#ifdef SURFACE_GRADIENT |
|
|
|
float3x3 worldToTangent = input.worldToTangent; |
|
|
|
#else |
|
|
|
float3x3 worldToTangent = input.worldToTangent; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
// For planar the view vector is the world view vector (unless we want to support object triplanar ? and in this case used TransformWorldToObject) |
|
|
|
// TODO: do we support object triplanar ? See ComputeLayerTexCoord |
|
|
|