Jump to content
 

Tutorial: Editing Shader Parameters in Yobj


tekken57

Recommended Posts

For those guys trying to use CAW parts or Superstar heads in your mods, you will notice that the objects have a shine which makes the objects look almost plastic. Upon investigation of all the possible causes i.e Color, normals, etc. I determined that the issue was with the parameters which are being passed to the shaders.

 

I touched on shaders in an earlier tutorial and explained the structure of yobj files here:

 

Read that tutorial first before attempting this.

 

As discussed, each object has it's own shader assigned to it e.g ch_skin, ch_gear, etc. This controls how the object appears in game. In addition to being assigned a shader, a number of parameters are passed to the shader to tell it how to display the object, level of sweat, reflections, etc.

 

The problem with caw parts is that each object passes significantly less parameters than the in game wrestler models. I correctly assumed that the parameters which were missing was causing the shine. I tried replacing a number of parameters to isolate the one's which controlled the shine and isolated 8 parameters. Not all may be required but you can experiment and see which one's are needed. 

 

Alright enough background, lets get started:

 

1. Open a wrestler yobj file in X-rey. Find one of the face objects in X-Rey by double clicking it and viewing in the preview window. Once you have a face object, scroll to the right of the row in X-Rey and note down the param offset value. In this case it is 3752 (decimal value).

 

34q7a89.jpg

 

 

2. Open your yobj in your favourite hex editor and navigate to the offset above (3752). At this offset you will be presented will a table of offsets pointing to locations of each parameter. You need to add 8 to the offset listed to get a valid offset for the parameters.

 

The reason why this table exists is because the parameters can be different lengths. The two lengths that I've found is 00x18 (24 bytes) and 00x24 (36 bytes long).

 

If you scroll a bit lower you will notice all the parameters listed. The parameter will contain a name starting with "g_" , a value and a length. You don't need to edit anything in the parameter itself, you will just need to copy the entire parameter.r94i1w.jpg

3. Copy all the parameters into a new file to make it easy to read. You will need to copy values from here into your superstar head.

 

4. Open your superstar head in X-Rey and once again note down the param offset. Open your superstar head navigate to the parameter offset as you did with the wrestler pac. You will need to replace the parameter values here.

 

Initially when testing I was replacing the 24 byte parameters with 36 byte parameters. This required fixing the offsets in the parameter table. This is incredible time consuming. To make things simpler, I have identified the 8 parameters that you will need from your in game wrestler and which one's you can safely replace in the wrestler head.

 

In column one (Titled Replace with), I have highlighted the parameters in green. These are the values you will need to copy from your wrestler yobj. You will notice that the length of each of these is 00x18 (24 bytes) long. Make sure that you copy the entire 24 bytes which contains the name, length and value.

 

Now you need to replace the values in your superstar head. I have highlighted the values which can be safely replaced in blue in column entitled original. Notice that all the values highlighted in blue are also 00x18 (24 bytes) long. The value I highlighted in red is 00x24 (36 bytes) long. Do not replace a 00x24 bytes parameter as you will need to redo the entire offset table.

 

314760k.png

 

 

5. You will need to do this for every single object which has shine that needs to be fixed.

 

6. Save your yobj and use it game as normal.

 

 

This is a fairly advanced tutorial, so take your time when doing so. If the game crashes when a match is loaded, it means that you have messed something up in the offsets table or have not copied the parameters values properly.

 

Post any questions you have in this thread instead of PMing please. My inbox is full of noob questions and gets full very quickly.

 

 

==============================================================================================

 

Part 2 - Fixing WWE 12 models

 

 


1) Download this file: http://www.mediafire.com/download/u9m37jki4m4eebc/ModelFix.dat

2) Open it in a hex editor and copy the entire contents.

3) Open the 0000.yobj of the WWE12 Model you want to fix in HexEditor

4) Find g_fIdMap

5) Select from g_fldMap00_Val until the end of g_fldMap18_Val (as shown in Original below)

28bya2u.jpg

6) Paste the copied data over the orginal.

7) Save

 

Edited by tekken57
Link to comment
Share on other sites

