Design : Add DDS file support #118863

Open
opened 2024-02-28 18:49:20 +01:00 by Gangneron · 6 comments

I would like to add support for DDS files to Blender because this file format is widely used, particularly in the industry (e.g. farming simulator) and by many other people. In this context reimplemented dds format support would be useful.
This format was once present. but before starting development I wanted to collect opinions or advice on the subject

I would like to add support for DDS files to Blender because this file format is widely used, particularly in the industry (e.g. farming simulator) and by many other people. In this context reimplemented dds format support would be useful. This format was once present. but before starting development I wanted to collect opinions or advice on the subject
Gangneron added the
Type
Design
label 2024-02-28 18:49:20 +01:00
Iliya Katushenock added this to the Python API project 2024-02-28 18:54:18 +01:00
Iliya Katushenock removed this from the Python API project 2024-02-28 18:54:25 +01:00
Iliya Katushenock added this to the Pipeline, Assets & IO project 2024-02-28 18:54:57 +01:00

Specifically for games, DDS files are commonly used to store pre-generated or specifically authored MIP maps. Blender images internally don't support custom MIP maps (as far as I know at least). Did you put any thought into how you'd deal with importing/exporting this information? A hacky thing I was thinking was to use the UDIM image type and store the different MIP levels in descending UDIM tiles. This way you could at least begin to import the DDS, do specific edits and if the exporter follows the same logic export the same result again.

For reference, here's a video where somebody uses NVIDIA's tool/plugin to generate custom mip maps in a DDS file:
https://youtu.be/Pcm6SrfgnvA?si=V35tQ-E6N59Y-nL6&t=171
With either the standalone tool and plugin, the non-dds representation is a single image with the lower and lower resolution mips arranged horizontally. Doing that is technically also a way a DDS could be imported and then exported again, but it leaves the image completely useless when mapping it onto a mesh while inside Blender.

Of course making Blender fully support images with custom mips could be very cool, that's of course waaaay out of scope for DDS support.

Specifically for games, DDS files are commonly used to store pre-generated or specifically authored MIP maps. Blender images internally don't support custom MIP maps (as far as I know at least). Did you put any thought into how you'd deal with importing/exporting this information? A hacky thing I was thinking was to use the UDIM image type and store the different MIP levels in descending UDIM tiles. This way you could at least begin to import the DDS, do specific edits and if the exporter follows the same logic export the same result again. For reference, here's a video where somebody uses NVIDIA's tool/plugin to generate custom mip maps in a DDS file: https://youtu.be/Pcm6SrfgnvA?si=V35tQ-E6N59Y-nL6&t=171 With either the standalone tool and plugin, the non-dds representation is a single image with the lower and lower resolution mips arranged horizontally. Doing that is technically also a way a DDS could be imported and then exported again, but it leaves the image completely useless when mapping it onto a mesh while inside Blender. Of course making Blender fully support images with custom mips could be very cool, that's of course _waaaay_ out of scope for DDS support.
Author

Thank you for comment. In first time I think to support dds import and after export. But in the long term modifying mip map could be considered but that would then be the subject of another ticket.
To tell the truth, I hadn't thought about the idea of UDIM but I'm going to think about it

Thank you for comment. In first time I think to support dds import and after export. But in the long term modifying mip map could be considered but that would then be the subject of another ticket. To tell the truth, I hadn't thought about the idea of UDIM but I'm going to think about it
Member

seems to work just fine, what exactly are you planning to do?

image

seems to work just fine, what exactly are you planning to do? ![image](/attachments/e92f1d75-cae9-4af0-9288-648bf2f37cdf)
544 KiB
Author

DDS export works? if this is the case I would do the opposite operation of #115987
and I'm considering at this point adding dds creation tools and maybe doing a refactor of code and seeing if we can improve performance.

DDS export works? if this is the case I would do the opposite operation of #115987 and I'm considering at this point adding dds creation tools and maybe doing a refactor of code and seeing if we can improve performance.
Member

DDS export works?
I'll be honest i only read the opening post, which mentioned neither import nor export.

import works, export we're trying to rely as much as possible on OpenImageIO which currently only supports reading.

> DDS export works? I'll be honest i only read the opening post, which mentioned neither import nor export. import works, export we're trying to rely as much as possible on OpenImageIO which currently only supports reading.

Exporting uncompressed DDS files is pretty trivial to implement. Exporting compressed DDS files is "quite hard" (Blender would have to use some of 3rd party texture compression libraries). For your use case, does the end application that receives DDS files expects them to be compressed or not? If compressed, then in which compression formats? (there are several, and compression libraries for them are different)

Exporting uncompressed DDS files is pretty trivial to implement. Exporting compressed DDS files is "quite hard" (Blender would have to use some of 3rd party texture compression libraries). For your use case, does the end application that receives DDS files expects them to be compressed or not? If compressed, then in which compression formats? (there are several, and compression libraries for them are different)
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
Interest: X11
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 Assignees
4 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#118863
No description provided.