IDirect3dTexture8::CreateTexture() and non-standard textures

IDirect3dTexture8::CreateTexture() and non-standard textures

Post by Eric Bryan » Tue, 09 Jul 2002 16:14:08



I'm trying to create a texture from file (but without
using D3DXCreateTextureFromFileEx) that has a non-power-2
texture size (665x1000x24).

I'm attempting to create a blank texture (via
CreateTexture) and fill in the texture bits. For example:

g_pd3dDevice->CreateTexture( 665, 1000, 0, 0 ,
D3DFMT_A8R8G8B8, D3DPOOL_MANAGED , &g_pTexture )

However, this function ALWAYS fails. Of course,
D3DXCreateTextureFromFileEx works fine on the texture file
(which is a jpeg no less).

Any insight?

 
 
 

IDirect3dTexture8::CreateTexture() and non-standard textures

Post by Kev » Tue, 09 Jul 2002 16:50:17




Quote:> I'm trying to create a texture from file (but without
> using D3DXCreateTextureFromFileEx) that has a non-power-2
> texture size (665x1000x24).

> I'm attempting to create a blank texture (via
> CreateTexture) and fill in the texture bits. For example:

> g_pd3dDevice->CreateTexture( 665, 1000, 0, 0 ,
> D3DFMT_A8R8G8B8, D3DPOOL_MANAGED , &g_pTexture )

> However, this function ALWAYS fails. Of course,
> D3DXCreateTextureFromFileEx works fine on the texture file
> (which is a jpeg no less).

> Any insight?

you set usage to 0 (parameter 4). if you really dont want any flags use 0L.
however for what you want to do I expect it needs to be a render target.

 
 
 

IDirect3dTexture8::CreateTexture() and non-standard textures

Post by Rich [Microsoft Direct3D MV » Tue, 09 Jul 2002 17:15:05


[Please do not mail me a copy of your followup]



Quote:>I'm trying to create a texture from file (but without
>using D3DXCreateTextureFromFileEx) that has a non-power-2
>texture size (665x1000x24).

Does your card support non-pow2 texture dimensions?  Check the caps.

Quote:>g_pd3dDevice->CreateTexture( 665, 1000, 0, 0 ,
>D3DFMT_A8R8G8B8, D3DPOOL_MANAGED , &g_pTexture )

>However, this function ALWAYS fails.

Basic things to check:
- debug runtime installed?  if not, install it
- debug d3dx linked?  if not, link to d3dx8d.lib
- all HRESULTs checked?  if not, check them
- debug level turned up?  if not, turn it up
- no interesting messages in the debug output stream?  if not, its
    because you didn't have the debug runtime installed or didn't link
    with the debug d3dx.
--
Ask me about my upcoming book on Direct3D from Addison-Wesley!
  Direct3D Book <http://www.xmission.com/~legalize/book/>
    izfree: Open source tools for Windows Installer
            <http://izfree.sourceforge.net>
 
 
 

IDirect3dTexture8::CreateTexture() and non-standard textures

Post by Eric Bryan » Tue, 09 Jul 2002 18:44:14


I was trying to avoid installing the debug library, but
explain this: why does D3DXCreateTextureFromFileEx() works
fine? does it scale the texture to a pow2 if the card
doesn't support non-pow2?

Installing the dx8 debug might but a good think, but it
might hurt my quake3/unreal productivity.

>-----Original Message-----
>[Please do not mail me a copy of your followup]



>>I'm trying to create a texture from file (but without
>>using D3DXCreateTextureFromFileEx) that has a non-power-
2
>>texture size (665x1000x24).

>Does your card support non-pow2 texture dimensions?  
Check the caps.

>>g_pd3dDevice->CreateTexture( 665, 1000, 0, 0 ,
>>D3DFMT_A8R8G8B8, D3DPOOL_MANAGED , &g_pTexture )

>>However, this function ALWAYS fails.

>Basic things to check:
>- debug runtime installed?  if not, install it
>- debug d3dx linked?  if not, link to d3dx8d.lib
>- all HRESULTs checked?  if not, check them
>- debug level turned up?  if not, turn it up
>- no interesting messages in the debug output stream?  if
not, its
>    because you didn't have the debug runtime installed
or didn't link
>    with the debug d3dx.
>--
>Ask me about my upcoming book on Direct3D from Addison-
Wesley!
>  Direct3D Book <http://www.xmission.com/~legalize/book/>
>    izfree: Open source tools for Windows Installer
>            <http://izfree.sourceforge.net>
>.

 
 
 

