Jump to content

Jedi Academy turned 20 this year! We celebrated in a ton of different ways: mod contest, server event, podcast, etc. Thank you to all who have been a part of this game for the last two decades. Check out the anniversary content!

Read more

Welcome to JKHub

This community is dedicated to the games Star Wars: Jedi Outcast (2002) and Jedi Academy (2003). We host over 3,000 mods created by passionate fans around the world, and thousands of threads of people showcasing their works in progress and asking for assistance. From mods to art to troubleshooting help, we probably have it. If we don't, request or contribute!

Get started

This game turned 20 years old this year, and it is still one of the greatest Star Wars games of all time. If you're new or returning from a long hiatus, here are the basics of getting started with Star Wars Jedi Knight Jedi Academy in 2023.

Read more

Custom RGB Shaders


Crazy Assassin

This tutorial is meant to teach you how to use the RGB system in your skin. This also shows you how to add tint presets to the SP species menu.

Tools you'll need

  • Notepad
  • Image editing software, such as GIMP

//Oh, hey there!
//This tutorial is in the process of being rewritten, so what you see here is actually a work in progress,
//about 95% complete.

In this tutorial, I will attempt to show you how to enable custom tinting through shaders, as found on the single-player skins.

Before we begin, we're going to need a skin to actually use this on. For this tutorial, we'll use the Shadowtrooper, and make his chest crystal use custom tinting.

 

ery3VgH.jpg
The texture we're modifying.

 

ygds8bP.jpg
The new 'base' texture.

 

R0pZsbb.jpg
The crystal. Note how it is desaturated (grayscale). This is crucial.

RGB tinting is handled shader-side, in the rgbGen modifier. There are two possible modes that follow rgbGen: Entity, and lightingDiffuseEntity. 'rgbGen lightingDiffuseEntity' results in tinting with normal lighting, while 'rgbGen Entity' forces the stage to full-bright.

The 'default' shader. (Pre-tint support)

 

 

 

models/players/shadowtrooper/accessories
{
{
map models/players/shadowtrooper/accessories_rgb1
rgbGen lightingDiffuse
}
{
map models/players/shadowtrooper/accessories_rgb2
blendFunc GL_ONE GL_ONE
rgbGen lightingDiffuse
}
}

Our new shader, with a dull crystal.

models/players/shadowtrooper/accessories
{
{
map models/players/shadowtrooper/accessories_rgb1
rgbGen lightingDiffuse
}
{
map models/players/shadowtrooper/accessories_rgb2
blendFunc GL_ONE GL_ONE
rgbGen lightingDiffuseEntity
}
}

Glowing crystal.

models/players/shadowtrooper/accessories
{
{
map models/players/shadowtrooper/accessories_rgb1
rgbGen lightingDiffuse
}
{
map models/players/shadowtrooper/accessories_rgb2
blendFunc GL_ONE GL_ONE
rgbGen Entity
glow
}
}

Great, we just made a colorful crystal. But that's not all we can do. You know how in the SP species selection menu, there's a row of solid-color icons above Frankenstein's body-part bins? Notice how most custom SP skins only have one? Well, I'm gonna show you how to make those.

If you've worked with SP skins before, you should be familiar with 'playerchoice.txt'. If not, go read an SP skin tutorial, there's too much for me to cover here.
This is what you will find inside for most custom SP skins:

*white
{
setcvar ui_char_color_red 255
setcvar ui_char_color_green 255
setcvar ui_char_color_blue 255
}

At a glance this may seem cryptic, but it's not. The '*white' header is actually a shader path. Moreover, this entire block can be copied and pasted with different headers to create multiple color options.

For instance:

models/players/shadowtrooper/uired
{
setcvar ui_char_color_red 255
setcvar ui_char_color_green 0
setcvar ui_char_color_blue 0
}

This could be added to the file, and suddenly you could pick white or red for your skin in the SP species selection menu. Be warned though: The SP menu can only fit up to 9 colors at once.

But of course, this alone isn't enough. Like I said, the header is a shader path. We need an actual shader to match. We have two options here: The space-saver method, and the super-fancy-schmancy method. The super fancy method is a shader complete with an image, while the space saver method is just a shader, using textures included in the game already.

Space-Saver method:

models/players/shadowtrooper/uired
{
{
map $whiteimage
rgbGen const ( 1.000000 0.000000 0.000000 )
}
}

Done! That was easy, wasn't it? Nice and simple, and no texture to pack up with the rest of the mod.

Since the fancy method involves its own image, your shader complexity depends on how complex the image is. If it's a simple, flat, still image, then you'll have a simple and short shader. If you've got something complex lined up that involves a more animated piece, you're going to have a slightly more complex shader. Whatever you do, remember it's going to be squeezed into a 32x32 pixel area.


User Feedback

Recommended Comments

There are no comments to display.



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