Comments (6)
Just download texconv.exe and use the command-line instructions.
If you want to convert TO the "DX10" FourCC, use the command-line switch -dx10
.
from directxtex.
That's awesome, thanks!
from directxtex.
Just a quick follow-up question, I'm trying to call the exe in C# but I'm having real issues, could you take a look at this code to see what's wrong? Thanks!
Process.Start("texconv.exe", @"-dx10 -ft jpg -f BC7_UNORM -o \" + Path.GetDirectoryName(outFilePath) + @"\ " + outFilePath + ".dds");
Where "outFilePath" is a file name and folder location from the current directory.
from directxtex.
First, you are assuming that texconv.exe is in the 'current working directory'. You might want to use System.Diagnostics.ProcessStartInfo
.
Second, you are telling the tool to write the result as a JPEG but are using BC7_UNORM which is not a form that JPEG can store. You should remove -ft jpg
.
from directxtex.
Ah, I should have explained the context a bit better...
I've got my application and texconv.exe in a folder together, in my application I am exporting DDS files from a game with varying formats (including DXGI_FORMAT_BC7_UNORM and others). I want texconv.exe to convert the textures to .JPG as soon as they are exported so that I can allow the user to view them within my app, and the way I'm doing this is to export the DDS to the working directory, call the Process.Start command above, delete the DDS and then continue with the other files. I don't want the new JPG files to also be in the working directory though, they've got their own file structure which is why I'm trying to use -o to set the output directory.
The issue I'm having is that by pausing my loop after just one texture export and running a .bat file manually in the working directory I can export the textures fine, but running the same code through Process.Start (with my full loop and by pausing my loop) it just won't work and I've tried so many combinations I really can't figure out why. I can sometimes manage to get them to convert to JPG into the working directory, but using -o just seems to mess it all up (but only via the Process.Start). The .bat file I tested and the application that is running Process.Start are both in the same folder so I don't know why it would be a location-based issue.
To also explain my parameters, I'm inputting a DX10 BC7_UNORM texture in that example and trying to output it to JPG in its correct folder. I presumed you'd need the -f parameter for converting from DDS as well as to it?
Thanks!
from directxtex.
You don't control the input format with the command-line. It's whatever the source file contains. The switch controls the desired output format. Since you are trying to write a JPEG, you should use -ft jpg -f R8G8B8A8_UNORM
.
Another option would be to use interop and write a little C++ wrapper that uses the DirectXTex library to do the conversion.
from directxtex.
Related Issues (20)
- Integrate Xbox functionality in the Auxiliary folder
- FAILED (80004005: Unspecified error ) HOT 2
- Move PPM/PFM I/O functions to the library HOT 1
- WIC loading is different from D3DX loading of WIC textures HOT 9
- GPU-compressed `BC7_UNORM_SRGB` textures contain red streaks when using texconv.exe under wine HOT 1
- (Question) Converting BC4 to BMP with texconv HOT 1
- Does DirectXTex directly depend on ZLIB? HOT 3
- Can't compile ddsdump HOT 2
- gcc Warnings in Linux -Wstringop-overflow HOT 4
- Does DirectX support direct reading of compressed textures? HOT 1
- Use fixed width integers for underlying enum types HOT 1
- I need pre-compiled shaders HOT 3
- Allow user to convert single lat-long hdri into cubemap HOT 1
- Low quality DXT compression HOT 4
- Add function to convert a texture to Standard Swizzle and vice versa HOT 1
- UINT and SINT formats in texconv HOT 6
- D3DFMT_X8L8V8U8 support (BumpDuDv/BumpLuminance) HOT 5
- keep getting acess denied HOT 3
- Compression artifacts for BC7_UNORM when compressing on CPU (GPU is fine) HOT 2
- Expose EncodeDDSHeader from DirectXTexXboxDDS.cpp HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from directxtex.