Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

Shaders’ Outpost

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

Moderators: winston, another_commander

User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2479
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Post by Griff »

I've been mucking around a bit more with the heated metal effect from the glowing alloy shader and thought i'd apply it to one of the station models since i think we're missing one of the missions from the spectrum version of Elite? (i don't know how to the the 'spoiler' thing to hide text so i won't go into details about which mission is missing).
I wanted to try the 'discard' thing to give crinkly edges to the polygons too.
Image

Griff_burning_coriolis
http://www.box.net/shared/kqz9yeftw8 (1Mb)
ovvldc
---- E L I T E ----
---- E L I T E ----
Posts: 344
Joined: Sat Apr 02, 2005 9:32 am
Location: Netherlands

Post by ovvldc »

Gorgeous!

Nobody will be docking there anytime soon...

-Oz
User avatar
TGHC
---- E L I T E ----
---- E L I T E ----
Posts: 2157
Joined: Mon Jan 31, 2005 4:16 pm
Location: Berkshire, UK

Post by TGHC »

Awesome as usual, you are a genius.
The Grey Haired Commander has spoken!
OK so I'm a PC user - "you know whats scary? Out of billions of sperm I was the fastest"
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Got to say, it is amazing, as always!

Btw I've written a spoiler here:hello everybody. the original code is

Code: Select all

