Jump to content

FULL RGB Lightsaber Colors (no transparency)


Recommended Posts

Posted

Yup that's right! Another question thread by yours truly! :winkthumb:

 

Today's question is...... whether or not it is possible to enable "dark" RGB colors? I don't know if there's a term for this, but basically a way to include the spectrum of RGB that produces darker colors (dark brown, black, etc). Normally for the various RGB saber mods I've seen, lowering the numbers down to a certain point doesn't make it darker but instead it changes the transparency until the glow is completely invisible. I understand this is most likely done on purpose, but regardless it also means that this isn't true RGB... in reality it is only half RGB imo. That being said... is it possible to change this? If so, would this be a bad idea? It must be possible to some extent, since I've added darker saber colors myself manually the old fashioned way in the past... and of course there's those black sabers floating around in many different mods so it must be possible based on this right? If anyone has any good input, please let me know!

Posted

have you ever seen dark brown light?
A darker light color means a less intense and therefore less visible light.

The saber glows are drawn onto the scene additively, which means that it basically adds the color of the pixels that shape the lightsaber glow ontop of what it has allready drawn. A dark saber core would be subtracted from the scene.

SaimonJ likes this
Posted

Hmm, while that makes 100% perfect sense IRL... on the other hand have you ever seen black light? I haven't seen IRL, but I have seen in JK3 mods cause apparently that's perfectly fine lol! But dark blue or dark brown? Holy S**T that's just too much!!

 

Point is, its unofficial mods for a videogame based on a non-fictional magical sci-fi movie series... I don't think that it has to be completely realistic haha!

Posted

Hmm, while that makes 100% perfect sense IRL... on the other hand have you ever seen black light? I haven't seen IRL, but I have seen in JK3 mods cause apparently that's perfectly fine lol! But dark blue or dark brown? Holy S**T that's just too much!!

 

Point is, its unofficial mods for a videogame based on a non-fictional magical sci-fi movie series... I don't think that it has to be completely realistic haha!

you can get full RGB colorable sabers. But the darker variants won't support dynamic glow.

All you'd need to do is setup new pure white saber textures and put the original, desaturated saber texture into your new texture's alpha channel. Once that is done all you'd have to do is write the accompanieing shader to rely on the alpha channel instead of luminance for transparency and voila, you got full RGB sabers

RecklessJames likes this
Posted

@@AshuraDX A little unrelated to the original question of this thread but since its still RGB colors + shaders I may as well throw this here too, since I'm having a bit of trouble atm (instead of making an entirely new thread lol.)

 

I'm also using AJL's SFX Lightsabers and I'm trying to create a 2nd selection of RGB colors, but with a black core instead of a white core. I'm very very close to succeeding after tons of trial and error with setting everything up within

the source code and having to go back and forth with my shader file settings... atm I have this:

 

RANZFj1.jpg

 

Very close to working, except that the glow seems to disappear when over certain textures and surfaces... I have yet to figure out a proper way to fix this.

The shader is setup like this:

gfx/effects/sabers/black/blackrgbglow
{
    nopicmip
    cull twosided
    {
        map gfx/effects/sabers/rgb_glow2.tga
        blendFunc GL_DST_ALPHA GL_ONE_MINUS_DST_COLOR
        alphagen vertex
        rgbGen vertex
        glow
    }
}

gfx/effects/sabers/black/blackrgbline
{
    notc
    nopicmip
    cull twosided
    {
        map gfx/effects/sabers/black/black_line.tga
        blendFunc GL_DST_COLOR GL_ONE_MINUS_SRC_ALPHA
        alphagen vertex
        rgbGen vertex
    }
}

My ultimate goal (and related to this thread) is to have two sets of RGB blade colors; one with black core and the other with white core, both with full RGB range! (so that if you also wanted pure 100% black or pure 100% white, you can do that too) After

I fix this issue here and also enable full RGB colors, I'll be two steps closer! Maybe a bit too ambitious for me, considering I'm still very new to coding and modding in general... but hey I'm trying to learn as I go I guess!  lol

Asgarath83 and TheWhitePhoenix like this
Posted

@@AshuraDX A little unrelated to the original question of this thread but since its still RGB colors + shaders I may as well throw this here too, since I'm having a bit of trouble atm (instead of making an entirely new thread lol.)

 

I'm also using AJL's SFX Lightsabers and I'm trying to create a 2nd selection of RGB colors, but with a black core instead of a white core. I'm very very close to succeeding after tons of trial and error with setting everything up within

the source code and having to go back and forth with my shader file settings... atm I have this:

 

RANZFj1.jpg

 

Very close to working, except that the glow seems to disappear when over certain textures and surfaces... I have yet to figure out a proper way to fix this.

The shader is setup like this:

