[1.10][DX11] Cubic .dds don't work. Bug?

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
mkultra333
Gold Sponsor
Gold Sponsor
Posts: 1894
Joined: Sun Mar 08, 2009 5:25 am
x 114

[1.10][DX11] Cubic .dds don't work. Bug?

Post by mkultra333 »

I have a cube map called "menuspace." It is defined in the material as either a tga or dds, since I have both. I comment out one or the other to swap.

Code: Select all

			texture_unit 
            {
				filtering none
// I uncomment the textures as I test them
				//cubic_texture menuspace.dds combinedUVW
				//cubic_texture menuspace.tga combinedUVW
            }
If I use .tga it works fine. In the log, I see it load like this.

Code: Select all

14:30:37: Texture: menuspace.tga: Loading 6 faces(PF_R8G8B8,1024x1024x1) with 5 generated mipmaps from multiple Images. Internal format is PF_A8B8G8R8,1024x1024x1.
14:30:37: D3D11: Loading Cube Texture, base image name : 'menuspace.tga' with 5 mip map levels
However .dds (compressed as dxt1) won't load, or only loads the first image, depending on what I try. Here's the log.
14:35:24: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource menuspace.dds in resource group QuickResource or any other group. in ResourceGroupManager::openResource at C:\Ogre\Ogre_1_10\OgreMain\src\OgreResourceGroupManager.cpp (line 757)
14:35:24: Error loading texture menuspace.dds. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource menuspace.dds in resource group QuickResource or any other group. in ResourceGroupManager::openResource at C:\Ogre\Ogre_1_10\OgreMain\src\OgreResourceGroupManager.cpp (line 757)
Have tried the alternate naming method in the material.

Code: Select all

			texture_unit 
            {
				filtering none
// I uncomment the textures as I test them.
				//cubic_texture menuspace_fr.dds menuspace_bk.dds menuspace_lf.dds menuspace_rt.dds menuspace_up.dds menuspace_dn.dds combinedUVW
				//cubic_texture menuspace_fr.tga menuspace_bk.tga menuspace_lf.tga menuspace_rt.tga menuspace_up.tga menuspace_dn.tga combinedUVW

            }
This doesn't work at all for the .tga, it's messing up the name and trying to load " menuspace_fr_rt.tga" I get the following:

Code: Select all

14:44:13: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource menuspace_fr_rt.tga in resource group QuickResource or any other group. in ResourceGroupManager::openResource at C:\Ogre\Ogre_1_10\OgreMain\src\OgreResourceGroupManager.cpp (line 757)
14:44:13: Error loading texture menuspace_fr.tga. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource menuspace_fr_rt.tga in resource group QuickResource or any other group. in ResourceGroupManager::openResource at C:\Ogre\Ogre_1_10\OgreMain\src\OgreResourceGroupManager.cpp (line 757)
Using .dds, it doesn't report any error but only one of the images draws, possibly it's using the wrong base name.

Code: Select all

14:46:22: Texture: menuspace_fr.dds: Loading 1 faces(PF_DXT1,1024x1024x1) with 3 generated mipmaps from Image. Internal format is PF_DXT1,1024x1024x1.
14:46:22: D3D11: Loading Cube Texture, base image name : 'menuspace_fr.dds' with 3 mip map levels
So only "cubic_texture menuspace.tga combinedUVW" seems to work.

Edit: Just tried DX9, it crashes and says:

Code: Select all

15:06:57: OGRE EXCEPTION(3:RenderingAPIException): Can't create cube texture: Unspecified error

 in D3D9Texture::_loadCubeTex at C:\Ogre\Ogre_1_10\RenderSystems\Direct3D9\src\OgreD3D9Texture.cpp (line 574)
So are you just not supposed to use .dds in cubemaps?
"In theory there is no difference between practice and theory. In practice, there is." - Psychology Textbook.
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5299
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1280
Contact:

Re: [1.10][DX11] Cubic .dds don't work. Bug?

Post by dark_sylinc »

