Page 10 of 32

Posted: Sun Mar 09, 2008 6:27 pm
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...

Posted: Sun Mar 09, 2008 6:36 pm
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. :-)

Posted: Sun Mar 09, 2008 8:11 pm
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...

Posted: Mon Mar 10, 2008 1:49 pm
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!

Posted: Mon Mar 10, 2008 2:10 pm
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

Posted: Mon Mar 10, 2008 2:14 pm
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

Posted: Mon Mar 10, 2008 2:23 pm
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!

Posted: Sat Mar 15, 2008 11:12 am
by Griff
deleted original post containing lengthy bug filled shader code.
griff

Posted: Sat Mar 15, 2008 12:14 pm
by Griff
deleted original post containing lengthy bug filled shader code
griff

Posted: Sat Mar 15, 2008 1:48 pm
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.

Posted: Sat Mar 15, 2008 2:13 pm
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!

Posted: Sat Mar 15, 2008 4:27 pm
by LittleBear
This is just outstanding! I love the idea of the lights on the planet comming on at the right time! 8)

Posted: Sat Mar 15, 2008 11:33 pm
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

Posted: Sun Mar 16, 2008 11:32 am
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. :)

Posted: Sun Mar 16, 2008 1:56 pm
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;