Jump to content

How can I overwrite a shder defined by JKA without replacing the entire file that contains it?


Recommended Posts

Hello. Before I start, let me point out that I don't know anything about shadering. I do my stuff by observing, reverse-engineering, and copy-pasting, without actually understanding what I'm doing. So I'm sorry if the following question is stupid.
 
I'm trying to make a pack of ported JK2 multiplayer maps to Jedi Academy. I'm about 70% done, however, one of the bugs that I've noticed, and what I'm trying to fix, is caused by JKA itself. The map FFA_Deathstar from JK2 uses a texture: kejim/alpha. JKA does not have this texture, but it has a a shader defined for it in JKA's imperial.shader file:
 

textures/kejim/alpha
{
q3map_nolightmap
    {
        map textures/kejim/alpha
        blendFunc GL_ONE GL_ZERO
    }
}


 
This is different from how it's defined in JK2:
 

textures/kejim/alpha
{
q3map_nolightmap
    {
        map textures/kejim/alpha
        blendFunc GL_DST_COLOR GL_ONE_MINUS_SRC_ALPHA
    }
}

 

 

This difference causes graphical glitches, and the .shader file that I made, which contains the correct shader from JK2, does not seem to overwrite the faulty one from JKA. Is there a way I can force it somehow, or do I have to include a modified version of the imperial.shader file in my addon? I'd rather not do that, I'd rather not overwrite the game's original files if possible, because it would probably have unwanted side effects, such as compatibility issues, ect.

Link to comment

Hmmm the pk3 is called Jk2MPMapPack.pk3, but I'll try putting a Z in front of it. And the shader file too, just to make sure.

 

...

 

Nope, that didn't work.

Just to make it clear. I have the Jk2MPMapPack.pk3, inside it the shaders folder, inside that the Jk2MPMapPack.shader file, which contains the JK2 definition of the kejim/alpha shader, which is in conflict with the same shader's different definition in JKA's imperial.shader file. JKA has no reason to have that shader, because the kejim/alpha texture doesn't even exist in JKA, I had to port it from JK2. My goal is to make the Jk2MPMapPack.shader file overwrite this shader's definition, because the other option would be to include a complete version of JKA's imperial.shader file, but with the part in question rewritten.I don't want to do that, because as I learned, the shader files don't like being rewritten, and this would probably cause compatibility issues with other mods, and maybe even worse.

Link to comment

Hmmm the pk3 is called Jk2MPMapPack.pk3, but I'll try putting a Z in front of it. And the shader file too, just to make sure.

 

...

 

Nope, that didn't work.

Just to make it clear. I have the Jk2MPMapPack.pk3, inside it the shaders folder, inside that the Jk2MPMapPack.shader file, which contains the JK2 definition of the kejim/alpha shader, which is in conflict with the same shader's different definition in JKA's imperial.shader file. JKA has no reason to have that shader, because the kejim/alpha texture doesn't even exist in JKA, I had to port it from JK2. My goal is to make the Jk2MPMapPack.shader file overwrite this shader's definition, because the other option would be to include a complete version of JKA's imperial.shader file, but with the part in question rewritten.

Try putting an a infront of the shader filename. The order in how it loads shaders seems to be reversed.

Link to comment

Huh, did you keep the z infront of the .pk3 name?

No. If it doesn't matter, then it's not needed. If it does matter, J still comes after A, and I have no other addons that could conflict.

 

I think you would have to name it something like "0_<something>.pk3" , just the letter a may not read before assets0.

 

I tried that, also, multiple a's, multiple a's with underscore before the real filename....

Link to comment

No. If it doesn't matter, then it's not needed. If it does matter, J still comes after A, and I have no other addons that could conflict.

 

 

I tried that, also, multiple a's, multiple a's with underscore before the real filename....

I was talking about adding an a to the beginning of the .shader filename.

Link to comment

I was talking about adding an a to the beginning of the .shader filename.

Ok sorry for the confusing post. here's what I've tried so far:

 

Zsomething.pk3

Z_something.pk3

Asomething.pk3

A_something.pk3

Zsomething.shader

Z_something.shader

Asomething.shader

A_something.shader

 

And pretty much all combinations of these pk3 and shader names.

Link to comment
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...