Texture Conversion Tool Extended (Texconvex.exe)

1649 篇文章 11 订阅
1623 篇文章 22 订阅

A command line tool that converts textures between the following formats: BMP, DDS, GIF, JPEG, PNG, or TIFF.

Compatibility Chart

Direct3D 9 Direct3D 10 Direct3D 11 64-bit Native Mode Windows XP Windows Vista Windows 7
No Yes Yes Yes No Yes Yes

 

Path

The executable file is in the following platform-dependent locations:

Item Description

32-bit

DirectX SDK root\Utilities\Bin\x86

64-bit

DirectX SDK root\Utilities\Bin\x64

 

Syntax

Texconvex.exe uses the following command syntax:

texconvex [-10] [-11] [-w number] [-h number] [-d number] [-m number] [-f format] [-if filter] [-mf filter] [-c color] [-srgbi] [-srgbo] [-px string] [-sx string] [-o directory] [-ft file-type] [-nologofile-name

The file-name parameter indicates the file to convert.

The optional command-line switches are described in the following table.

Optional Switches Description
-10 Forces the tool to use Direct3D 10 and D3DX10.
-11 Forces the tool to use Direct3D 11 and D3DX11.
-d  number Depth of the output texture. This setting applies only to volume textures.
-f  format Output format. Can use most of the formats in D3DFORMAT without the DXGI_FORMAT_ prefix (except: D3DFMT_MULTI2_ARGB8).
-ft   file-type A file type for the output texture. Use one of the following: bmp, dds, jpg, png, or tiff. The default value is dds.
-h  number Height of the output texture in pixels.
-w  number Width of the output texture in pixels.
-if   filter Image filter. Use one of the following: NONE, POINT, LINEAR, TRIANGLE, BOX, NONE_DITHER, POINT_DITHER, LINEAR_DITHER, TRIANGLE_DITHER, or BOX_DITHER. Filters with DITHER in their name indicate that a 4x4 ordered dither algorithm is also applied. See D3DX_FILTER for descriptions of the filters.
-m  number Number of mipmap levels to generate in the output texture. This setting only applies to DDS output.
-mf   filter Mipmap filter (see -if for filter options).
-nologo Suppress copyright message.
-o  directory Output directory.
-px  string Text string to attach to the front of the resulting texture's name.
-srgb, -srgbi, or-srgbo Use sRGB if both the input and output data are in the sRGB color format (ie. gamma = 2.2). Use sRGBi if only the input is in sRGB; use sRGBo if only the output is in sRGB.
-sx  string Text string to attach to the end of the resulting texture's name.
-sx  string Text string to attach to the end of the resulting texture's name.

 

Note   By default Texconvex.exe will try to use Direct3D 11. If Direct3D 11 is not available, it will fall back to Direct3D 10.

 

 

Send comments about this topic to Microsoft

Build date: 3/11/2010

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
private async parseMaterial(osgStateSet: any) { let material = new THREE.MeshBasicMaterial({ // side: THREE.DoubleSide, }); //THREE.FrontSide 背面 // THREE.BackSide 前面 // THREE.DoubleSide 双面 let osgImage = osgStateSet.TextureAttributeList[0].value.StateAttribute.Image; // let texture = this.parseImage(osgImage); let fileName = osgImage.Name; const isJPEG = fileName.search(/.jpe?g($|?)/i) > 0; const isPNG = fileName.search(/.png($|?)/i) > 0; if (!isPNG && !isJPEG) { return; } let mimeType = isPNG ? 'image/png' : 'image/jpeg'; let imageUri: any = new Blob([osgImage.Data], { type: mimeType }); let base64 = await this.blobToBase64(imageUri); // debugger let imageUrl: any = URL.createObjectURL(imageUri); try { let texture = new THREE.TextureLoader().load(base64, () => { texture.needsUpdate = true; // texture.format = THREE.RGBAFormat; texture.type = THREE.UnsignedShort5551Type; texture.minFilter = THREE.LinearMipmapNearestFilter; texture.magFilter = THREE.LinearMipmapNearestFilter; texture.generateMipmaps = false; // texture.format = THREE.RGBAIntegerFormat; // texture.minFilter = THREE.NearestFilter; // texture.magFilter = THREE.NearestFilter; // texture.minFilter = THREE.LinearMipMapLinearFilter; // texture.magFilter = THREE.LinearFilter; // texture.wrapS = THREE.RepeatWrapping; // texture.wrapT = THREE.RepeatWrapping; // texture.anisotropy = 1; // texture.generateMipmaps = false; // texture.encoding = THREE.sRGBEncoding; }); imageUri = null; osgImage = null; imageUrl = null; if (texture) { material.map = texture; } } catch (e) { console.log('纹理加载出错', e); } osgStateSet = null; return material; } private blobToBase64(blob: any) { return new Promise((resolve, reject) => { const fileReader = new FileReader(); // readAsDataURL fileReader.readAsDataURL(blob); fileReader.onload = (e: any) => { resolve(e.target.result); }; }); }没有显示base64图片的纹理,也没有报错,请找出问题,并给出详细代码
06-12
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值