Page 1 of 1

Applying new shader to an md3 model

Posted: Wed Mar 23, 2011 8:39 am
by Eraser
I was looking for a way to write a new shader (with a new name) for an md3 model, but it appears the reference to the shader that should be used for the model is stored within the md3? Is that correct? Is there an easy way to change these references?

Re: Applying new shader to an md3 model

Posted: Wed Mar 23, 2011 10:08 am
by Eraser
Ah already got it. I've used this tool called md3 compile to change the references to new shaders and that works.

Re: Applying new shader to an md3 model

Posted: Wed Mar 23, 2011 11:56 am
by ^misantropia^
You can also edit the .md3 with a hex editor, the shader name is located at position 272 (110 hex). Just make sure the new shader name is < 64 characters long and ends with a nul byte.

Re: Applying new shader to an md3 model

Posted: Wed Mar 23, 2011 3:13 pm
by obsidian
The simplest way (and without duplicating the model itself) is just to use the entity _remap value:
_remap : Used to remap textures/shaders in the model. To remap all shaders to a given shader, use "*;models/mymodel/mytexture". To remap a specific shader, use "models/mymodel/old;models/mymodel/new".