Page MenuHome

Proposal for removing TexFace in 2.8x
Closed, ResolvedPublic

Description

This proposal is to drop the ability to store per-face images, (known as TexFace).

Rationale:

TexFace doesn't fit into modern shading pipelines since any material can use any image,
it means materials can't be drawn in batches and need to context switch.
(or we need to prepare material & image combinations in advance).

TexFace is only used by Blender Internal and optionally the Game Engine (when 'Face Textures' is enabled).

Since Blender's drawing code is being re-written, 2.8x is a good opportunity to drop tex-face support.

Removing/Deprecating:

Ideally we could remove TexFace entirely, however it contains texture coordinates which are used for placing particles (see: psys_interpolate_uvs).

These UV's are stored in either quad or triangules (MFace aligned),
so their stored indices wont align with triangle tessellation (MLoopTri 's for example).

Longer term we can check on version-patching particle data so point into the triangulated indices
(which can still detect quads so particles UV coordinates can be applied as-if to a quad).

But this is a bigger task.

The other main user of per-face images is texture baking.
This code can be made to use materials images (as Cycles does already).

Proposal:

  • Remove the image member of MTFace (keep only the UV's).
  • Remove tex-face data for polygons (MTexFace, keeping MLoopUV).

This way we can remove per-face-image support from the user perspective, and later remove MTFace as part of a refactor with no user visible changes.

Problems:

The down side is that some Blend files do use single material and TexFace to assign images, which will be lost by this change!

We could generate materials as part of versioning code, but from what I've seen images are often assigned from UV mapping, (setting an image in edit-mode assigns face-images), so this could be very annoying too.

So this proposal is to remove them without attempting generate new materials.

Details

Event Timeline

Campbell Barton (campbellbarton) renamed this task from Remove TexFace for 2.8 Proposal to Proposal for removing TexFace in 2.8x.May 1 2017, 3:10 PM

+1 for removing TexFace. It has caused a lot of issues for the BGE too.

Other issue from TexFace worth mentioning is that this Image pointer enforces a loop over all faces of all meshes that have that data layer when managing data-blocks (in BKE_library_foreach_ID_link()) - which is potentially horrible! ;)

Agree with current plan, indeed keeping the UV part for now even for tessface will make things simpler, and don’t think we need to bother about converting those images into materials either.

+1 for simplicity.
People don't use TexFace mapping these days because it's not compatible with Cycles, external render and game engines. If people really need to bring back old BI scenes to 2.8 they can download 2.79 and convert them easily. We might think of providing official addon for 2.79 that do this automatically.

@Bartosz Moniewski (monio) There are already converters included in Material utils. They probably need more work though as they don't produce desirable results all the time, and are not supporting all the material types and the code needs refactor. Still, they could be used as starting point.

Committed to 2.8 branch: