Jump to content

Convert Texture to DDS


SpiderPig
 Share

Go to solution Solved by Josh,

Recommended Posts

Just tried this out.  It works but doubles up on the texture uri's in the gltf file?  Is this intended?

	"images": [
		{
			"uri": "PineLeaves_DIFF.png"
		},
		{
			"uri": "PineLeaves_DIFF.dds"
		},
		{
			"uri": "PineLeaves_NORM.png"
		},
		{
			"uri": "PineLeaves_NORM.dds"
		},
		{
			"uri": "PineTrunk_DIFF.png"
		},
		{
			"uri": "PineTrunk_DIFF.dds"
		},
		{
			"uri": "PineTrunk_NORM.png"
		},
		{
			"uri": "PineTrunk_NORM.dds"
		}
	]

I also can't load the converted images into GIMP.  I know it's a plugin issue, but I've not heard of this format.  Just checking it's all good?

GimpError_001.png.bf7865b802d314c89c39a77b7cb5d91e.png

Link to comment
Share on other sites

Regarding the error in Gimp, for some reason most paint programs don't support modern (last 15 years) DXT compression (BC5, BC6, BC7). Visual Studio itself does have good support for DDS files.

  • Thanks 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

  • 4 weeks later...

I hacked it a bit to produce a valid file:

