|
|
|
|
|
|
if (isTriplanar) |
|
|
|
{ |
|
|
|
float3 viewDirTS; |
|
|
|
float planeHeight; |
|
|
|
int numSteps; |
|
|
|
|
|
|
|
// Perform a POM in each direction and modify appropriate texture coordinate |
|
|
|
|
|
|
float2 offsetZY = ParallaxOcclusionMapping(lod, _PPDLodThreshold, numSteps, viewDirTS, maxHeight, ppdParam, height); |
|
|
|
float2 offsetZY = ParallaxOcclusionMapping(lod, _PPDLodThreshold, numSteps, viewDirTS, maxHeight, ppdParam, planeHeight); |
|
|
|
height = layerTexCoord.triplanarWeights.x * planeHeight; |
|
|
|
float2 offsetXZ = ParallaxOcclusionMapping(lod, _PPDLodThreshold, numSteps, viewDirTS, maxHeight, ppdParam, height); |
|
|
|
float2 offsetXZ = ParallaxOcclusionMapping(lod, _PPDLodThreshold, numSteps, viewDirTS, maxHeight, ppdParam, planeHeight); |
|
|
|
height += layerTexCoord.triplanarWeights.y * planeHeight; |
|
|
|
float2 offsetXY = ParallaxOcclusionMapping(lod, _PPDLodThreshold, numSteps, viewDirTS, maxHeight, ppdParam, height); |
|
|
|
float2 offsetXY = ParallaxOcclusionMapping(lod, _PPDLodThreshold, numSteps, viewDirTS, maxHeight, ppdParam, planeHeight); |
|
|
|
|
|
|
|
height = 0.0; // TODO |
|
|
|
height += layerTexCoord.triplanarWeights.z * planeHeight; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|