Proposal for removing TexFace in 2.8x #51382

Closed
opened 2017-05-01 14:46:23 +02:00 by Campbell Barton · 13 comments

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.

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.
Author
Owner

Changed status to: 'Open'

Changed status to: 'Open'
Author
Owner

Added subscriber: @ideasman42

Added subscriber: @ideasman42
Campbell Barton changed title from Remove TexFace for 2.8 Proposal to Proposal for removing TexFace in 2.8x 2017-05-01 15:10:08 +02:00

Added subscriber: @Moguri

Added subscriber: @Moguri

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

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

Added subscriber: @mont29

Added subscriber: @mont29

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.

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.

Added subscriber: @BartekMoniewski

Added subscriber: @BartekMoniewski

+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.

+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.

Added subscriber: @VukGardasevic

Added subscriber: @VukGardasevic

@BartekMoniewski 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.

@BartekMoniewski 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.

Added subscriber: @you.le

Added subscriber: @you.le
Author
Owner

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Campbell Barton self-assigned this 2017-05-27 04:40:59 +02:00
Author
Owner

Committed to 2.8 branch:

  • Remove image member
  rB7a9ad029dd1d1afe42d54c9c181de887636db7c0
  • Remove all non UV members from the struct.
  rBf2cc6c9254be5fe093e112f3b6e2192b392a1843
  • Entirely remove MTexPoly structure and layer type, drawing and update UI & version patch files.
  rBbdbf4471a6c4ba2d444eea5e7f0e6984b3aaafc2
  rBc6e92b4947945e3c1238d936f7954a5b4688c195
Committed to 2.8 branch: - Remove image member ``` rB7a9ad029dd1d1afe42d54c9c181de887636db7c0 ``` - Remove all non UV members from the struct. ``` rBf2cc6c9254be5fe093e112f3b6e2192b392a1843 ``` - Entirely remove `MTexPoly` structure and layer type, drawing and update UI & version patch files. ``` rBbdbf4471a6c4ba2d444eea5e7f0e6984b3aaafc2 rBc6e92b4947945e3c1238d936f7954a5b4688c195
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#51382
No description provided.