[x3d-public] x3d-public Digest, Vol 128, Issue 30
Michalis Kamburelis
michalis.kambi at gmail.com
Wed Dec 4 03:08:40 PST 2019
sob., 30 lis 2019 o 06:00 Andreas Plesch <andreasplesch at gmail.com> napisał(a):
> Yes, agreed. uv mapped from the axis aligned bounding box would be a good default. u from X and v from Y.
To be more precise, I proposed to use the same scheme as
IndexedFaceSet (
https://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/geometry3D.html#IndexedFaceSet
). It means:
- U along the longest dimension
- V along the next dimension
I agree that "U from X, V from Y" would be simpler (maybe also more
useful)... but IndexedFaceSet already defines it a bit differently.
And being consistent with IndexedFaceSet seems proper here.
>
> Are tangents really necessary for Phong shading ? see
> https://en.m.wikipedia.org/wiki/Blinn%E2%80%93Phong_reflection_model
Tangents are not really related to Phong shading. Tangents are
necessary to interpret the information from the normal map. This, in
turn, is necessary to actually use normal maps at all.
Explanation: the vectors in normal map are defined in "tangent space".
In this space,
- The +Z vector is pointing outward from the polygon. (To be more
precise, +Z is pointing in the direction indicated by per-vertex or
per-face normal vectors.)
- The +X vector should point in the direction where U texture
coordinate grows (and be fixed to be orthogonal to +Z). This is called
"tangent vector".
- Similarly, +Y vector should point in the direction where V texture
coordinate grows (and again be fixed to be orthogonal to +Z). This is
called "bitangent vector".
Browser can calculate tangent and bitangent if your mesh is composed
from polygons (using MikkTSpace algorithm , or CGE
TAbstractBumpMappingGenerator.CalculateTangentVectors ). But in case
of point set, you don't know which points should be considered
"adjacent", so you cannot calculate it.
And without knowing where the "tangent vector" points, we don't know
how to interpret a vector in normalmap like (1, 0, 0).
Regards,
Michalis
More information about the x3d-public
mailing list