Applying new shader to an md3 model

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

Applying new shader to an md3 model

Post 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?
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

Re: Applying new shader to an md3 model

Post by Eraser »

Ah already got it. I've used this tool called md3 compile to change the references to new shaders and that works.
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: Applying new shader to an md3 model

Post 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.
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Applying new shader to an md3 model

Post 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".
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
Post Reply