Skip to main content
GameDev.net gamedev.net
🔒 Locked

Does u,v,w texture mapping exist?

Started by lucky6969b Dec 18, 2017 at 1:17 AM 8 replies 1.3k views
Original Post
lucky6969b
lucky6969b

For mapping a cubemap texture, do we need 3 texture coordinates like u,v and w. I can't seem to find such a thing in DX9 documentation?

Without the third element, can we index a mesh into the center of it, or anywhere between?



	{0, 12, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0},
	


to



	{0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0},
	


Thanks

Jack

lucky6969b
lucky6969b

Thanks buddy

Nypyren
Nypyren
59 minutes ago, Hodgman said:

Cube textures aren't flat; cube textures are a cube. The texture coordinate is a 3D vector pointing in the direction of the texel you'd like to sample...

I stand corrected. :) It looks like the vector-to-sampler-address step is done for us.

Using Hodgman's hints, I found this which seems relevant: https://msdn.microsoft.com/en-us/library/windows/desktop/bb204881(v=vs.85).aspx

lucky6969b
lucky6969b

But how to tell the difference between u,v and u,v,w in this case?


DWORD VertexPosNormTexFVF = D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX0;



When I clone a mesh to create room for Texture coordinates, and I specify this, it gives me u,v only.
When I lock the vertex buffer and see the inside, I find the vb somehow get overrun?
Thanks
Jack
LorenzoGatti
LorenzoGatti
2 hours ago, lucky6969b said:

When I clone a mesh to create room for Texture coordinates, and I specify this, it gives me u,v only.

Do you expect your mesh to contain 3D texture coordinates? It doesn't seem likely.

Omae Wa Mou Shindeiru
lucky6969b
lucky6969b

Sorry, I overwrote the texture buffer instead, and I've already cloned the mesh... but a new problem arises,

when I map the volume texture over a box, what I get is a "block" of fire, do I change the vertex buffer to get a better look of fire inferno?

Thanks

Jack

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.