I was playing around with the parallax/Bump mapping sample (1.9.4) and all was great, but then i tried loading a model i created myself (with GeomVertexWriters and so on), and the effect didn’t work anymore.
For this, i used a custom format to insert tangent and binormal in the geom, like this:
**array = GeomVertexArrayFormat()** **array.addColumn('vertex', 3, Geom.NTFloat32, Geom.CPoint)** **array.addColumn("texcoord", 2, Geom.NTFloat32, Geom.CTexcoord)** **array.addColumn('tangent', 3, Geom.NTFloat32, Geom.CVector)** **array.addColumn('binormal', 3, Geom.NTFloat32, Geom.CVector)** **array.addColumn('normal', 3, Geom.NTFloat32, Geom.CNormal)** **format = GeomVertexFormat()** **format.addArray(array)** **format = GeomVertexFormat.registerFormat(format)**
When trying to read the egg file i got with bamtoegg.exe, binormal and tangent weren’t registered.
Using egg-trans allowed me to recompute BT vectors and adding them to the egg (parallax/bump mapping working fine in this case), but i’m looking for a way to do this without translating the file to an egg.
Is there a way to do such a thing? is Geom.CVector the correct format for tangent/binormal? is there specific names to use so that the vectors get used in the per-Pixel lighting shader?