gfx/effects/sabers/black/blackrgbglow
{
    nopicmip
    cull twosided
    {
        map gfx/effects/sabers/rgb_glow2.tga
        blendFunc GL_DST_ALPHA GL_ONE_MINUS_DST_COLOR
        alphagen vertex
        rgbGen vertex
        glow
    }
}

gfx/effects/sabers/black/blackrgbline
{
    notc
    nopicmip
    cull twosided
    {
        map gfx/effects/sabers/black/black_line.tga
        blendFunc GL_DST_COLOR GL_ONE_MINUS_SRC_ALPHA
        alphagen vertex
        rgbGen vertex
    }
}

My ultimate goal (and related to this thread) is to have two sets of RGB blade colors; one with black core and the other with white core, both with full RGB range! (so that if you also wanted pure 100% black or pure 100% white, you can do that too) After

I fix this issue here and also enable full RGB colors, I'll be two steps closer! Maybe a bit too ambitious for me, considering I'm still very new to coding and modding in general... but hey I'm trying to learn as I go I guess!  lol

You should share this with KOTF, JKA Enhanced and even MD2 Remastered. I mean, you're being very LEGENDARY here with your ambitions, so don't give up! :D

RecklessJames likes this
Posted

You should share this with KOTF, JKA Enhanced and even MD2 Remastered. I mean, you're being very LEGENDARY here with your ambitions, so don't give up! :D

 

Thank you very much I appreciate that! I was determined to edit aspects of the game that you normally couldn't without coding, especially cause merging aspects of my favorite mods became difficult cause you couldn't combine things like .dlls and .exes. Meaning I couldn't have my NPC limits increased mixed with the most recent OpenJK, or increased dismembering, or RGB Lightsabers, and many other things. So I simply decided to learn how to build/compile from scratch within a month lol! Rapidly I've learned alot, and I definitely want to keep pushing to see what else I'm capable of adding into the game.  :)  JKA Enhanced is actually the main source code I'm editing. I'll most likely share my edits when done!

 

While on the subject, I even experimented with colored cores too at one point. lol

 

UawudfW.jpg

 

ejHc1s7.png

Penekowski and TheWhitePhoenix like this
Posted

Very close to working, except that the glow seems to disappear when over certain textures and surfaces... I have yet to figure out a proper way to fix this.

The shader is setup like this:

It seems to be doing that whenever the glow goes over a patch or a model in the map. Patches are mostly used for round surfaces like you showed in your screenshots. It's also used for the water in Yavin.

RecklessJames likes this
Posted

Yeah unfortunately I'm still relatively new when it comes to shaders. Normally I try to use this website to help me in the past but no luck so far regarding this one. At this point I've now been reduced to throwing random shader settings at it and seeing what happens, lol.... I wish there was a program or something that lets you preview exactly what certain shader settings do, instead of me having to load up the game and exit over and over which is what I've been doing so far.

Posted

Yeah unfortunately I'm still relatively new when it comes to shaders. Normally I try to use this website to help me in the past but no luck so far regarding this one. At this point I've now been reduced to throwing random shader settings at it and seeing what happens, lol.... I wish there was a program or something that lets you preview exactly what certain shader settings do, instead of me having to load up the game and exit over and over which is what I've been doing so far.

There is a toold called ShaderED - it serves well as a shader viewer, allthoguh it doesn't like the "glow" parameter and removes it on loading the file.

 

about your shader, try this:

gfx/effects/sabers/black/blackrgbglow
{
	nopicmip
	cull twosided
	{
		map gfx/effects/sabers/rgb_glow2.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		//alphagen vertex should not be needed, I'd suspect that this will again link transparency and color
		rgbGen vertex
		glow
	}
}

gfx/effects/sabers/black/blackrgbline
{
	notc
	nopicmip
	cull twosided
	{
		map gfx/effects/sabers/black/black_line.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		//alphagen vertex should not be needed, I'd suspect that this will again link transparency and color
		rgbGen vertex
	}
}

I have never messed with RGB sabers from a mod so this may or may not work. but:

blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA

This is what I commonly use when I need soft edged alpha/transparency, so I think it might work here.

RecklessJames likes this
Posted

I appreciate the help, but unfortunately it did not work...

WRz48Ja.png

interesting. send me the images and your modified .exe, I'll need to mess around with this

Posted

interesting. send me the images and your modified .exe, I'll need to mess around with this

Ah, just the .exe? Sure I'll do that... lol, but I might also need to include other files too tbh (like .dlls) along with the shaders. As I mentioned earlier, the source code I'm working on uses ASL's SFX Lightsabers... and specifically a version of JA: Enhanced by Redsaurus. For the black core to be enabled, it uses a special command "sabercrystal 1 blackrgb" to activate it, and then "sabercolor 1 a" to give it a red RGB color (but any will do). The fact that it uses a special SFX setting is most likely why I'm having trouble, haha. But if you're fine with all that, I'll PM a zip in a short moment.

 

Meanwhile, I'll also take a look at that program you mentioned! Thanks for the info on that btw

