Does u,v,w texture mapping exist?

Started by
8 comments, last by JTippetts 6 years, 4 months ago

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

Advertisement

If you mean volume textures, then you need a W.

https://msdn.microsoft.com/en-us/library/windows/desktop/bb206344(v=vs.85).aspx

If you mean a cubemap, then no, the cube texture itself is flat and you only need U and V.

https://en.wikipedia.org/wiki/Cube_mapping#/media/File:Skybox_example.png

Thanks buddy

3 hours ago, Nypyren said:

If you mean a cubemap, then no, the cube texture itself is flat and you only need U and V.

https://en.wikipedia.org/wiki/Cube_mapping#/media/File:Skybox_example.png

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...

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

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
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

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

This sounds like an XY Problem. In this case, your problem sounds like "how do I make good looking fire?" Cube mapping probably isn't the best solution. You might try looking at particle systems instead. Barring that, there is always raymarching a volume texture inside the shader to create a fire effect.

This topic is closed to new replies.

Advertisement