Ruxith Posted December 29, 2012 Posted December 29, 2012 I'm not much good at creating my own shaders, so upon editing skins i've come to a halt with creating something that I wanted. Making RGB skins has been my "next stage" of learning reskins, and I have figured that out. But now I want to enable a shader which will change depending on the RGB choices. I have done so with a glow shader I already had, but the glow effect and colour intensity is very pale. I was just wondering if anyone had experimented/created something similar in the past and could put me in the right direction as I am unsure if it is part of the code that I have done wrong, or the texture (I followed an existing style and it shouldn't be because of this). I've changed areas both shader and non-shader in the skin, and the area without the glow section has worked fine, so I guess it must be with the code. Below is the screenshot of the shader in-game, and the code I am using; models/players/jedi_kdm/head_2ryo{ { map models/players/jedi_kdm/head_2ryo blendFunc GL_ONE GL_ZERO rgbGen lightingDiffuseEntity } { map gfx/models/jedi_kdm/head_2ryo_glow blendFunc GL_ONE GL_ONE glow rgbGen identity } { map models/players/jedi_kdm/head_2ryo blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA rgbGen lightingDiffuse } { map gfx/models/jedi_kdm/head_2ryo_spec blendFunc GL_SRC_ALPHA GL_ONE alphaGen lightingSpecular }} (Yep, i'm working from ryojin's keldor reskin for anyone who guessed xD ).Thanks in advance for any brave volunteers!
Ruxith Posted February 3, 2013 Author Posted February 3, 2013 *bump*No one has an answer for this? I still haven't been able to figure it out and would appreciate it if someone knew how to do it.
Inyri Posted February 3, 2013 Posted February 3, 2013 Very difficult to troubleshoot shader issues without the actual mod files.
Ruxith Posted February 3, 2013 Author Posted February 3, 2013 True, sorry about that I should've given them initially.Here's the pk3 and the shader in text: http://www.mediafire.com/?mwaaayf581tpe6q models/players/jedi_kdm/head_pic{ { map models/players/jedi_kdm/head_pic blendFunc GL_ONE GL_ZERO rgbGen lightingDiffuseEntity } { map models/players/jedi_kdm/head_pic blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA rgbGen lightingDiffuse } { map gfx/models/jedi_kdm/head_pic_glow blendFunc GL_ONE GL_ZERO glow rgbGen lightingDiffuseEntity } { map gfx/models/jedi_kdm/head_pic_spec blendFunc GL_SRC_ALPHA GL_ONE alphaGen lightingSpecular }} models/players/jedi_kdm/icon_head_h8{ nopicmip nomipmaps { map models/players/jedi_kdm/icon_head_h8 rgbGen identity } { map models/players/jedi_kdm/icon_head_h8 blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA rgbGen vertex }} models/players/jedi_kdm/icon_piccolo{ nopicmip nomipmaps { map models/players/jedi_kdm/icon_piccolo rgbGen identity } { map models/players/jedi_kdm/icon_piccolo blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA rgbGen vertex }}
Inyri Posted February 3, 2013 Posted February 3, 2013 Arrange it in the below order that will help. I also fixed the blendfunc in the glow section. They probably both work, but that's the one I've had the most success with. What kind of glow are you trying to achieve here? Because you've essentially set it up so the eyes are kind of a dull grey. As far as I can tell it's working, it's just not very pronounced. I tested it by changing the color of just the glow map. Not really sure you're going to be able to have a shader be dynamic like you want. models/players/jedi_kdm/head_pic{ { map models/players/jedi_kdm/head_pic blendFunc GL_ONE GL_ZERO rgbGen lightingDiffuseEntity } { map models/players/jedi_kdm/head_pic blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA rgbGen lightingDiffuse } { map gfx/models/jedi_kdm/head_pic_spec blendFunc GL_SRC_ALPHA GL_ONE alphaGen lightingSpecular } { map gfx/models/jedi_kdm/head_pic_glow blendFunc GL_SRC_ALPHA GL_ONE glow } }
Ruxith Posted February 4, 2013 Author Posted February 4, 2013 Thanks for that. On the glow side I don't think it's glowing currently as far as I can see.This is the glow that I am intending, as you can see alongside the comparison with a screenshot from the code you quoted, where the RGB is working but what doesn't seem to be a glow: I did test it myself a couple weeks ago by making a few changes in the code to try and understand what they do, and also having @@Milamber look at a few ideas.I was able to get (what looked to be) the glow working, but it set the head to be completely black, with the RGB eyes glowing (it is dark, but if you up the brightness of the screenshot you can see the red colour has spread around the eyes as it would for a glow); Which used this code: models/players/jedi_kdm/head_pic{ { map models/players/jedi_kdm/head_pic blendFunc GL_ONE GL_ZERO rgbGen lightingDiffuseEntity } { map models/players/jedi_kdm/head_pic blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA rgbGen lightingDiffuse } { map gfx/models/jedi_kdm/head_pic_spec blendFunc GL_SRC_ALPHA GL_ONE alphaGen lightingSpecular } { map gfx/models/jedi_kdm/head_pic_glow blendFunc GL_ONE GL_ZERO glow rgbGen lightingDiffuseEntity }} I assume this is the closest, as the glow is working (when it isn't with other attempts), but I don't know why the head is being set to black as I don't know much about shaders code besides changing the paths. Otherwise this was my end result, and the second pic is milamber's result; both glowing heads but not with the desired effect: This was my first real time experimenting with shaders; usually I copy and paste shaders others have used for the visuals I wanted so I didn't need to play around to learn the code for them. I'm unsure if the texture is the cause as the rgb's work fine for the areas which don't glow and are actually more grey in colour to the _glow texture I have for the eyes. I hope this helps if you are able to do any more with this.
Inyri Posted February 4, 2013 Posted February 4, 2013 Your glow map is not very bright, so you're not going to get a good glow from it unless you increase the brightness.The change I made to the shader should help with the whole thing being black.
Ruxith Posted February 4, 2013 Author Posted February 4, 2013 My glow now is pretty much the same brightness as the normal rgb, but the head is still black and I don't know why. When I add "blendFunc GL_SRC_ALPHA GL_ONE" to the glow texture's shader, with the line for rgb "rgbGen lightingDiffuseEntity" it makes the head transparent and the glow parts are invisible. This is my shader currently; models/players/jedi_kdm/head_pic{ { map models/players/jedi_kdm/head_pic blendFunc GL_ONE GL_ZERO rgbGen lightingDiffuseEntity } { map models/players/jedi_kdm/head_pic blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA rgbGen lightingDiffuse } { map gfx/models/jedi_kdm/head_pic_glow blendFunc GL_ONE GL_ZERO glow rgbGen lightingDiffuseEntity } { map gfx/models/jedi_kdm/head_pic_glow blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA rgbGen lightingDiffuse } { map gfx/models/jedi_kdm/head_pic_spec blendFunc GL_SRC_ALPHA GL_ONE alphaGen lightingSpecular }}
Milamber Posted February 4, 2013 Posted February 4, 2013 I still haven't given up on this yet btw Rux xD I just been busy :<
Ruxith Posted February 4, 2013 Author Posted February 4, 2013 That's cool Mil, I just thought i'd try and get some help from others too, to see if there's a simple solution xDI've finally got it to glow, and the RGB areas to work, but the glow doesnt react to RGB yet. Here's the screenshot and code: models/players/jedi_kdm/head_pic{ { map models/players/jedi_kdm/head_pic blendFunc GL_ONE GL_ZERO rgbGen lightingDiffuseEntity } { map models/players/jedi_kdm/head_pic blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA rgbGen lightingDiffuse } { map gfx/models/jedi_kdm/head_pic_glow blendFunc GL_ONE GL_ONE glow rgbGen identity } { map gfx/models/jedi_kdm/head_pic_spec blendFunc GL_SRC_ALPHA GL_ONE alphaGen lightingSpecular }} For the glow to work and not make the head black, "rgbGen identity" seems to be a requirement, changing it to the same as on the usual RGB shaders to lightingDiffuse or lightingDiffuseEntity doesn't work.
Milamber Posted February 4, 2013 Posted February 4, 2013 If I'm not mistaken one of those two are required for the color though :/
Ruxith Posted February 5, 2013 Author Posted February 5, 2013 Indeed. I have found out that LightingDiffuse sets the alpha's of the texture transparent, LightingDiffuseEntity sets the WHOLE texture space RGB compatible, and adding the two with the glow makes the head black but glow and no RGB xD I'm lost. Maybe the choice of blendfunc's for the 3 separate parts of the shader for the 2 RGB and the 1 to glow are wrong to make them work together, but I wouldnt know :L
Ruxith Posted February 6, 2013 Author Posted February 6, 2013 Well I've managed to get an RGB glow shader working, so i'm halfway there :L the first screenshot is of several screenshots ot show a variation of the colours, and the second is of one to show the overall visual of the glow working with RGB.I guess shaders don't like having RGB twice in the same texture, although it allows 2 different glow's :@
Milamber Posted February 7, 2013 Posted February 7, 2013 Wait didn't you and me already achieve that before? The problem was having the eyes be different besides another glow? ...I don't remember the details of the issue I spent the good hours of an entire day working on :| But I'm sure you already had the glowing rgb done for the rest of the guy >_> Or was that something I did while testing without realizing you needed that for the rest of the body too? Think I'm gonna re-reply to this tomorrow when I'm not too tired to remember.
Ruxith Posted February 7, 2013 Author Posted February 7, 2013 Looking back at your version, yeah that's what you did with the shader. I didn't notice it until now lol.This was just another skin I tested it on, however it still doesn't solve the issue of having 2 RGBs in one texture's shader; one for basic rgb, and another for rgb glow of different parts of the texture.It could either be an issue with the texture, or the blendfunc. Basically, with the additional rgb glow part of the shader, it needs something to make what isn't in the alpha to be transparent (how do I do this?), otherwise it sets the whole texture to rgb glow
Milamber Posted February 7, 2013 Posted February 7, 2013 Right that was the problem, some of the rgb glowing and the rest not. Wonder why I couldn't remember yesterday. Got no new ideas as of right now though >_> will have to give it another shot later.
Ruxith Posted February 8, 2013 Author Posted February 8, 2013 I've finally got the glow to work as intended; should've looked at JKHub's tutorials to begin with!As you can see, the glow for the side shots gives a nice effect, from using the original texture (which was purple) without desaturating it. Also, the head doesn't glow completely, which was bugging me.All I need to figure out now is if it's possible to have 2 RGBs on one texture, as currently it doesn't seem to allow the second one to work, no biggie though as the RGB glow was the main thing that I wanted to figure out.The info was from these tutorials; Key and Crazy Assassin
Solution Ruxith Posted February 8, 2013 Author Solution Posted February 8, 2013 Apologies for the double post, but I have fixed my shader finally! It includes: 2 glow shaders, 2 RGB shaders, 1 spec shader.I looked back at the first RGB tutorial that I looked at when I begun trying to figure out how it was done, back on jk3files, again by Crazy Assassin (big credits go to this guy!).Thankyou Inyri and Milamber for the help you have given to me during this, and i'm gllad I have managed to finally figure it out with your help and the tutorials. Ryojin likes this
Astral Serpent Posted February 8, 2013 Posted February 8, 2013 Oh god, robotic keldors now? Ruxith and Ryojin like this
Milamber Posted February 8, 2013 Posted February 8, 2013 There's no diffuse texture in the eyes :< But it's looking really good though xD Show me how you fixed it on xfire later. EDIT: Looked at it again, just me remembering wrong, nothing wrong with the eyes sorry.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now