You Are AMAZING MAN Thanks For This Tutorial....This Tutorial Will Be Very Helpful To Every One.....Thanks Again...Can I Test This Tutorial In Any Consule...

Link to comment
Share on other sites

This definitely seems like one of the more trickier things to do. No idea how you'd even figure this out. Thanks for the tutorial as always, man. Hoping to get some time to try this out soon. Before I get started with any CAW parts, I'll take a swing at the '12 models and see if this is the fix we've been looking for.

Link to comment
Share on other sites

@Roman Reigns, yes. The model format is the same on both consoles.

 

@OTE, been looking at the yobj format a lot over the years and figure stuff out as I go along. There's always something new that I missed and discover things over time. This is the reason why I say the format is very complicated as if even a single offset in the file is off, the model does not load. Hence converting old models has been impossible so far.

Edited by tekken57
Link to comment
Share on other sites

Just tried things out with one of the models from '12. Did things right, or at least I thought I did--this isn't exactly my area of expertise--but the game ended up crashing on me. I certainly wouldn't rule things out with '12 models just yet, though. Like I said, there's probably a good chance I may have screwed something up. Tekken and Taker, if either of you guys want to take a look over it, I'll gladly shoot over the .YOBJ I was working with and testing out.

Link to comment
Share on other sites

I quickly took a look at a wwe 12 model this morning. It has all the parameters which are missing in the superstar heads. The only parameter which is missing is "g_fBSSSwtMin".

 

However when I look the parameters listed, it has slightly different parameters. The new models have 

 

g_fIdMapLv0
g_fIdMapLv1
g_fIdMapLv2
g_fIdMapLv3
g_fIdMapLv4
g_fIdMapLv5
g_fIdMapLv6
g_fIdMapLv7
 

 

where as the older models have

 

g_fIdMap00_Val
g_fIdMap01_Val
...
up until

g_fIdMap18_Val

 

These parameters don't exist in the new models. That is what could be causing the shading issues.

 

I doing a test where I am replacing the above shaders as follows, not sure if it will work. Will see this evening:

 

28bya2u.jpg

Edited by tekken57
Link to comment
Share on other sites

Interesting. Looking forward to hearing how things turn out. If that's the case, then it makes sense why things went wrong for me. I was just (rather blindly, as I don't deeply understand it all) replacing the first seven parameters listed in blue from the 'original' column within the '12 .YOBJ with the seven highlighted 'replace with' ones from the 2K14 model.

Link to comment
Share on other sites

If you think tekken57 is the man, gimme a hell yeah!!!!

 

scb0i8.jpg

Awesome. Now i will finally use wwe 12 model in wwe 2k14 :)

I hated to have the shine on the models

Link to comment
Share on other sites

Amazing! Looking forward to seeing what new mods can come from this method. This game has been completely blown open the last couple of months especially. You guys have all done some phenomenal work to get to this point.

Link to comment
Share on other sites

The good news is that, unlike the superstar heads, you only need to fix the parameters in one of the objects in the yobj file. All the other objects are automatically fixed.

 

Will look into adding the functionality to fix the files in X-Rey at some point in the distant future, but for now I'm taking a break from coding and modding. Feeling really tired.

Link to comment
Share on other sites

Thanks a lot!!!! It's time to fix our wwe12 models!!!. Rooster could you post a small tuto? Thanks a lot

1) Download this file

2) Open it in a hex editor and copy the entire contents.

3) Open the 0000.yobj of the WWE12 Model you want to fix in HexEditor

4) Find g_fIdMap

5) Select from g_fldMap00_Val until the end of g_fldMap18_Val (as shown in Original below)

28bya2u.jpg

6) Paste the copied data over the orginal.

7) Save

Edited by Red Rooster
Link to comment
Share on other sites

Shit, i can't find the g_fldMap value .

I did that.

 

Open pac file and extract the pach file

Open the pach file and uncompress the 0000.bpe file

Rename 0000.bep file to 0000.yobj file

Open 0000.yobj  file with hex editor

 

I know i am making a mistake , but where?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Terms of Use Privacy Policy Guidelines We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.