IIRC you're supposed to use 'texture' and ogre will figure out it's a cubemap from the dds.
Cubic_texture is for manually specifying a cubemap out of many different files
User avatar
mkultra333
Gold Sponsor
Gold Sponsor
Posts: 1894
Joined: Sun Mar 08, 2009 5:25 am
x 114

Re: [1.10][DX11] Cubic .dds don't work. Bug?

Post by mkultra333 »

Hmm... the documentation for 1.8 says to use "cubic_texture" and then either define a single texture that it will be used as the base name for loading 6 different textures, or by naming all six individually.
I've just noticed you can alternately use "texture" and then define the type as "cubic".

http://www.ogre3d.org/docs/manual/manua ... ml#texture

But either way seems to require you specify cubic texturing. Maybe the docs are out of date for 1.10. But then this still doesn't explain the errors, why "cubic_texture menuspace.tga combinedUVW" works but not "cubic_texture menuspace.dds combinedUVW"

Does .dds have some specific cubemap format? I was unaware of that, I'll have to see what I can find. It isn't too important now, I've worked around it with a plain old cube with the .dds textures stuck on it. It was for a distant skybox, although elsewhere I have a .tga cubic reflection map.
"In theory there is no difference between practice and theory. In practice, there is." - Psychology Textbook.
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5299
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1280
Contact:

Re: [1.10][DX11] Cubic .dds don't work. Bug?

Post by dark_sylinc »

These interfaces are old, back from when there was a D3D7 RenderSystem. Microsoft had just licensed S3TC (DXT compression) from S3 to be used with their new dds format.

Traditionally you'd create a cubemap out of 6 separate files, and that's what these interfaces would help you to do (i.e. either you adopt Ogre's suffix naming convention so that all 6 textures are loaded from a base name; or you provide them explicitly).

Then the dds format came with built-in cubemap support. You can literally store all 6 images, including their mipmaps, inside the DDS; and thus Ogre is capable of deducing you're loading a cubemap if the dds header says it's a cubemap. But if you use "cubic_texture" (which predates dds support), you'll be instructing Ogre to load 6 separate files.

You can try "texture myFile.dds cubic" and "texture myFile.dds". One of those two should work.
User avatar
mkultra333
Gold Sponsor
Gold Sponsor
Posts: 1894
Joined: Sun Mar 08, 2009 5:25 am
x 114

Re: [1.10][DX11] Cubic .dds don't work. Bug?

Post by mkultra333 »

Ok, thanks. I'll have to find out how to create the .dds cubemap in the proper single image format. I wonder if nvcompress does it...
"In theory there is no difference between practice and theory. In practice, there is." - Psychology Textbook.
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Re: [1.10][DX11] Cubic .dds don't work. Bug?

Post by Kojack »

AMD have Cubemapgen: http://developer.amd.com/tools-and-sdks ... ubemapgen/
It can convert to and from dds cube maps.

Nvidia's photoshop plugin has cube maps too: https://developer.nvidia.com/nvidia-tex ... -photoshop

The Direct X sdk texture tool can also manually load images onto faces of a cube map and save it out as dds.
(I use it to make custom mip map levels too, like colour coded ones for debugging texture resolution)
User avatar
mkultra333
Gold Sponsor
Gold Sponsor
Posts: 1894
Joined: Sun Mar 08, 2009 5:25 am
x 114

Re: [1.10][DX11] Cubic .dds don't work. Bug?

Post by mkultra333 »

Thanks. I found CubeMapGen the other day, I think I had it years ago but have changed computer since and forgot it.

I usually avoid the Nvidia plugin, although I do have it. At one point I was having some problems with it, it was making buggy .dss textures under some circumstances, or some software I used had problems with with its textures, I can't remember. I mostly use nvcompress.exe with a batch file to make my textures, though it's pretty old now. Unfortunately it doesn't seem to have a cubemap option, but CubeMapGen looks good.
"In theory there is no difference between practice and theory. In practice, there is." - Psychology Textbook.
Post Reply