Page 26 of 160

Posted: Sun Feb 14, 2010 11:06 pm
by JensAyton
Griff wrote:
well, you would not believe how hard i found it trying to get the black bits in the decal to show up in the final texture, my brain is melting!
mix(backgroundColor.rgb, decalColor.rgb, decalColor.a)

(It’s easy! All you have to do is memorise this convenient reference card until you can recite it backwards in your sleep!)

Posted: Sun Feb 14, 2010 11:15 pm
by Griff
:D gah, wish i knew that 2 hours ago, that line makes the shader a lot more tidy!
What held me up was trying to work out how to get the decal back from a 'decal adding function' i wrote into the shader to help make multiple copies easier to add, i didn't know how to mix them into the diffuse map without the black going transparent, i couldn't think of anything more advanced than

Code: Select all

colour += decaltexture; 
it looks like this now

Code: Select all

// Full Shader Mode - Apply the decals
   vec4 decals = the_decaliser(Decal1_Scale_and_Position, Decal1_Rotation) + 
                 the_decaliser(Decal2_Scale_and_Position, Decal2_Rotation); // setup the decals

// mix the decals into the texture using the decal alpha as a mask
   vec4 color = mix(colorMap, decals, decals.a) * diffuse;
edit: oh no, i just noticed the decal is being flipped horizontally, i hope that's a feature of Rendermonkey and it'll be the right way around in game

Posted: Mon Feb 15, 2010 9:38 am
by Griff
Can i bother you for another bit of programming help please Ahruman? you wouldn't happen to know of a better way of doing the following bit of code, it's checking the AlertLevel for the players ship and adjusting the colour of the glow maps accordingly, it's a whole bunch of if.. else.. checks in the fragment shader. :shock:
If it will improve the shader, i could probably just check for AlertLevel 3 and change the lighting to red then, otherwise leave the lighting it's usual milky yellow colour, that would at least take out a few of the if else checks

Code: Select all

// check Alert Level, Adjust Lamp Colour Accordingly
 if (alertlevel <= 0) // Docked, Lights 'off' (colour them black) - AlertLevel 0
      { 
      LampColor = vec4(0.0);
      AnimatedLampColor = vec4(0.0);
      } 
 else if (alertlevel <= 2) // Normal light colour - Alert status 1 & 2 (Green & Yellow)
      { 
      LampColor = vec4(0.8444, 0.8304, 0.6161, 1.0);
      AnimatedLampColor = vec4(1.0, 0.8660, 0.3348, 1.0);
      }
 else if (alertlevel > 2) // Red Alert -  Alert Status 3
      { 
      LampColor =  vec4(1.0, 0.1, 0.0, 1.0) * max(mod(uTime, 1.0), 0.5); // pulse the glowmaps intensity level
      AnimatedLampColor = vec4(1.0, 0.8660, 0.3348, 1.0);
      } 

Posted: Mon Feb 15, 2010 9:02 pm
by JensAyton
Here’s an ifless version:

Code: Select all

    const vec4 kLampColorNoAlert = vec4(0.0);
    const vec4 kLampColorYellowAlert = vec4(0.8444, 0.8304, 0.6161, 1.0);
    const vec4 kLampColorRedAlert = vec4(1.0, 0.1, 0.0, 1.0);
    const vec4 kAnimLampColorAlert = vec4(1.0, 0.8660, 0.3348, 1.0);
    
    float alertLevelF = float(alertLevel);
    float yellowAlertSelector = step(1.0, alertLevelF);
    float redAlertSelector = step(3.0, alertLevelF);
    
    LampColor = mix(kLampColorNoAlert, kLampColorYellowAlert, yellowAlertSelector);
    LampColor = mix(LampColor, kLampColorRedAlert, redAlertSelector);
However, I can’t really guarantee it’s better. The cast to a float and step() might actually be harder to optimise than an if-based version; the only way to really know is to test on various low-end hardware under multiple operating systems, and I don’t have a test farm. In lieu of actual data, I’d go with the following simplified if-based version for legibility:

Code: Select all

    if (alertLevel > 0)
    {
        AnimatedLampColor = kAnimLampColorAlert;
        LampColor = (alertLevel > 2) ? kLampColorRedAlert : kLampColorYellowAlert;
    }
    else
    {
        LampColor = AnimatedLampColor = kLampColorNoAlert;
    }

Posted: Tue Feb 16, 2010 10:50 am
by Griff
Thanks for the shader code Ahruman, i've added it in (the simplified if-based version).

