JAWSFreelao Posted November 8, 2015 Share Posted November 8, 2015 I can't get a good shader for it- either the color is too full and it looks like an ugly painted on sheet of orange or 100% transparent. Link to comment
mrwonko Posted November 9, 2015 Share Posted November 9, 2015 What exactly are you trying to achieve? Link to comment
JAWSFreelao Posted November 9, 2015 Author Share Posted November 9, 2015 I'm trying ti make the visor on my "Domino Squad" skins to be only partially alpha. That way the orange hue shows up but you can still see the face underneath. Link to comment
Kualan Posted November 9, 2015 Share Posted November 9, 2015 I think I reverse-engineered the Rebel Pilot's visor when it came to making my own Domino Squad skin. See if that helps. Link to comment
JAWSFreelao Posted November 9, 2015 Author Share Posted November 9, 2015 Still nothing but here's what I have. models/players/clonetrainees/comhelm{ { map models/players/clonetrainees/comhelm rgbGen lightingDiffuseEntity } { map models/players/clonetrainees/comhelm blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA detail rgbGen lightingDiffuse }} Link to comment
mrwonko Posted November 9, 2015 Share Posted November 9, 2015 The shader stages are rendered in the order of definition: First the one without a blendFunc (which defaults to standard opaque rendering), then the one with GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA (which does alpha blending according to the texture's alpha channel). You'll want to drop the first one. Now with alpha blending you run into sorting issues; because Quake 3 does not properly sort transparent surfaces before rendering stuff they may actually look like their order is reversed (the further one is displayed in front of the closer one). That's why you so often see additive blending - GL_ONE GL_ONE - because addition is commutative, so order doesn't matter. But I think additive blending is what you described as "ugly painted sheet of orange". To work around this you can manually specify the sort order; Opaque stuff gets "sort opaque", which is equivalent to "sort 3", while transparent stuff defaults to "sort additive", which equals "sort 9". Surfaces are drawn low number to high number. Now you can give it "sort banner", which is "sort 6", to make it always draw between opaque and default transparent things. Assuming you can only see the model's face through the visor and not transparent level geometry behind the model, this will always look right. So that's something like this: models/players/clonetrainees/comhelm { sort banner { map models/players/clonetrainees/comhelm blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA rgbGen lightingDiffuse } } I also dropped the "detail", which would make it not show up when r_detailTextures is disabled. This is purely theoretical and untested, mind. And your texture needs to have a proper alpha channel, so you'll have to edit it to add that. Unless you want uniform transparency, in which case you can add an "alphaGen const 0.3" to the stage to make it 30% opaque. (Tweak number as necessary, obviously.) Kualan likes this Link to comment
JAWSFreelao Posted November 9, 2015 Author Share Posted November 9, 2015 Mr Wonko needs to marry me so that way nobody else can have his technical assistance. Link to comment
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