Griff's normalmapped ship remakes

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post 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!)
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2483
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Post 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
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2483
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Post 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);
      } 
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post 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;
    }
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2483
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Post by Griff »

Thanks for the shader code Ahruman, i've added it in (the simplified if-based version).
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2483
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Post 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
User avatar
ZygoUgo
---- E L I T E ----
---- E L I T E ----
Posts: 406
Joined: Mon Nov 17, 2008 4:15 pm
Location: Blighty

Post 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:
User avatar
JazHaz
---- E L I T E ----
---- E L I T E ----
Posts: 2991
Joined: Tue Sep 22, 2009 11:07 am
Location: Enfield, Middlesex
Contact:

Post 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:
JazHaz

Gimi wrote:
drew wrote:
£4,500 though! :shock: <Faints>
Cheers,
Drew.
Maybe you could start a Kickstarter Campaign to found your £4500 pledge. 8)
Thanks to Gimi, I got an eBook in my inbox tonight (31st May 2014 - Release of Elite Reclamation)!
User avatar
ZygoUgo
---- E L I T E ----
---- E L I T E ----
Posts: 406
Joined: Mon Nov 17, 2008 4:15 pm
Location: Blighty

Post 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..
User avatar
ADCK
---- E L I T E ----
---- E L I T E ----
Posts: 771
Joined: Thu Dec 24, 2009 12:30 am
Location: Sydney
Contact:

Post 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.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post 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.
User avatar
JazHaz
---- E L I T E ----
---- E L I T E ----
Posts: 2991
Joined: Tue Sep 22, 2009 11:07 am
Location: Enfield, Middlesex
Contact:

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

Gimi wrote:
drew wrote:
£4,500 though! :shock: <Faints>
Cheers,
Drew.
Maybe you could start a Kickstarter Campaign to found your £4500 pledge. 8)
Thanks to Gimi, I got an eBook in my inbox tonight (31st May 2014 - Release of Elite Reclamation)!
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6312
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Post 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?
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2483
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Post 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
Last edited by Griff on Thu Feb 18, 2010 10:50 am, edited 2 times in total.
bigmike20vt
Dangerous
Dangerous
Posts: 83
Joined: Wed Jan 06, 2010 11:24 pm

Post 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.
Fiat Coupe, helping motorists break the speed limit since 1993.
Post Reply