Jump to content
  • Advertisement
lucky6969b

Does u,v,w texture mapping exist?

Recommended Posts

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

Edited by lucky6969b

Share this post


Link to post
Share on other sites
Advertisement
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

Edited by Nypyren

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!