{
	"accessors": [
		{
			"bufferView": 0,
			"componentType": 5126,
			"count": 9231,
			"max": [
				3.081611156463623,
				25.591766357421875,
				3.6851890087127686
			],
			"min": [
				-4.146778583526611,
				-1.0971499681472778,
				-3.647721290588379
			],
			"type": "VEC3"
		},
		{
			"bufferView": 1,
			"componentType": 5121,
			"count": 9231,
			"type": "VEC3"
		},
		{
			"bufferView": 2,
			"componentType": 5126,
			"count": 9231,
			"type": "VEC3"
		},
		{
			"bufferView": 3,
			"componentType": 5121,
			"count": 9231,
			"type": "VEC3"
		},
		{
			"bufferView": 4,
			"componentType": 5126,
			"count": 9231,
			"type": "VEC2"
		},
		{
			"bufferView": 5,
			"componentType": 5121,
			"count": 9231,
			"type": "VEC3"
		},
		{
			"bufferView": 6,
			"componentType": 5123,
			"count": 9759,
			"type": "SCALAR"
		},
		{
			"bufferView": 7,
			"componentType": 5126,
			"count": 1472,
			"max": [
				0.35914069414138794,
				25.17479705810547,
				1.9243559837341309
			],
			"min": [
				-1.3300083875656128,
				-0.49771878123283386,
				-1.2738277912139893
			],
			"type": "VEC3"
		},
		{
			"bufferView": 8,
			"componentType": 5121,
			"count": 1472,
			"type": "VEC3"
		},
		{
			"bufferView": 9,
			"componentType": 5126,
			"count": 1472,
			"type": "VEC3"
		},
		{
			"bufferView": 10,
			"componentType": 5121,
			"count": 1472,
			"type": "VEC3"
		},
		{
			"bufferView": 11,
			"componentType": 5126,
			"count": 1472,
			"type": "VEC2"
		},
		{
			"bufferView": 12,
			"componentType": 5121,
			"count": 1472,
			"type": "VEC3"
		},
		{
			"bufferView": 13,
			"componentType": 5123,
			"count": 2028,
			"type": "SCALAR"
		}
	],
	"asset": {
		"generator": "Ultra Engine glTF Exporter",
		"version": "2.0"
	},
	"bufferViews": [
		{
			"buffer": 0,
			"byteLength": 110772,
			"byteOffset": 0
		},
		{
			"buffer": 0,
			"byteLength": 9231,
			"byteOffset": 110772
		},
		{
			"buffer": 0,
			"byteLength": 110772,
			"byteOffset": 138466
		},
		{
			"buffer": 0,
			"byteLength": 9231,
			"byteOffset": 249240
		},
		{
			"buffer": 0,
			"byteLength": 73848,
			"byteOffset": 276934
		},
		{
			"buffer": 0,
			"byteLength": 9231,
			"byteOffset": 350784
		},
		{
			"buffer": 0,
			"byteLength": 19518,
			"byteOffset": 378478
		},
		{
			"buffer": 0,
			"byteLength": 17664,
			"byteOffset": 397996
		},
		{
			"buffer": 0,
			"byteLength": 1472,
			"byteOffset": 415660
		},
		{
			"buffer": 0,
			"byteLength": 17664,
			"byteOffset": 420076
		},
		{
			"buffer": 0,
			"byteLength": 1472,
			"byteOffset": 437740
		},
		{
			"buffer": 0,
			"byteLength": 11776,
			"byteOffset": 442156
		},
		{
			"buffer": 0,
			"byteLength": 1472,
			"byteOffset": 453932
		},
		{
			"buffer": 0,
			"byteLength": 4056,
			"byteOffset": 458348
		}
	],
	"buffers": [
		{
			"byteLength": 462404,
			"uri": "PineLarge_001.bin"
		}
	],
	"extensionsUsed": [
		"ULTRA_mesh_displacement",
		"MSFT_texture_dds",
		"ULTRA_extended_material"
	],
	"images": [
		{
			"uri": "PineLeaves_DIFF.png"
		},
		{
			"uri": "PineLeaves_DIFF.dds"
		},
		{
			"uri": "PineLeaves_NORM.png"
		},
		{
			"uri": "PineLeaves_NORM.dds"
		},
		{
			"uri": "PineTrunk_DIFF.png"
		},
		{
			"uri": "PineTrunk_DIFF.dds"
		},
		{
			"uri": "PineTrunk_NORM.png"
		},
		{
			"uri": "PineTrunk_NORM.dds"
		}
	],
	"materials": [
		{
			"emissiveFactor": [
				0.007843137718737125,
				0.007843137718737125,
				0.007843137718737125
			],
			"extensions": {
				"ULTRA_extended_material": {
					"shaderFamily": "PBR",
					"shadow": true,
					"tessellation": false
				}
			},
			"normalTexture": {
				"index": 1
			},
			"pbrMetallicRoughness": {
				"baseColorTexture": {
					"index": 0
				},
				"metallicFactor": 0.0,
				"roughnessFactor": 1.0
			}
		},
		{
			"extensions": {
				"ULTRA_extended_material": {
					"shaderFamily": "PBR",
					"shadow": true,
					"tessellation": false
				}
			},
			"normalTexture": {
				"index": 3
			},
			"pbrMetallicRoughness": {
				"baseColorTexture": {
					"index": 2
				},
				"metallicFactor": 0.0,
				"roughnessFactor": 1.0
			}
		}
	],
	"meshes": [
		{
			"primitives": [
				{
					"attributes": {
						"NORMAL": 2,
						"POSITION": 0,
						"TEXCOORD_0": 4
					},
					"extensions": {
						"ULTRA_mesh_displacement": {
							"DISPLACEMENT": 5
						}
					},
					"indices": 6,
					"material": 0,
					"mode": 4
				},
				{
					"attributes": {
						"NORMAL": 9,
						"POSITION": 7,
						"TEXCOORD_0": 11
					},
					"extensions": {
						"ULTRA_mesh_displacement": {
							"DISPLACEMENT": 12
						}
					},
					"indices": 13,
					"material": 1,
					"mode": 4
				}
			]
		}
	],
	"nodes": [
		{
			"mesh": 0,
			"name": "PineLarge_001"
		}
	],
	"scene": 0,
	"scenes": [
		{
			"nodes": [
				0
			]
		}
	],
	"textures": [
		{
			"source": 0
		},
		{
			"source": 2
		},
		{
			"source": 4
		},
		{
			"source": 6
		}
	]
}

 

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

  • Solution
On 6/25/2023 at 9:27 AM, SpiderPig said:

Also, none of the generated textures want to load in the editors texture viewer.  They all open externally into GIMP.  Only the normals maps load in GIMP, the diffuse maps show the above error.

This seems to be working okay in current build.

  • Thanks 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...