Seperating shaders on PMI Models using Hex

This if for tutorials and information for the community to use for great works.
Keep them organized now!..
Post Reply
User avatar
Click16
Posts: 1941
Joined: Mon Dec 31, 2007 4:36 am
Location: United States

Seperating shaders on PMI Models using Hex

Post by Click16 »

It has been a while before I wrote a tutorial. The compass shader does not count, so I thought that I might use this one. Any problems or questions can be posted as a comment. :wink:

Before beginning this tutorial, back up your current progress (map). There is a HIGH chance you will break your map.

Lets get to it!

You will need:
3D modeling program of your choice. (I will use 3Ds Max and Misfit Model 3D)
Entity 1.3.3 C PMI Build
Entity Ultimate Edition v1.6 (Or any other entity that won't inject PMI.)
DemonicSandwich's [mode] Plug-in
You will need a model scaled and UV mapped.. If you aren't there, get to that point before using this tutorial.

Method 1: Special Shader Assigning


1) Open a map in Entity UE. I will be using the First Player Battle Rifle model. Here is something you need to understand before you go and do this.

For every shader you will be using, It has to be detached from the main model. The detached part(s) must be saved as a different model section. This doesn't mean you have to save every shader part as a different model, but just save the model planes, merged together as a separate model.

For my case, I am using my Assault Rifle for Halo 2. Here is the weapon.
Image

Here are the display items.
Image

2) If your model has 2 chunks, congrats! Just extract the model to a folder. If not, here is what to do.

Check Parsed and duplicate your model.
Open up the Chunk Cloner and copy the original model's LOD (In my case, fp_smg) and add it to the duplicated model's LOD. (In my case, fp_smg(1)) Do the same for the Parts and do the same for shaders. Clone enough shaders until you have as much as you need. Add meta to the map and you should have a model with two chunks. Extract that.
Image
-I have used the First Player SMG for this example.

Sometimes the model will break, simply get a clean map and try again.

3) Save the gun body over one of the parts (preferably part 1,) and save the separate shaders part over another model chunk (preferably part 2.)

4) Inject your model using Non-PMI.
Image

5) Open your model in the Meta Editor. Find the chunk that you saved the display over, it should be part 0. Select "Part 0" in the section labeled "Sections." Grab the Raw Offset.

Okay, let me explain some things to you,

Each plane/submesh (2 triangle faces joined to make a 4 sided figure is a submesh) will be labeled in the offset if you look at it in HEX. This picture will explain further.
Image

Now that that's clear let's get to assigning the shaders.

6) Open the map in a hex editor. I am using HEX workshop. Go to the offset of you grabbed.
Image

Now lets assign the shaders!
Image

Now if you followed the image, you will end up with something like this:
Image

7) Save changes. Make a backup if you want to.

now lets get the shaders set up!

I will set the shaders randomly so we know what they are when we test.

0: objects\weapons\rifle\battle_rifle\shaders\battle_rifle_metal
1: objects\weapons\rifle\brute_plasma_rifle\shaders\plasma_rifle_current
2: scenarios\shaders\multi\halo\coagulation\coag_water_pool
3: objects\weapons\pistol\needler\shaders\needler_core
4: objects\weapons\pistol\plasma_pistol\shaders\plasma_pistol_current

I will clone chunks to delete the remaining shader chunks.
Image

Link the new model to the weapon's FP model and send the map.

Image

Now you look a the shaders on the model, relink the shaders where they belong swapping the correct things and you will have correct shaders.

Image

8) Now, Inject the model with Entity 1.3.3C PMI Build.

9) Once your model is injected properly, select the non-pmi version of the model. Go to the chunk cloner and copy the separate shaders part (part 0.) Select the PMI model and overwrite part 0 with the separate shaders model.

10) Re-link the shaders, link the model to the weapon and test.

Image


Method 2: Shader Separation on Parts of a Model


If you want separated shaders on a part of the model that needs PMI as well, you need to break the parts that need shader separation off of the main model.

1) Clone Chunks so that the number of parts of a model you have is the same amount of chunks in the model part you have. So if you are using 3 different shaders, you will need different model chunks for each separated part of your model. You will end up with 3 model and LOD chunks. (Follow Step 5 in method 1.)

2) Inject with PMI Entity. Open each separated shader section in the meta editor. Grab the raw offset. Do the same for any others you might have.

3) Open the map in a Hex Editor. Go to the offsets. Where it says "0200 0300 00" (crsr......)

The last "00" in hex is where you will put your shader index. Like lets say I want to use the shader index 4, it will look like this "0200 0300 04" but in the text part it will appear like this

Link the shaders to the proper indexes and test your mode. I will update this soon, I'm just a bit tired -_-.

If everything checks out, your model's body is PMI while the shaders are separated, you have successfully separated shaders on a PMI model.

Enjoy!

Credits
DemonicSandwich - Teaching me how to do everything above. :lol:
JacksonCouger - for being annoying. Lol, no he helped a little bit.
Last edited by Click16 on Wed Jun 24, 2009 3:45 pm, edited 3 times in total.
Image
User avatar
DemonicSandwich
Trollwich
Posts: 1620
Joined: Sat Dec 08, 2007 9:47 pm
Location: I...huh...I don't really know. x.x

Re: Seperating shaders on PMI Models using Hex

Post by DemonicSandwich »

I taught you allot more than using a hex editor. :lol: I taught you nearly the entire process you posted above. (¬_¬)
Informative none the less.
Model Customization Pt.01|Model Customization Pt.02|Bipd Attachments|True Marker Rotations
"I'm the h4x man! Skibby Dibby Dib YoDahDubDub, YoDahDubDub"
User avatar
Click16
Posts: 1941
Joined: Mon Dec 31, 2007 4:36 am
Location: United States

Re: Seperating shaders on PMI Models using Hex

Post by Click16 »

DemonicSandwich wrote:I taught you allot more than using a hex editor. :lol: I taught you nearly the entire process you posted above. (¬_¬)
Informative none the less.
what windows alt code are those eyes? "(¬_¬)"
Image
User avatar
DemonicSandwich
Trollwich
Posts: 1620
Joined: Sat Dec 08, 2007 9:47 pm
Location: I...huh...I don't really know. x.x

Re: Seperating shaders on PMI Models using Hex

Post by DemonicSandwich »

Some random unicode I found while searching through Wikipedia.
It's the same characters I used in the code for :¬_¬:
Model Customization Pt.01|Model Customization Pt.02|Bipd Attachments|True Marker Rotations
"I'm the h4x man! Skibby Dibby Dib YoDahDubDub, YoDahDubDub"
User avatar
Click16
Posts: 1941
Joined: Mon Dec 31, 2007 4:36 am
Location: United States

Re: Seperating shaders on PMI Models using Hex

Post by Click16 »

Updated with Pictures.
Image
User avatar
Aumaan Anubis
Staff
Posts: 1812
Joined: Thu Dec 13, 2007 12:18 am
Contact:

Re: Seperating shaders on PMI Models using Hex

Post by Aumaan Anubis »

Moved to Tutorials.
Post Reply