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: 2483
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Post by Griff »

i don't think the shiny qbomb link is right, it's pointing to the scarred alloy oxp i think?
Do you have any plans to make the system sun colour bindable to shaders? i'm just asking as i'd like to be able to overly colour the specular highlights in a horribly un-realistic, non subtle way!
uh sorry, it doesn't need to be bindable does it, i just need to do a

vec4 lightColor = gl_LightModel.ambient;

i think...
Last edited by Griff on Sun Mar 09, 2008 6:37 pm, edited 1 time in total.
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:
i don't think the shiny qbomb link is right, it's pointing to the scarred alloy oxp i think?
Er, um… look over there!

No it isn’t.
Griff wrote:
Do you have any plans to make the system sun colour bindable to shaders? i'm just asking as i'd like to be able to overly colour the specular highlights in a horribly un-realistic, non subtle way!
uh sorry, it doesn't need to be bindable does it since it's the already used lightsource
Well done. :-)
User avatar
Disembodied
Jedi Spam Assassin
Jedi Spam Assassin
Posts: 6885
Joined: Thu Jul 12, 2007 10:54 pm
Location: Carter's Snort

Post by Disembodied »

Griff -- love the rocket ship! Have you ever seen the animation "Ah Pook is Here"? You might get a kick out of it...
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 »

heh, thanks! I took the basic shape of the rocket from the one Wallace & Gromit use to get to the moon in one of their short films, and textured it with some bits i had left over from other maps.
I hadn't seen that animation, thanks for linking me to it - very cool stuff, i imagine it must have been pretty difficult for the animators to merge the computer graphic & the stop motion elements back in 1994!
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 »

A short 8 step guide for copying a seperate greyscale image into the alpha channel of a colour map using the freeware graphics program Gimp http://www.gimp.org/

Although the example in the pdf mixes a diffuse texture & and illumination map you could use the same workflow for creating an emission_and_illumination_map or a specular_map for Oolites Materials system http://wiki.alioth.net/index.php/Materials_in_Oolite


grab the guide here
http://www.box.net/shared/q3t3nzk2sc
Edit: updated slightly to reflect a few changes in Gimp
http://www.box.net/shared/jk87l4f0gw
Last edited by Griff on Wed Apr 30, 2008 7:14 pm, edited 1 time in total.
User avatar
Captain Hesperus
Grand High Clock-Tower Poobah
Grand High Clock-Tower Poobah
Posts: 2310
Joined: Tue Sep 19, 2006 1:10 pm
Location: Anywhere I can sell Trumbles.....

Post by Captain Hesperus »

Griff wrote:
A short 8 step guide for copying a seperate greyscale image into the alpha channel of a colour map using the freeware graphics program Gimp http://www.gimp.org/
<idiotic childish joke voice>
Heh, heh! You said GIMP....
</idiotic childish joke voice>

Captain Hesperus
The truth, revealed!!
Image
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 originally started the post by confessing to spending friday night at home with a few cans of beer and Gimp, but thankfully i went back and editied it out before anyone found out... oh no!
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 »

deleted original post containing lengthy bug filled shader code.
griff
Last edited by Griff on Sat Mar 15, 2008 11:26 pm, edited 1 time in total.
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 »

deleted original post containing lengthy bug filled shader code
griff
Last edited by Griff on Sat Mar 15, 2008 9:54 pm, edited 1 time in total.
User avatar
CaptKev
---- E L I T E ----
---- E L I T E ----
Posts: 519
Joined: Fri Jan 26, 2007 3:21 pm
Location: Shropshire, UK

Post by CaptKev »

Griff, I'm not sure what's happening but the visible daylight portion gets smaller the further you are from the planet.

Great idea, maybe this approach could fix the problem with the rotational axis reported by Commander McLane.
Download Fighter HUD, Stingray and System Redux from the EliteWiki
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 »

yeah, there's a lot of stuff wrong with it :(
here's a screengrab of it running in Rendermonkey
Image

I've pretty much binned the other attempts and started again using the rendermonkey example as a template, removing from it the need for 'nighttime' copies of the surface texture and specularity & cloud cover maps. just need to get oolite friendly lightsource information into it now. fingers crossed!
Last edited by Griff on Sat Mar 15, 2008 9:55 pm, edited 4 times in total.
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2882
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

This is just outstanding! I love the idea of the lights on the planet comming on at the right time! 8)
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
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 »

Oh my god, I can't believe what a twit i've been. I've been ages puzzling over why the planet shader was working in Rendermonky and not working in Oolite, literally i've been working on it all day.. i now just realised that i've been been playing Oolite with Shaders switched off and that's why the shader effects weren't working! AAARGH!!

Anyway, here's the shader in a test oxp, seems to be working quite nicely - see screenshot in post above.

Grab the oxp here. contains the pdf guide to pasting greyscale textures into RGB texturemaps which will be handy when pasting the city lights texture into the colourmap.
http://www.box.net/shared/gruzn77k0c
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 wrote:
Oh my god, I can't believe what a twit i've been. I've been ages puzzling over why the planet shader was working in Rendermonky and not working in Oolite, literally i've been working on it all day.. i now just realised that i've been been playing Oolite with Shaders switched off and that's why the shader effects weren't working! AAARGH!!
Sorry! I think each of us can recall something similar from their own experience. :)
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 »

Is it possible to send vec3's as uniform bindings to a shader?
I'm trying to make it possible to specify the nightside colour 'tint' and 'city light' colours from inside the shipdata.plist
i've set the uniforms out like this:

Code: Select all

uniforms = 
  { 
     nightmutedColor = {type = "vec3"; value = "0.0, 0.16, 0.33"; };
     citylightColor  = {type = "vec3"; value = "0.89, 0.86, 0.52"; };
  };
but i keep ketting this error in the stder:

Code: Select all

[shader.uniform.badDescription]: ----- Warning: could not bind uniform "citylightColor" -- could not interpret definition:
{type = vec3; value = "0.89, 0.86, 0.52"; 
in the shader the uniforms as declared like this:

Code: Select all

uniform vec3 nightmutedColor;
uniform vec3 citylightColor;
Post Reply