Commit Graph

10 Commits

Author SHA1 Message Date
Par Winzell 443243a52c Only ever create one BufferViewData per file.
It is not uncommon for multiple logical textures in an FBX to reference
the same filename. Each such filename should yield one buffer view only,
and all sharing textures should reference it.
2017-10-18 21:49:45 -07:00
Par Winzell bc803213fc Delete obsolete snippets. 2017-10-17 21:19:36 -07:00
Par Winzell bf28c29f50 Multiple fixes for transparency.
- alphaMode is only BLEND for transparent materials.
- We use RawMaterial.type to figure out what's transparent.
- FBX TransparencyFactor is not opacity, but 1.0-opacity.
- Treat vertex coloured materials as transparent
  - We should at least iterate over vertices here and see if any of them
    actually are transparent
- Sort triangles properly: transparent ones render last!
2017-10-17 21:14:52 -07:00
Par Winzell d4ac174023 Don't include empty extension info. 2017-10-17 20:37:40 -07:00
Par Winzell b44d3b19a8 Fix build across all platforms. 2017-10-17 17:56:21 -07:00
Par Winzell f4a48905eb Directories for NPM published binaries.
We may revisit this way of publishing releases, but for now let's make
sure these directories always exist.
2017-10-17 17:35:34 -07:00
Par Winzell f2a057d783 Do a better job resolving texture files.
- Nix GetFileFolder(). It was not helping. Always search for textures
- near the FBX file.
- Use RawTexture::name for the texture name and ::fileName for the
  inferred local filename path.
2017-10-16 23:31:19 -07:00
Par Winzell e9067850e1 Break out material property & texture code.
Digging the property values and texture shadows thereof, associated with
a certain FbxSurfaceTexture, should clearly happen once per material,
not per polygon. Furthermore there is a pre-existing pattern of
Fbx-specific accessclasses in Fbx2Raw that we should follow.

Soon we'll be extracting more than Phong/Lambert properties here, and
then we'll need to do further refactoring.
2017-10-16 23:12:57 -07:00
Par Winzell e6cd0f012b Propertly transform UV coordinates.
We were mapping v to -v rather than 1-v, with fairly catastrophic
results. While fixing, take the trouble to introduce a more general
transformation mechanism than just an affine matrix.
2017-10-16 23:02:46 -07:00
Par Winzell 276a0dfb86 Initial commit. 2017-10-13 01:55:11 -07:00