Posted

Ah, just the .exe? Sure I'll do that... lol, but I might also need to include other files too tbh (like .dlls) along with the shaders. As I mentioned earlier, the source code I'm working on uses ASL's SFX Lightsabers... and specifically a version of JA: Enhanced by Redsaurus. For the black core to be enabled, it uses a special command "sabercrystal 1 blackrgb" to activate it, and then "sabercolor 1 a" to give it a red RGB color (but any will do). The fact that it uses a special SFX setting is most likely why I'm having trouble, haha. But if you're fine with all that, I'll PM a zip in a short moment.

 

Meanwhile, I'll also take a look at that program you mentioned! Thanks for the info on that btw

the files you sent me just end up crashing instantly on loading up a map, I bet I'mm issing more files but I don't really feel like piecing those together from whatever code mods you bashed together into this :D

 

Anyway, I did take a look  at your imagefiles and I have a question: Did you want to try to achieve full RGB colorisation with no effect on transparency with these? If so your textures are setup incorrectly.

 

When I suggested those changes to your shader, I went with the assumption that you would and suggested a blendfunc the requires an alpha channel (transparency) on your textures - which they currently don't have.

Posted

the files you sent me just end up crashing instantly on loading up a map, I bet I'mm issing more files but I don't really feel like piecing those together from whatever code mods you bashed together into this :D

 

Anyway, I did take a look  at your imagefiles and I have a question: Did you want to try to achieve full RGB colorisation with no effect on transparency with these? If so your textures are setup incorrectly.

 

When I suggested those changes to your shader, I went with the assumption that you would and suggested a blendfunc the requires an alpha channel (transparency) on your textures - which they currently don't have.

 

Oh wow... that's odd.  I even tested mine without any other mods and I didn't have any issues like that.  Sorry about that.  Well I'll keep at it I guess.... thanks anyways, lol

Posted

Did you want to try to achieve full RGB colorisation with no effect on transparency with these? If so your textures are setup incorrectly.

Oh yeah I forgot to respond to this. In relation to this, I haven't tested what you had recommended yet cause I was trying to get the other stuff to work first.

Posted

Bring up the console. It should tell you the errors. Try reversing your ALPHA? And yes ShaderED is my favorite to preview shaders.

Posted

Bring up the console. It should tell you the errors. Try reversing your ALPHA? And yes ShaderED is my favorite to preview shaders.

No. There are no "errors" with the shader. The images @@RecklessJames uses simply lack alpha channels, which my shader suggestion depends on.

 

The fact that these glows render behind other semi-transparent surfaces could be a depth issue, which a depthFunc may solve.

Posted

@AshuraDX  Hmm I should try that next. Maybe I'll try converting the images to .tga so they'll have those alpha channels. Relatively easy to do... I guess I'll try that out when I get the chance and will let people know.  :3

Posted

No. There are no "errors" with the shader. The images @@RecklessJames uses simply lack alpha channels, which my shader suggestion depends on.

 

The fact that these glows render behind other semi-transparent surfaces could be a depth issue, which a depthFunc may solve.

 

Okay so here's an update. I took the RGB glow texture and made it into a .tga format with an alpha channel, but it still gives issues when using the shader settings you gave me. Here is what those settings look like for that:

gfx/effects/sabers/black/blackrgbglow
{
    nopicmip
    notc
    cull    twosided
    {
        map gfx/effects/sabers/black/blackrgb_glow2.tga
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        rgbGen vertex
        glow
    }
}

However, in this screenshot I'm holding two colors as you can see..... on the right is red RGB glow and black core, but on the left is red glow with black core (but not RGB) which is using different shader settings entirely:

 

ScuGnIH.png

 

As you can see, I'm able to accomplish what I want if I make individual shaders for each color which has always been the case. But not when using RGB. It's really confusing... and yes, I've tried swapping the settings from the two different colors and that doesn't work either sadly. Here is the shader settings for the color on the left, just as a reference:

gfx/effects/sabers/black/bredglow
{
    nopicmip
    cull twosided
    {
        map gfx/effects/sabers/black/bred_glow2
        blendFunc GL_ONE GL_ONE_MINUS_SRC_COLOR
        rgbGen vertex
        alphagen vertex
        glow
    }
}

Just for the sake of showing everything I've tried, I also went back and tried to use my previous shader settings for black core RGB:

gfx/effects/sabers/black/blackrgbglow
{
    nopicmip
    notc
    cull    twosided
    {
        map gfx/effects/sabers/black/blackrgb_glow2.tga
        blendFunc GL_DST_ALPHA GL_ONE_MINUS_DST_COLOR
        rgbGen vertex
        alphagen vertex
        glow
    }
}

And this is currently the result (same issue as earlier in this thread):

 

fqfGEbr.png

 

So that's all for now.... lol. Also, all examples featured here used the same blackcore texture and shader settings.

  • 1 year 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...