Texturing Transformed vertices

Texturing Transformed vertices

Post by Fred Dought » Fri, 14 Mar 2003 06:43:40



Is it possible to texture transformed vertices?  My vertex format is
D3DFVF_XYZRHW|D3DFVF_TEXTUREFORMAT2.  When my quad draws its a solid color
that resembles the texture, but its not the full texture map.  Am I doing
something wrong or is it just not possible to texture transformed vertices?

Thanks
-Fred

 
 
 

Texturing Transformed vertices

Post by Guillaume Carre » Fri, 14 Mar 2003 18:54:20


Be sure to have Ure uv coordinate in range [0.0f,1.0f]
and to copy them in the correct shader register ( oT0 ).



Quote:> Is it possible to texture transformed vertices?  My vertex format is
> D3DFVF_XYZRHW|D3DFVF_TEXTUREFORMAT2.  When my quad draws its a solid color
> that resembles the texture, but its not the full texture map.  Am I doing
> something wrong or is it just not possible to texture transformed
vertices?

> Thanks
> -Fred


 
 
 

Texturing Transformed vertices

Post by Rich [Microsoft Direct3D MV » Sat, 15 Mar 2003 02:30:11


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



Quote:>Be sure to have Ure uv coordinate in range [0.0f,1.0f]

The texture coordinates can be outside the range [0,1], based on
the MaxTextureRepeat CAPS.

Quote:>and to copy them in the correct shader register ( oT0 ).

If he's using transformed vertices, a vertex shader isn't run anyway.
--
"The Direct3D Graphics Pipeline"-- code samples, sample chapter, FAQ:
          <http://www.xmission.com/~legalize/book/>
        izfree: Open source tools for Windows Installer
                <http://izfree.sourceforge.net>
 
 
 

Texturing Transformed vertices

Post by Rich [Microsoft Direct3D MV » Sat, 15 Mar 2003 02:29:18


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



Quote:>Is it possible to texture transformed vertices?

Yes.

Quote:>D3DFVF_XYZRHW|D3DFVF_TEXTUREFORMAT2.  When my quad draws its a solid color
>that resembles the texture, but its not the full texture map.  Am I doing
>something wrong or is it just not possible to texture transformed vertices?

Did you call ValidateDevice on your texture stage setup?

There is a lot of inputs that control how texturing is applied.  You
have to get all of them set properly to get the correct results.
--
"The Direct3D Graphics Pipeline"-- code samples, sample chapter, FAQ:
          <http://www.xmission.com/~legalize/book/>
        izfree: Open source tools for Windows Installer
                <http://izfree.sourceforge.net>

 
 
 

1. Transforming texture coords while using transformed vertices

I have this problem. I'using flexible vertex format
(D3DFVF_XYZRHW | D3DFVF_TEX1) with transformed vertices.
My vertex definition is

struct VERTEX {
FLOAT X, Y, Z, RHW; //transformed position for the vertex
FLOAT TU, TV; //texture coords

but I need to use multitexturing with second texture
transformed by matrix. I hoped that I will use

Direct3DDevice->SetTextureStageState(1,
D3DTSS_TEXCOORDINDEX, 1);
Direct3DDevice->SetTextureStageState(1,
D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2);
Direct3DDevice->SetTransform(D3DTS_TEXTURE1, &Matrix);

but DX seems not to transform second texture (ignore my
transformation matrix), probably becouse i'm using
D3DFVF_XYZRHW - transformed vertices. Is this corect? How
can I avoid this problem and force DX to transform my
texture, although i use transformed vertices?
Thanks for help,
Pavel Cernohorsky.

2. I am new one

3. Approximating good texture vertices from 3d vertices

4. Resize of window

5. Quick Close Transform - All vertices

6. maya peeves

7. Transforming Vertices

8. Camera flight problem

9. Vertex Normal and world Transforms

10. Result of transformed vertices

11. How to get the transformed vertices?

12. getting transformed vertices from the transformation pipeline ?

13. Get the coordinate of the transformed vertex?