[color=#eeeeff][b]hello everybody[/b][/color] 
You'll need to change the 'color' value to match the background colour, of course.
Edit: Now you've got to tell us what the missing mission was! :)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2479
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Post by Griff »

Cheers Kaks for the spoiler tutorial!
uh, i think i might have got my wires crossed with the missing mission, i thought it was...
...Spoiler:You are sent to defend a station that is under attack by Thargoids
which i thought might be easily scriptable, but it look like it really is this...

...Spoiler:You are sent to destroy a space station overrun with Thargoids, you get a new Elite Rank of Archangel and a new Galaxy (Galaxy 9) becomes available
Which seems like it needs a whole load of new features written into the game itself.

Most of the credit for the oxp should really go to OpenGl and the shader code Ahruman wrote for the Shady Cobra oxp, i've just been cribbing everything from that and clone brushing gritty metal textures around in photoshop, but don't tell anyone!
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 »

@ Griff: I need this station! A Thargoid attack on a station is exactly what I am scripting in this very second. :wink:

One question though: Is the docking bay still intact? Because in my context the player still has to dock.

Moderator: Please respect other people’s spoiler warnings.
ovvldc
---- E L I T E ----
---- E L I T E ----
Posts: 344
Joined: Sat Apr 02, 2005 9:32 am
Location: Netherlands

Post by ovvldc »

Perhaps it could be set up to load your favourite 1st/3rd person shooter game when you enter? :wink:

-Oz
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2479
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Post by Griff »

Commander McLane, you're more than welcome to use the station in an oxp, i can't see myself doing any scripting with it so i'd love to see it put to good use somewhere - it should work just like any normal station and the docking bay is the same size as the original coriolis model built into the game.
User avatar
Cmdr. Maegil
Sword-toting nut-job
Sword-toting nut-job
Posts: 1294
Joined: Tue Feb 27, 2007 10:28 pm
Location: On the mend in Western Africa

Post by Cmdr. Maegil »

ovvldc wrote:
Perhaps it could be set up to load your favourite 1st/3rd person shooter game when you enter? :wink:
That's been on my wish list ever since Frontier:Elite 2! :cry:
You know those who, having been mugged and stabbed, fired, dog run over, house burned down, wife eloped with best friend, daughters becoming prostitutes and their countries invaded - still say that "all is well"?
I'm obviously not one of them.
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2479
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Post by Griff »

updated version of a griff_krait ship with a new glowing laser effect.
download it here: http://www.box.net/shared/p0feglnwos
edit: fixed the link: http://www.box.net/shared/6ugzbf1ofo
this makes use of a new ability in Oolite 1.71 to bind shader uniforms to subentities! there's a short topic about it here: https://bb.oolite.space/viewtopic.php?t=4063
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2479
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Post by Griff »

Does Oolite support Cubemaps? (textureCube)
I've been mucking about with them in rendermonkey and you can get some really neat chrome effects, excuse the screenshot, rendermonkey only supports cubemaps in .dds format, i'm not quite sure what they are so i'm using one of it's built in example cubemaps of a snowy landscape, you can see it in the screenshot as snow.dds

Image


I've downloaded a few free cubemaps and they just seems to be 6 png images for each of the axis of the 'cube'

edit:
the example on this page http://www.ozone3d.net/tutorials/glsl_texturing_p04.php
does a similar thing but doesn't need a cubemap, i've added it into a oxp here, it looks a bit wonky though, i must have something wrong with the maths in the vertex shader
download it here http://www.box.net/shared/akiil10sog
The oxp puts 4 chrome griff_kraits tumbling outside the station when you launch, there's something odd going on with the environment map though, it streaks a lot along some of the polygons, maybe something to do with the topology of the model?
Last edited by Griff on Fri May 09, 2008 8:34 am, edited 2 times in total.
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2479
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Post by Griff »

Ahruman, is the uniform binding throwingSparks working OK?
i'm getting this error when trying to bind it to a shader:

Code: Select all

oolite.exe[2252] [shader.uniform.bind.failed]: Could not bind uniform "nearly_dead" to -[ShipEntity ?] (no uniform of that name could be found).
in shipdata.plist i've got:

Code: Select all

uniforms = { 
	time = "universalTime"; 
	engine_power = "speedFactor";
	laser_heat_level = "laserHeatLevel";
	nearly_dead = "throwingSparks"; 
	hull_heat_level = "hullHeatLevel";
	}; 


in the fragment shader i've got:

Code: Select all

uniform bool   nearly_dead;
and what i'm doing with it is:

Code: Select all

if (nearly_dead = true)
      { 
      color += cyanGlow(effectsMap.r * Pulse(min(engine_power, 1.0), 1.0)) * Blink_on_off(Pulse(1.0, 1.0));
      color += effectsMap.a * diffuseMap * Blink_on_off(Pulse(1.0, 0.6));
      }  
   else 
      { 
       color += cyanGlow(effectsMap.r * Pulse(min(engine_power, 1.0), 1.0));
       color += effectsMap.a * diffuseMap * 3.0;
      }
that bit of code flickers the exhaust glow effects off and off a bit like how the exhaust plume flickers.

what i'm seeing in oolite is the flickering effect as if the nearly_dead bool is true, even though the ship is not in the throwingSparks state, what's odd is if i edit the shader and change if (nearly_dead = true) to if (nearly_dead = false) i don't see the flickering effect, so it's as if the if else stuff is being acted on.


Edit: fixed by Cmdr James, i had the shader code wrong

Also, does hullHeatLevel always have a slightly positive value even when ships are just milling around aimlessly in space?
i've added in the hull heat glow effect from the shady cobra to the griff_krait shader and now all the kraits are glowing slightly red, as if hullHeatLevel starts off at some value such as 0.1 - this is for non-player craft, i haven't tested it with a player ship
Image
Last edited by Griff on Thu May 08, 2008 8:09 pm, edited 5 times in total.
User avatar
Cmdr James
Commodore
Commodore
Posts: 1357
Joined: Tue Jun 05, 2007 10:43 pm
Location: Berlin

Post by Cmdr James »

Im not t all a javascript expert, but that isnt the way Id test the nearly_dead boolean in any other language.

I think it should be

Code: Select all

if (nearly_dead) {
and

Code: Select all

if(!nearly_dead) {
I think your

Code: Select all

if (nearly_dead = true)
is setting the value of nearlydead, rather than testing it.[/quote]
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2479
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Post by Griff »

thanks Cmdr James! that fixed it, i changed the shader code to

Code: Select all

if (nearly_dead)
      { 
      color += cyanGlow(effectsMap.r * Pulse(min(engine_power, 1.0), 1.0)) * Blink_on_off(Pulse(1.0, 1.0));
      color += effectsMap.a * diffuseMap * Blink_on_off(Pulse(1.0, 0.6));
      }  
if (!nearly_dead) 
      { 
       color += cyanGlow(effectsMap.r * Pulse(min(engine_power, 1.0), 1.0));
       color += effectsMap.a * diffuseMap * 3.0;
      }
and it's working great!
User avatar
Frame
---- E L I T E ----
---- E L I T E ----
Posts: 1477
Joined: Fri Mar 30, 2007 8:32 am
Location: Witchspace

Post by Frame »

for reference in code terms

== test´s Equality

= sets varible to be the value that follows...

Not being an Java coder, but i bet this also works like this in java script, like it does in C++
Bounty Scanner
Number 935
Post Reply