Jump to content

Need help with creating a shader for my custom hilt


Recommended Posts

Posted

Hello guys!

 

A week ago, a friend made me a custom hilt, where as I did the texturing. I'm very pleased with the result :)

Below, you can see how it looks in Modview:

 

Pre-FX-Saber.png

 

Now, ingame it looks a bit dark overall, so I was thinking of adding some nice effects to it by creating a shaderfile.
 

My request: I would like to add yellow glow to the gold parts, so that they would stand out. Besides that I would also like to add some red glow to the aurebesh text & red buttons. 

 

The funny thing is that I'm able to add glow to my playermodel. I kept the same layout, but changed the foldernames but that didn't work. I also tried looking at other people's shaderfiles and therefore altered mine, but yet again same result.

That's why I am here to ask you guys for help. it doesn't seem that difficult, but I just don't know how to do it :(

 

Incase someone wants to do it or just want to take a look at the pk3 file:

Download link: https://ufile.io/p3ye6 (pk3 already consists out of glow and spec file)

 

 

 

Greetings

PreFXDesigns

 

Posted

I took a look at it, but before I hand out the solution:

I often browse this page from my phone and can't really troubleshoot pk3 files on the go, especially with shaders or other text based files that cause you trouble you could just post them here in spoiler and code tags.
That way whoever is going to try and help you solve your problem can just look right at what's causing the problem.
 

A more detailed description of the problem would have been great aswell, because I had no clue what to expect when I downloaded and dropped the file in my basefolder.

It could have been anything from "the shader does nothing" to "It doesn't look as I wanted it to".

 

Knowing what type of problem you're looking for can be a tremendous help.

 

Anyway, now onto fixing the issue:

 

The guy that made this hilt model for you used \ instead of / when specifieing the shaderpaths for the model, because of this the game doesn't find your shader for that texturepath.

 

So the shaderpath in your .shader file was: 

models/weapons2/saber_pre/prehilt

While the .md3 file is looking for:
 

models\weapons2\saber_pre\prehilt

In theory this shouldn't cause any issues but for some reason it does in games absed on this engine, I guess it was an oversight during coding.

The fix is to just replace / with \ in your .shader file, like so:

 

 

models\weapons2\saber_pre\prehilt
{
    q3map_onlyvertexlighting //You don't actually need this line, this is information for q3map2 when compiling a map, so unless this saberhilt is on display as a misc_model entity in some map you don't need it. 
    {
        map models\weapons2\saber_pre\prehilt
        rgbGen lightingDiffuse
    }
    {
        map models\weapons2\saber_pre\prehilt_glow
	BlendFunc GL_ONE GL_ONE_MINUS_SRC_COLOR
        rgbGen identity
	glow
    }
}

 

 

PreFXDesigns likes this
Posted

Thank you for your response AshuraDX, I appreciate your help :)  In the future I will try to be more specific about the problem aswell.

 

Now back to the topic; I replaced the / to \ but I now I got this:

https://i.postimg.cc/hjRbL0RF/menu-error.png

 

I even tried to copy yours, incase I made a typo in the shaderfile, but still same result. Maybe there is a problem inside the glm file? 

When removing the shader the error dissapears.

Posted

Thank you for your response AshuraDX, I appreciate your help :)  In the future I will try to be more specific about the problem aswell.

 

Now back to the topic; I replaced the / to \ but I now I got this:

https://i.postimg.cc/hjRbL0RF/menu-error.png

 

I even tried to copy yours, incase I made a typo in the shaderfile, but still same result. Maybe there is a problem inside the glm file? 

When removing the shader the error dissapears.

Show us the screenshot of the txt file. Dont show us the text.

Posted

@@PreFXDesigns

WTF

How did you manage to fuck up your main Menu while editing the .shader file for your saber?

Did you replace / with \ in ALL shader files in your basefolder?

Nope, sometimes happens when the shaderfile is fucked up :D

 

 

Thanks you so much Daedra! This was effect/result, that I was looking for :)

 

"and fixed a file path in the glm model." Could you be more precise, so that I can tell this to my friend who made the hilt :)

Siegfried likes this
Posted

Nope, sometimes happens when the shaderfile is fucked up :D

 

 

Thanks you so much Daedra! This was effect/result, that I was looking for :)

 

"and fixed a file path in the glm model." Could you be more precise, so that I can tell this to my friend who made the hilt :)

 

8cbedd3d8bdb35d71e0333d6bb2b02f8.png

 

Changed the \ to /.

Siegfried and PreFXDesigns like this

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...