WMO/M2 Texturing menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    DrGonzo's Avatar Contributor
    Reputation
    145
    Join Date
    Jun 2009
    Posts
    132
    Thanks G/R
    0/60
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    WMO/M2 Texturing

    Reposting due to forum rollback.
    Does anyone have any info/tips with setting textures for objects? Currently just using the first texture for each object. Tried using each respective list but they seem to use numbers out of range.


    Gotta get multitexturing/alpha blending set up to finish terrain
    Last edited by DrGonzo; 08-31-2009 at 07:22 PM.

    WMO/M2 Texturing
  2. #2
    Jadd's Avatar 🐸 Premium Seller
    Reputation
    1515
    Join Date
    May 2008
    Posts
    2,433
    Thanks G/R
    81/336
    Trade Feedback
    1 (100%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I can't help you, sorry...

    But I will say, good work with what you're making, it looks incredible :P

  3. #3
    MaiN's Avatar Elite User
    Reputation
    335
    Join Date
    Sep 2006
    Posts
    1,047
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by FearAndLawyering View Post
    Reposting due to forum rollback.
    Does anyone have any info/tips with setting textures for objects? Currently just using the first texture for each object. Tried using each respective list but they seem to use numbers out of range.


    Gotta get multitexturing/alpha blending set up to finish terrain
    You're sure you're parsing the MOTX and MOMT (for WMO) correctly?
    WMO - WoW.Dev Wiki

    Anyways, can't really help you more without knowing more information.
    Schlumpf can probably help a bit more than me also :P
    [16:15:41] Cypher: caus the CPU is a dick
    [16:16:07] kynox: CPU is mad
    [16:16:15] Cypher: CPU is all like
    [16:16:16] Cypher: whatever, i do what i want

  4. #4
    DrGonzo's Avatar Contributor
    Reputation
    145
    Join Date
    Jun 2009
    Posts
    132
    Thanks G/R
    0/60
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    M2 Example:
    Code:
    //--------------------------
    //Parsing main m2 file
    for(int x=1;x<Model.header.nTextures+1;x++)
    	{
    		TextureDef buf;
    		ReadFile(file, &buf, 16, &read, 0);
    		SetFilePointer(file, buf.ofsFilename, 0, 0);
    		ReadFile(file, &buf3, buf.lenFilename, &read, 0);
    		buf2 = buf3;
    		Model.TextureNames.push_back(buf2);
    		SetFilePointer(file, Model.header.ofsTextures+(x*16), 0, 0);
    	}
    //----------------------------
    //Read texture unit in .skin file
    SetFilePointer(file, skin_header.ofsTextureUnits, 0, 0);
    	TexUnit buf;
    	for(int x=0;x<skin_header.nTextureUnits;x++)
    	{
    		if(!ReadFile(file, &buf,sizeof(TexUnit), &read, 0))//24
    			return false;
    		TexUnits.push_back(buf);
    	}
    //----------------------------
    //Set textures inside function that adds object to d3d part
    //I'm thinking this is where the trouble comes in
    for(int x=0;x<MPQ.Models.size();x++)
    	{
    		for (int y=0;y<MPQ.Models[x].TexUnits.size();y++)
    		{
    			MPQ.Models[x].obj[MPQ.Models[x].TexUnits[y].SubmeshIndex1].texture = MPQ.Models[x].TexUnits[y].Texture;
    			//MPQ.Models[x].obj[MPQ.Models[x].TexUnits[y].SubmeshIndex2].texture = MPQ.Models[x].TexUnits[y].Texture;
    		}
    Hopefully something obvious I'm missing.
    Also, does anyone have any experience with directx for single pass multitexturing? I've found conflicting tutorials on whats possible. Trying to do:
    Stage 0: Base texture
    Stage 1: first alpha
    Stage 2: second texture
    Stage 3: second alpha
    Stage 4: third texture
    Stage 5: third alpha
    Stage 6: fourth texture

    Code:
    else if (Objs[x].subs[z].textured && Objs[x].subs[z].gTexture.size() > 1) // if textured and more than 1 texture
    		{
    			for (int o=0;o<Objs[x].subs[z].gTexture.size() && o<7;o++) 
    				g_pD3DDevice->SetTexture(o, Objs[x].subs[z].gTexture[o]); //loop and set all textures
    
    			
    			g_pD3DDevice->SetTextureStageState( 0, D3DTSS_TEXCOORDINDEX, D3DTSS_TCI_PASSTHRU );
    			g_pD3DDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);// set base texture
    			g_pD3DDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE); //  to first stage
    			g_pD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); // pull alpha from
    			g_pD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);  // texture
    
    			g_pD3DDevice->SetTextureStageState( 1, D3DTSS_TEXCOORDINDEX, D3DTSS_TCI_PASSTHRU );
    			g_pD3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_SELECTARG1); // pull color from
    			g_pD3DDevice->SetTextureStageState(1, D3DTSS_COLORARG1, D3DTA_CURRENT); //  current
    			g_pD3DDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); // pull alpha from
    			g_pD3DDevice->SetTextureStageState(1, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);  // texture
    
    			g_pD3DDevice->SetTextureStageState( 2, D3DTSS_TEXCOORDINDEX, D3DTSS_TCI_PASSTHRU );
    			g_pD3DDevice->SetTextureStageState(2, D3DTSS_COLOROP, D3DTOP_BLENDCURRENTALPHA);//D3DTOP_BLENDTEXTUREALPHA); // pull color from
    			g_pD3DDevice->SetTextureStageState(2, D3DTSS_COLORARG1, D3DTA_TEXTURE); //alpha blend
    			g_pD3DDevice->SetTextureStageState(2, D3DTSS_COLORARG2, D3DTA_CURRENT); //  current
    			g_pD3DDevice->SetTextureStageState(2, D3DTSS_ALPHAOP, D3DTOP_DISABLE); //D3DTOP_SELECTARG1); // pull alpha from
    			g_pD3DDevice->SetTextureStageState(2, D3DTSS_ALPHAARG1, D3DTA_CURRENT);  // current
    
    			g_pD3DDevice->SetTextureStageState(3, D3DTSS_COLOROP, D3DTOP_SELECTARG1); // pull color from
    			g_pD3DDevice->SetTextureStageState(3, D3DTSS_COLORARG1, D3DTA_CURRENT); //  current
    			g_pD3DDevice->SetTextureStageState(3, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); // pull alpha from
    			g_pD3DDevice->SetTextureStageState(3, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);  // texture
    
    			g_pD3DDevice->SetTextureStageState(4, D3DTSS_COLOROP, D3DTOP_BLENDCURRENTALPHA); // pull color from
    			g_pD3DDevice->SetTextureStageState(4, D3DTSS_COLORARG1, D3DTA_TEXTURE);
    			g_pD3DDevice->SetTextureStageState(4, D3DTSS_COLORARG2, D3DTA_CURRENT); //  current
    			g_pD3DDevice->SetTextureStageState(4, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); // pull alpha from
    			g_pD3DDevice->SetTextureStageState(4, D3DTSS_ALPHAARG1, D3DTA_CURRENT);  // texture
    
    			g_pD3DDevice->SetTextureStageState(5, D3DTSS_COLOROP, D3DTOP_SELECTARG1); // pull color from
    			g_pD3DDevice->SetTextureStageState(5, D3DTSS_COLORARG1, D3DTA_CURRENT); //  current
    			g_pD3DDevice->SetTextureStageState(5, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); // pull alpha from
    			g_pD3DDevice->SetTextureStageState(5, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);  // texture
    
    			g_pD3DDevice->SetTextureStageState(6, D3DTSS_COLOROP, D3DTOP_BLENDCURRENTALPHA); // pull color from
    			g_pD3DDevice->SetTextureStageState(6, D3DTSS_COLORARG1, D3DTA_TEXTURE);
    			g_pD3DDevice->SetTextureStageState(6, D3DTSS_COLORARG2, D3DTA_CURRENT); //  current
    			g_pD3DDevice->SetTextureStageState(6, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); // pull alpha from
    			g_pD3DDevice->SetTextureStageState(6, D3DTSS_ALPHAARG1, D3DTA_CURRENT);  // texture
    Sorry some of the comments are off because I c/p'd, but it should still be easy enough to follow. When using all the textures in 1 stage it ignores the base texture, and then just alpha blends the alpha texture so that the ground is transparent.

  5. #5
    MaiN's Avatar Elite User
    Reputation
    335
    Join Date
    Sep 2006
    Posts
    1,047
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have not really puzzled so much with textures (and I suck in C++) but
    Code:
    for(int x=0;x<Model.header.nTextures;x++)
    	{
                    SetFilePointer(file, Model.header.ofsTextures+(x*16), 0, 0);
    		TextureDef buf;
    		ReadFile(file, &buf, 16, &read, 0);
                    if (buf.type == 0) // only do this if it's hardcoded (I think?)
                    {
    		       SetFilePointer(file, buf.ofsFilename, 0, 0);
    		       ReadFile(file, &buf3, buf.lenFilename, &read, 0);
    		       buf2 = buf3;
    		       Model.TextureNames.push_back(buf2);
                    }
    	}
    You have to do some other thing if it's not hardcoded.
    M2/WotLK - WoW.Dev Wiki
    [16:15:41] Cypher: caus the CPU is a dick
    [16:16:07] kynox: CPU is mad
    [16:16:15] Cypher: CPU is all like
    [16:16:16] Cypher: whatever, i do what i want

  6. #6
    suicidity's Avatar Contributor
    Reputation
    207
    Join Date
    Oct 2006
    Posts
    1,439
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you generate your own texture in memory, then set that as your texture; Instead of doing a butt-load of stages?

    Just when you're done with it, kill the texture and Release it.


  7. #7
    DrGonzo's Avatar Contributor
    Reputation
    145
    Join Date
    Jun 2009
    Posts
    132
    Thanks G/R
    0/60
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Got any reference material for that? I've switched over to a multi pass approach, still no luck.

  8. #8
    suicidity's Avatar Contributor
    Reputation
    207
    Join Date
    Oct 2006
    Posts
    1,439
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not right now; Unfortanately, I just reformatted.


  9. #9
    DrGonzo's Avatar Contributor
    Reputation
    145
    Join Date
    Jun 2009
    Posts
    132
    Thanks G/R
    0/60
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Missed the Texture lookup table in the m2's. Fixed the texture ref's in the WMOs. Everything looks correct except the trees, the trunks are textured with the leaves.

    Still having an issue with the terrain not blending correctly, I'm screwing something up somewhere. Guess it's time to start learning about vertex/pixel shaders instead of using fixed pipeline
    Last edited by DrGonzo; 09-04-2009 at 02:38 AM.

  10. #10
    DrGonzo's Avatar Contributor
    Reputation
    145
    Join Date
    Jun 2009
    Posts
    132
    Thanks G/R
    0/60
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Finally got some blending to work. Converted the 4bit alpha to 8bit.
    Code:
    char alpha_buf[4096];
    					int buf_counter = 0;
    					for(int s=0;s<2048;s++)
    					{
    						unsigned char alpha = MPQ.MapChunks[y*16+x].Alpha[MPQ.MapChunks[y*16+x].TextureLayer[o].offsAlpha+s];
    						float temp = float((alpha&240)>>4);
    						temp/=15;
    						temp*=255;
    						alpha_buf[s*2] = unsigned char(temp);
    						temp = float(alpha&15);
    						temp/=15;
    						temp*=255;
    						alpha_buf[s*2+1] = unsigned char(temp);
    					}
    					filename = GenerateAlphaTGA(alpha_buf);


    I'm guessing wow does some general blending/cleanup (shadowmap, lightmap, etc). Any tips appreciated.

  11. #11
    Xeranor's Avatar Member
    Reputation
    71
    Join Date
    Aug 2009
    Posts
    32
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    wow looks w
    awesome but why is the water missing

  12. #12
    DrGonzo's Avatar Contributor
    Reputation
    145
    Join Date
    Jun 2009
    Posts
    132
    Thanks G/R
    0/60
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Haven't got around to it yet. I was having it set the ground to water height with blue vertices but that just made stuff appear flat and ugly.

  13. #13
    DrGonzo's Avatar Contributor
    Reputation
    145
    Join Date
    Jun 2009
    Posts
    132
    Thanks G/R
    0/60
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Ok. Hopefully someone has some advice with the alpha stuff. Maybe someone knows someone who knows something? Moving onto a different aspect until I get an idea to try.

  14. #14
    suicidity's Avatar Contributor
    Reputation
    207
    Join Date
    Oct 2006
    Posts
    1,439
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you looked at tools that render WoW externally?


  15. #15
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are there any public libraries that render .mdx/.m2 models? Terrain? WMO?

Page 1 of 2 12 LastLast

Similar Threads

  1. WMO Texture
    By atlo22 in forum WoW ME Questions and Requests
    Replies: 6
    Last Post: 06-08-2010, 03:42 PM
  2. [HELP] AoI>wmo texturing issue
    By Kino87 in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 04-22-2010, 09:48 AM
  3. [Question] WMO Textures
    By Ravenheart in forum WoW ME Questions and Requests
    Replies: 3
    Last Post: 07-17-2009, 01:04 AM
  4. How to get a WMO fully textured in 3dsmax
    By hitman047 in forum WoW ME Questions and Requests
    Replies: 8
    Last Post: 09-04-2008, 03:01 PM
  5. How to find uot what textures are used in a WMO.
    By -Lex in forum WoW ME Tools & Guides
    Replies: 3
    Last Post: 04-16-2008, 01:07 PM
All times are GMT -5. The time now is 01:30 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search