IDirect3dTexture8::CreateTexture() and non-standard textures

Post by Eric Bryan » Tue, 09 Jul 2002 19:19:57


The answer is yes. Checked the surface params at the
output texture from D3DXCreateTextureFromFileEx() is
width=1024, height=1024.

Thanks,
Eric

Quote:>-----Original Message-----
>does it scale the texture to a pow2 if the card
>doesn't support non-pow2?

 
 
 

IDirect3dTexture8::CreateTexture() and non-standard textures

Post by Rich [Microsoft Direct3D MV » Wed, 10 Jul 2002 02:40:37


[Please do not mail me a copy of your followup]



Quote:>I was trying to avoid installing the debug library,

By doing that you are only making things harder for yourself.

Step 1 for every Direct3D developer should be:

    INSTALL THE DEBUG RUNTIME

I can't emphasize this enough.

Not installing the debug runtime is like running a marathon through a
minefield while blindfolded and wearing chains around your ankles.
--
Ask me about my upcoming book on Direct3D from Addison-Wesley!
  Direct3D Book <http://www.xmission.com/~legalize/book/>
    izfree: Open source tools for Windows Installer
            <http://izfree.sourceforge.net>

 
 
 

IDirect3dTexture8::CreateTexture() and non-standard textures

Post by Alex C?t » Wed, 10 Jul 2002 02:58:05


Quote:> Not installing the debug runtime is like running a marathon through a
> minefield while blindfolded and wearing chains around your ankles.

(with a pack of stampeding heffalumps hot on your tail)

    - Alex

 
 
 

IDirect3dTexture8::CreateTexture() and non-standard textures

Post by Philip Taylor [ MS » Wed, 10 Jul 2002 04:41:48


please listen to what Rich is saying.

its my considered opinion that a shop that does not have "run clean on the
debug runtime" as a QA department requirement before signing off to RTM an
application - that shop is not being run professionally.

there is no excuse for not using the tools at hand, and the debug runtime is
one of the best tools for catching problems.

--

Phil Taylor
PM : DirectX SDK, Managed DirectX, Windows XP Inbox 3D screensavers, and a
few more bits and bobs.
http://msdn.microsoft.com/directx
This posting is provided "AS IS" with no warranties, and confers no rights.


> [Please do not mail me a copy of your followup]



> >I was trying to avoid installing the debug library,

> By doing that you are only making things harder for yourself.

> Step 1 for every Direct3D developer should be:

>     INSTALL THE DEBUG RUNTIME

> I can't emphasize this enough.

> Not installing the debug runtime is like running a marathon through a
> minefield while blindfolded and wearing chains around your ankles.
> --
> Ask me about my upcoming book on Direct3D from Addison-Wesley!
>   Direct3D Book <http://www.xmission.com/~legalize/book/>
>     izfree: Open source tools for Windows Installer
>             <http://izfree.sourceforge.net>

 
 
 

1. Loading non standard texture sizes

Hi,

I have problemes loading images with the non standard size. I read that the
standard is a power of 2. My radeon card allows me to read any height but
with a wodth multiple of 8. I also read in the Nehe tutorial the following :

"The image height and width MUST be a power of 2. The width and height must
be at least 64 pixels, and for compatability reasons, shouldn't be more than
256 pixels. If the image you want to use is not 64, 128 or 256 pixels on the
width or height, resize it in an art program. There are ways around this
limitation, but for now we'll just stick to standard texture sizes."

So what are these ways about this limitation ? Any help or link ?

Regards

Nicolas Cadilhac

2. Formatting

3. Non standard windows

4. $$$ Want to beRICH ???

5. Icon Program to Create non-standard Sizes

6. Modify Document Master ???

7. PC Video Cards and non-standard CRT Display Formats

8. Free 3D Models and Public 3D Gallery

9. Compressed .bmp - non standard encoding

10. Standard Abstract (non-geographical/sensor) Data Sets?

11. Can Performer load non-standard iv file?

12. Q: Non standard video on O@ ?

13. Non-standard .IMG files from old Datacopy Xerox Scanners