P1,P2,P3;(h1,h2,h3,h4)i,j

0 i < n;0 j < n

Δu = h1+h3h2h4 2

Δv = h1+h2h3h4 2

h = h1+h2+h3+h4 4

Dtex2 = P3P12 n2

Nô = NormalMatrix(Interpolate(NP1,NP2,NP3;i,j))̂

Tinitial = NormalMatrix(P3 P1)

Binitial = NormalMatrix(P2 P1+p3 2 )

Given (Nô), Orthonormalize

(Tinitial,Binitial), yielding (T̂,B̂)...

NT = T̂ Δu c2 +Δu2 +Δv2

NB = B̂ Δv c2 +Δu2 +Δv2

Nz = Nô1 NT 2 NB 2

Where the matrix may be helpful:

T̂ B̂ Nô

It’s assumed that 1 output-point is to

result, from 4 input-heights.

If (Pmax) is the maximum pixel-value,

(Hmax) is the maximum height or depth

in 3D, and (Dtex) is the distance between

Texels in 3D, Then:

h = h1+h2+h3+h4 4 (Hmax Pmax )

c = Pmax Dtex Hmax

(Dtex) could also be the known distance

between undisplaced input-points. And,

since only (c-squared) will ever be used,

the squares of (Dtex) and (Hmax) may also

be used, if (Pmax) is to be squared by itself,

and then the resulting (c) not squared again,

since their computation may be cheaper on

the GPU, than the actual computation of (Dtex),

which would require that another square root

be computed.

After all, the programming of certain shaders

may make it more difficult, to displace the

texel-sampling-point by (1 texel), than it is

just to sample the texture according to (more

than 1 input-point texture-coordinate-set),

within one shader invocation. This can be

due to mip-mapping.

BTW: I have not yet shown, how to compute

the deltas in texture-coordinates, to arrive

at (h1, h2, h3, h4) above:

DTCT = TCP3TCP1 2n

DTCB = 2TCP2TCP1TCP3 4n

However, if input-point-distances are to be

used, then the tangent-mapping would also

need to be modified, so that the tangent-vector

will become one of the tessellation axes,

derived from one of the sides of the input

geometry. The bitangent-vector could then

either be computed from re-crossing (with the

derived normal-vector of the output-

geometry), or from an arbitrary other side of

the input geometry, subject to Gram-Schmidt

orthonormalization. In either case, care

should be taken also to make sure, that the sign

of the bitangent-vector, corresponds to the

secondary direction, in which tessellation did

in fact take place.

OTOH, the coder could find that he’s been given

an input to the GS, which is already tessellated -

but as (1 triangle), in case DirectX11- or OpenGL4-

methods were being used. In that case, sub-

optimal equations may result, much like so:

P1,P2,P3;h1,h2,h3

Δu = h3 h1

Δv = h2 (h1+h3) 2

h = h1+h2+h3 3 (Hmax Pmax )

Dtex2 = P3 P12

Nô = NormalMatrix(NP1 + NP2 + NP3)̂

Tinitial = NormalMatrix(P3 P1)

Binitial = NormalMatrix(P2 (P1+P3) 2 )

The wide hat means ’normalize’, and I think

that only 1 Micropolygon-point could result, per

GS input-triangle.