Posted: Wed Feb 17, 2010 8:59 pm
by Griff
I've redone the escape capsule so it looks a lot more like it should, the previous one will get a make over and come back as a new Worm remake (as ADCK suggested a few pages back)
Image

Posted: Wed Feb 17, 2010 10:13 pm
by ZygoUgo
Cool. Griff, maybe your original worm could be the worm-miner with a few of the 'ol yellow and black stripes on it.
Then we just need an industrialised/strengthened variant of the Cobbie 1 for its miner :wink:

Posted: Wed Feb 17, 2010 10:17 pm
by JazHaz
Can we have the possibility of shooting the escape capsule and seeing a body left behind in space? :twisted: :twisted: :twisted: :twisted:

I know, I'm evil!! :lol:

Posted: Wed Feb 17, 2010 10:22 pm
by ZygoUgo
Or a glowing disintegrating body :twisted: :twisted: :twisted:
Might have to throw in a few alien bodies for, ahem, realism of course :D
Alas poor Griff, how will he ever get out..

Posted: Wed Feb 17, 2010 10:29 pm
by ADCK
JazHaz wrote:
Can we have the possibility of shooting the escape capsule and seeing a body left behind in space? :twisted: :twisted: :twisted: :twisted:

I know, I'm evil!! :lol:
Thats pretty easy to do, allthough the body wont be animated, and then there's the ever-present issue of scale, there's no agreed upon scale in this game, so what one person might think be the right dimensions for a humanoid, others will think too small/big.

Posted: Wed Feb 17, 2010 10:52 pm
by Commander McLane
ADCK wrote:
JazHaz wrote:
Can we have the possibility of shooting the escape capsule and seeing a body left behind in space? :twisted: :twisted: :twisted: :twisted:

I know, I'm evil!! :lol:
Thats pretty easy to do, allthough the body wont be animated, and then there's the ever-present issue of scale, there's no agreed upon scale in this game, so what one person might think be the right dimensions for a humanoid, others will think too small/big.
And of course the tiny detail that it is absurd to expect that a body could survive intact the explosion that reduced its containment to space dust.

Posted: Wed Feb 17, 2010 11:20 pm
by JazHaz
Commander McLane wrote:
And of course the tiny detail that it is absurd to expect that a body could survive intact the explosion that reduced its containment to space dust.
Ooh thats an idea, lets have the option of decapitated heads floating about? :twisted: :twisted: :twisted: :twisted: :twisted:

Seriously, it would fit with much of the fan fiction... How Rebecca Weston survived her capsule being shot in Status Quo, and the same thing for Alex Ryder in The Dark Wheel.

Posted: Thu Feb 18, 2010 7:34 am
by Diziet Sma
Griff wrote:
I've redone the escape capsule so it looks a lot more like it should, the previous one will get a make over and come back as a new Worm remake (as ADCK suggested a few pages back)
Image
Nice.. but maybe it needs a slightly more metallic look to harmonise with the rest of the ships.. or is it just the camera-angle that makes it look non-shiny?

Posted: Thu Feb 18, 2010 10:08 am
by Griff
I've kept the texture dirt free which always causes me problems, i need to use lots of grime and rivets to cover up all the flaws :lol:
for some reason i couldn't angle it properly to catch a nice specular highlight in rendermonkey, the lighting is always really weird in that program, plus it's such a tiny model you get a weird fisheye lens type distortion going on, i'll try and grab a better screenshot in game, you've gotta be fast though, an adder usually popus up out of nowhere and scoops up the pods when i magic them up outside the station

edit: well, it's safe to say i won't be winning any prizes for my screen shot skills (i've no idea how a_c takes such amazing shots, as soon as i turn off the hud to take the pic i fly past the object or i hear it bounce off the hull :D ), anyway, here's the best i could manage
Image
thinking about it, i could add the fake reflection mapeffect to it, might help sell the surface as being that glossy plastic type stuff these things might be made out of, i could tweak the specular map a bit too - the thinking is that the painted metal bits are more dull than the unpainted bits, i could have got the intensity levels wrong though

Posted: Thu Feb 18, 2010 10:27 am
by bigmike20vt
hi

is this and the boa in the giant griff oxp pack now?

was so impressed with the boa, tho to be honest am not sure if that, or your krait really need to be called that. they have no real visual relation to the parent ships (unlike say the cobra etc which look like very detailed versions of the ships they represent)

you have pretty much made your own <amazing> new ships with those 2.