Replacing Constores with Griff Trade outposts@Griff and Doc

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

Moderators: winston, another_commander

User avatar
pagroove
---- E L I T E ----
---- E L I T E ----
Posts: 3035
Joined: Wed Feb 21, 2007 11:52 pm
Location: On a famous planet

Post by pagroove »

Anyway it looks VERY cool :D :D
For P.A. Groove's music check
https://soundcloud.com/p-a-groove
Famous Planets v 2.7. (for Povray)
Image
https://bb.oolite.space/viewtopic.php?f=4&t=13709
User avatar
Pangloss
---- E L I T E ----
---- E L I T E ----
Posts: 303
Joined: Wed Dec 13, 2006 5:57 pm
Location: Scranton, PA (via Stevenage, Herts)

Post by Pangloss »

I wouldn't mind adding a five-frame animation. I'll have to do that on Monday, though. Busy weekend, and this area of the world is in for a foot of snow.
"All is for the best in this best of all possible worlds..."
Dr.Pangloss, Voltaire's 'Candide'.

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 »

how on earth did i manage to do a 5 frame animation and fit it into a power of 2 scale image? i think when i was working it out i just assumed that as each frame was 256 x 256 pixels i could just stack as many as i wanted on top of each other and the final image size would be a power of 2, what a twit. happily it seemed to work out in this case although each image works out at 204.8 poixels tall! :?
So in summary, Griff 1 OpenGl Programming Specification 0

If you want to make an animation of a different length, just modify the FrameCount value when you write out the ship data.plist entry for your new roof billboard object, here's the code for the drinking spaceman one, you just need to change the texture files to your new ones, the first texture listed (griff_no_shader_drinking_spaceman.png) is the static image version of your animation for use by players not using shaders, the second texture listed (griff_drinking_spaceman.png) is your animated texture (frames stacked vertically as usual).

Code: Select all

"griff_station_roof_billboard" = 
	{
	ai_type = "nullAI.plist";
	model = "griff_station_roof_billboard.dat"; 
	roles = "griff_station_subent";
	shaders = 
    { 
        "griff_no_shader_drinking_spaceman.png" = 
        { 
            vertex_shader = "griff_station_animated.vertex"; 
            fragment_shader = "griff_station_animated_billboard.fragment"; 
            
            textures = ("griff_drinking_spaceman.png"); 
            uniforms = 
            { 
				FrameCount = { type = "float"; value = 5.0; };
				TimePerFrame = { type = "float"; value = 1.0; };				
                uTime = "timeElapsedSinceSpawn"; 
            }; 
        }; 
	};	
	};
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:
how on earth did i manage to do a 5 frame animation and fit it into a power of 2 scale image? i think when i was working it out i just assumed that as each frame was 256 x 256 pixels i could just stack as many as i wanted on top of each other and the final image size would be a power of 2, what a twit. happily it seemed to work out in this case although each image works out at 204.8 poixels tall! :?
As I mentioned before, sort of, in my obtuse way, any frame count will work, but for non-power-of-two frame counts the height of each frame will be a non-integer which will result in misalignment effects if you have sharp vertical edges. (A one-pixel gaussian blur, where by “one pixel” I mean one pixel at the final texture resolution, will make this barely noticeable. Of course, the cost is that you get a blurry texture.)

Also note that if you stack five 256 px high frames into a texture, Oolite will scale it to 1024 px (5 × 204.8 px) when the texture is loaded and you might not notice. I made this mistake myself once (gasp!).
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 »

:)
Ark, i've reworked the original shaders to add in some of the stuff from the griff_boa shaders (the bits to recolour the texture map)
Image
I've uploaded it here http://www.box.net/shared/3inge0prh6

a while back someone posted a colourwheel picture, i've edited it a bit to add in floating point values for all the colours - the shaders i've used for the station need floating point values for R G B rather than the 0-255 scale the paint programs use, i don't know the way to convert between the 2 using a calculator but luckily rendermonkey can show floating point values for the current colour its colour picker window!
The station in the screen shot above has the top part of the station recoloured using the blue at the '7 o'clock position' on the colour wheel and the bottom bit is recoloured using the darker blue at the '8 o'clock position'
Image

the changes from the original version uploaded ages ago are:

Code: Select all

Config Folder:
The following changes have been made to the original shipdata.plist

Line 205: smooth = "false"; key added, change to smooth = "true"; if you prefer
Line 240 now reads:  fragment_shader = "griff_station_bottom_section.fragment"; 
Line 241 now reads:  textures = ("griff_station_bottom.png", "griff_station_paint_mask.png");
Lines 242-248. New Uniforms to pass information to the new shader added.
    Line 246 MainhullColour - Floating Point R G B colour values to re-colour original texture map
    Line 247 DecalColour - Floating Point R G B colour values to re-colour the 'stripe' 
             painted roughly halfway down the cylindrical top section of the station


Line 257: smooth = "false"; key added, change to smooth = "true"; if you prefer
Line 263 now reads:                  fragment_shader = "griff_station_top_section.fragment";  
Line 241 now reads:  textures = ("griff_station_top.png", "griff_station_paint_mask.png");
Lines 265-271. New Uniforms to pass information to the new shader added.
    Line 269 MainhullColour - Floating Point R G B colour values to re-colour original texture map
    Line 270 DecalColour - Floating Point R G B colour values to re-colour the 'stripe' 
             painted along the top of the 'arms' sticking out of the bottom part of the station.

Line 358: smooth = "true"; key added, change to smooth = "false"; if you prefer

Models Folder
-No Changes-

Shaders Folder

griff_station_adring.fragment - Updated with new code
griff_station_adring.vertex  - Updated with new code
griff_station_animated_billboard.fragment - Updated with new code
griff_station_animated_w_rollbars.fragment - Updated with new code
griff_station_animated_w_rollbars.vertex - Updated with new code
griff_station_bottom_section.fragment - New Shader
griff_station_hull.fragment - Updated with new code
griff_station_top_section.fragment - New Shader

Textures Folder:
griff_station_paint_mask.png - New texture map, used by the relevant shaders to limit the recolouring of the station hull to certain areas of the model

griff_station_top.png & griff_station_bottom.png - original textures modified slightly to work with the new shaders (lights are now painted into the RGB channel and 'illuminated using the Alpha channel rather than being in a seperate texture map)
Last edited by Griff on Sat Jan 10, 2009 4:02 pm, edited 1 time in total.
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 »

That looks fantastic!
Minor suggestion, to make the top colour always be one of the three colours opposite the bottom one on the wheel, as in the rule of complementary colours.
Not important it would just avoid strange clashes.
By the way I really liked your cobra, good stuff as ever.
Ooh I nearly forgot, I wanted to ask you can I re-name your Boa and Kraits ingame? I was going to call them Griffin for the Boa, and Harpee for the Kraits? Would feel wrong doing it without your permission :D
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 »

@zygoUgo
I don't mind at all if you want to rename the ships, those sound like really great names!

I've added a sort of crappy LED pixel effect to the scrolling ad-ring shader, i've bunged it all into an oxp here http://www.box.net/shared/l07ll8kmxq (just the updated shaders & texturemaps and a small script to spawn them outside the station when you launch)
there's 2 versions, with differing 'LED pixel sizes' - it looks quite neat the way the texture scrolls through the grip of pixels - the bigger one looks nicer but you loose a lot of the fine detail in your advert texture map as it falls in the gaps between the led pixels (as you can see in the pic, most of the text has become unreadable)
anyway, since they exist i thought i'd upload them but i'm not suggesting you have to include them in the oxp or anything :)
Big LED pixels:
Image
Small LED Pixels
Image

edit: Forgot to mention, i generated the grid texture that is being used as a mask for these shaders using the free 'halftone' plugin by Richard Rosenman
http://www.richardrosenman.com/software/downloads/
very cool stuff, the 'scanlines' one is really good too.
There seems to be a guide on installing photoshop plugins in Gimp here:
http://akvis.com/en/graphic-tips/gimp-add-plugins.php
and here for linux http://www.gimp.org/~tml/gimp/win32/pspi.html
I haven't tried this myself though (i'm a posh photoshop user)
Last edited by Griff on Sat Jan 10, 2009 4:01 pm, edited 2 times in total.
User avatar
Ark
---- E L I T E ----
---- E L I T E ----
Posts: 664
Joined: Sun Dec 09, 2007 8:22 am
Location: Athens Greece

Post by Ark »

Hello Huston, we have got a promblem!!!!!!!!

Code: Select all


[shader.compile.fragment.failure]: ***** GLSL fragment shader compilation failed for griff_station_bottom_section.fragment:
>>>>> GLSL log:
0(26) : error C0105: Syntax error in #define


>>>>> GLSL source code:
#define OO_USER_DEFINED_BINDINGS  1
#define OO_REDUCED_COMPLEXITY  1
#define OO_TEXTURE_UNIT_COUNT  4


// Texture Information from Oolite.

   uniform sampler2D      tex0; // Difuse and Illumination map

    uniform sampler2D     tex1; // Mask map

   

// Uniforms from Oolite

   uniform float  uTime; //Time from game clock

   uniform float  hull_heat_level;

   uniform vec4   MainhullColor; // used with paintmask map to tint diffuse texture

   uniform vec4   DecalColor;  // used with paintmask map to tint decal strip in the diffuse texture

   

// Information from vertex shader.

   varying vec3         v_normal;   // Surface normal

   varying vec3         v_pos;      // Vertex/fragment position in eye space



   // Constants

   const float specExponent = 2.0;



// Irregular flickering function

   #ifdef OO_REDUCED_COMPLEXITY 

   #define Pulse(v, ts) ((v) * 0.95) 

   #define Blink_on_off(1.0)

   #else



     float Pulse(float value, float timeScale)

     {

        float t = uTime * timeScale;   



        float s0 = t;

        s0 -= floor(s0);

        float sum = abs( s0 - 0.5);

   

        float s1 = t * 0.7 - 0.05;

        s1 -= floor(s1);

        sum += abs(s1 - 0.5) - 0.25;

   

        float s2 = t * 1.3 - 0.3;

        s2 -= floor(s2);

        sum += abs(s2 - 0.5) - 0.25;

   

        float s3 = t * 5.09 - 0.6;

        s3 -= floor(s3);

        sum += abs(s3 - 0.5) - 0.25;



        return (sum * 0.1 + 0.9) * value;



      }



// Hull Temperate heat glow

     vec4 TemperatureGlow(float level) 

     { 

        vec4 result = vec4(0); 

    

        result.r = level; 

        result.g = level * level * level; 

        result.b = max(level - 0.7, 0.0) * 2.0; 

        result.a = 1.0; 

    

        return result;    

     } 

   #endif  

   

// Calculate the contribution of a single light. Ought to be a function, but OS X's GLSlang implementation isn't sufficiently clever.

   #define LIGHT(idx) \

        { \

Is that normal?
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 »

no, i've done something wrong, i'll get that fixed - it loks like a error in the griff_station_bottom_section.fragment code, probably a missing ; or something
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 »

Hmm, i can't see what i've done wrong, there was a line in the shader that shouldn't have been there, the #define Blink_on_off(1.0) one.
what if you replace all the text inside the griff_station_bottom_section.fragment with this, does it work then?

Code: Select all

// Texture Information from Oolite.
   uniform sampler2D     tex0; // Difuse and Illumination map
   uniform sampler2D     tex1; // Mask map
   
// Uniforms from Oolite
   uniform float  uTime; // Time from game clock
   uniform float  hull_heat_level;
   uniform vec4   MainhullColor; 
   uniform vec4   DecalColor; 
   
// Information from vertex shader.
   varying vec3         v_normal;   // Surface normal
   varying vec3         v_pos;      // Vertex/fragment position in eye space

   // Constants
   const float specExponent = 2.0;

// Irregular flickering function
   #ifdef OO_REDUCED_COMPLEXITY 
   #define Pulse(v, ts) ((v) * 0.95) 
   #else

     float Pulse(float value, float timeScale)
     {
        float t = uTime * timeScale;   

        float s0 = t;
        s0 -= floor(s0);
        float sum = abs( s0 - 0.5);
   
        float s1 = t * 0.7 - 0.05;
        s1 -= floor(s1);
        sum += abs(s1 - 0.5) - 0.25;
   
        float s2 = t * 1.3 - 0.3;
        s2 -= floor(s2);
        sum += abs(s2 - 0.5) - 0.25;
   
        float s3 = t * 5.09 - 0.6;
        s3 -= floor(s3);
        sum += abs(s3 - 0.5) - 0.25;

        return (sum * 0.1 + 0.9) * value;

      }

// Hull Temperate heat glow
     vec4 TemperatureGlow(float level) 
     { 
        vec4 result = vec4(0); 
    
        result.r = level; 
        result.g = level * level * level; 
        result.b = max(level - 0.7, 0.0) * 2.0; 
        result.a = 1.0; 
    
        return result;    
     } 
   #endif  
   
// Calculate the contribution of a single light. Ought to be a function, but OS X's GLSlang implementation isn't sufficiently clever.
   #define LIGHT(idx) \
        { \
           vec3 lightVector   = normalize(gl_LightSource[idx].position.xyz); \
           vec3 reflection   = normalize(-reflect(lightVector, v_normal)); \
           diffuse += gl_FrontMaterial.diffuse * gl_LightSource[idx].diffuse * max(dot(v_normal, lightVector), 0.0); \
           specular += gl_LightSource[idx].diffuse * pow(max(dot(reflection, eyeVector), 0.0), specExponent); \
        }
   
   void main(void)
   {
   vec4 diffuse = vec4(0.0), specular = vec4(0.0);
   vec3 eyeVector = normalize(-v_pos);
 
// Load texture data
   vec2 texCoord = gl_TexCoord[0].st;
   vec4 diffuseMap = texture2D(tex0, texCoord);
   vec4 maskMap = texture2D(tex1, texCoord);
   
// calculate specular effects
   float specIntensity = (diffuseMap.r + diffuseMap.g + diffuseMap.b);
   
/*   Light 0 is the "showroom" light, used in the demo screen and shipyard.
     Light 1 is the sun.
*/
   #ifdef OO_LIGHT_0_FIX
   LIGHT(0);
   #endif
   LIGHT(1);
   diffuse += gl_FrontMaterial.ambient * gl_LightModel.ambient;
   
// Calculate the lighting 
   vec4 color = diffuse * diffuseMap;
   #ifdef OO_REDUCED_COMPLEXITY
// Add in the specular effects for simple shader mode
   color += specular * color * 3.0 * specIntensity;
   #endif

#ifndef OO_REDUCED_COMPLEXITY   
// recolour the diffuse map
   color += diffuse * maskMap.b * MainhullColor; 
   color += maskMap.a * DecalColor * diffuse;   

// save the modified colour for use in colouring the illumination effect
   vec4 colourTemp = color;

// Add in the specular effects for full shader mode 
   color += specular * color * 3.0 * specIntensity;
   
// Add in the illumination effects. Full Shader mode only
   color += diffuseMap.a * 4.0 * colourTemp; 

// Add the all over hull temperature glow
      float hullHeat = max(hull_heat_level - 0.5, 0.0) * 2.0; 
      hullHeat = Pulse(hullHeat * hullHeat, 0.1); 
      color += TemperatureGlow(hullHeat); 
#endif

// Output final color
   gl_FragColor = vec4(color.rgb, 1.0);
   }
User avatar
Ark
---- E L I T E ----
---- E L I T E ----
Posts: 664
Joined: Sun Dec 09, 2007 8:22 am
Location: Athens Greece

Post by Ark »

Now it is even worse

Code: Select all

[shader.compile.fragment.failure]: ***** GLSL fragment shader compilation failed for griff_station_bottom_section.fragment:
>>>>> GLSL log:
0(68) : error C0000: syntax error, unexpected '{' at token "{"
0(68) : error C0501: type name expected at token "{"
0(69) : error C0000: syntax error, unexpected $undefined at token "<undefined>"
0(69) : error C0501: type name expected at token "<undefined>"
0(70) : error C1038: declaration of "vec3" conflicts with previous declaration at 0(69)
0(70) : error C1115: unable to find compatible overloaded function "reflect(error, vec3)"
0(70) : error C1115: unable to find compatible overloaded function "normalize(error)"
0(70) : error C0000: syntax error, unexpected $undefined at token "<undefined>"
0(70) : error C0501: type name expected at token "<undefined>"
0(71) : error C1038: declaration of "diffuse" conflicts with previous declaration at 0(71)
0(71) : error C1307: non constant expression for array size
0(71) : error C0000: syntax error, unexpected '.', expecting ',' or ';' at token "."
0(71) : error C0501: type name expected at token "."
0(71) : error C1038: declaration of "diffuse" conflicts with previous declaration at 0(71)
0(71) : error C0000: syntax error, unexpected '(' at token "("
0(71) : error C0501: type name expected at token "("
0(71) : warning C7022: unrecognized profile specifier "dot"
0(71) : error C0000: syntax error, unexpected ')' at token ")"
0(71) : error C0501: type name expected at token ")"
0(71) : warning C7022: unrecognized profile specifier "lightVector"
0(72) : error C1307: non constant expression for array size
0(72) : error C0000: syntax error, unexpected '.', expecting ',' or ')' at token "."
0(72) : error C0501: type name expected at token "."
0(72) : error C1121: pow: function type parameters not allowed
0(72) : error C0000: syntax error, unexpected '(' at token "("
0(72) : error C0501: type name expected at token "("
0(72) : warning C7022: unrecognized profile specifier "max"
0(72) : error C1121: dot: function type parameters not allowed
0(72) : error C0000: syntax error, unexpected ',' at token ","
0(72) : error C0501: type name expected at token ","
0(72) : warning C7022: unrecognized profile specifier "reflection"
0(72) : error C1109: function type not allowed for parameter "dot"
0(72) : error C0000: syntax error, unexpected floating point constant at token "<undefined>"
0(72) : error C0501: type name expected at token "<undefined>"
0(72) : error C1109: function type not allowed for parameter "pow"
0(75) : error C1109: function type not allowed for parameter "main"
0(76) : error C0000: syntax error, unexpected '{', expecting ',' or ')' at token "{"
0(76) : error C0501: type name expected at token "{"
0(77) : error C0000: syntax error, unexpected '=' at token "="
0(77) : error C0501: type name expected at token "="
0(77) : warning C7022: unrecognized profile specifier "specular"
0(77) : error C1109: function type not allowed for parameter "vec4"
0(78) : error C0000: syntax error, unexpected ';', expecting ',' or ')' at token ";"
0(78) : error C0501: type name expected at token ";"
0(81) : error C0000: syntax error, unexpected ';', expecting ',' or ')' at token ";"
0(81) : error C0501: type name expected at token ";"
0(82) : error C1115: unable to find compatible overloaded function "texture2D(sampler2D, error)"
0(82) : error C0000: syntax error, unexpected ';', expecting ',' or ')' at token ";"
0(82) : error C0501: type name expected at token ";"
0(83) : error C1115: unable to find compatible overloaded function "texture2D(sampler2D, error)"
0(83) : error C0000: syntax error, unexpected ';', expecting ',' or ')' at token ";"
0(83) : error C0501: type name expected at token ";"
0(86) : error C0000: syntax error, unexpected ';', expecting ',' or ')' at token ";"
0(86) : error C0501: type name expected at token ";"
0(98) : error C0000: syntax error, unexpected ';', expecting ',' or ')' at token ";"
0(98) : error C0501: type name expected at token ";"
0(125) : error C0000: syntax error, unexpected ';', expecting ',' or ')' at token ";"
0(125) : error C0501: type name expected at token ";"


>>>>> GLSL source code:
#define OO_USER_DEFINED_BINDINGS  1
#define OO_REDUCED_COMPLEXITY  1
#define OO_TEXTURE_UNIT_COUNT  4


// Texture Information from Oolite. 

   uniform sampler2D      tex0; // Difuse and Illumination map 

   uniform sampler2D     tex1; // Mask map 

    

// Uniforms from Oolite 

   uniform float  uTime; // Time from game clock 

   uniform float  hull_heat_level; 

   uniform vec4   MainhullColor; 

   uniform vec4   DecalColor; 

    

// Information from vertex shader. 

   varying vec3         v_normal;   // Surface normal 

   varying vec3         v_pos;      // Vertex/fragment position in eye space 



   // Constants 

   const float specExponent = 2.0; 



// Irregular flickering function 

   #ifdef OO_REDUCED_COMPLEXITY 

   #define Pulse(v, ts) ((v) * 0.95) 

   #else 



     float Pulse(float value, float timeScale) 

     { 

        float t = uTime * timeScale;    



        float s0 = t; 

        s0 -= floor(s0); 

        float sum = abs( s0 - 0.5); 

    

        float s1 = t * 0.7 - 0.05; 

        s1 -= floor(s1); 

        sum += abs(s1 - 0.5) - 0.25; 

    

        float s2 = t * 1.3 - 0.3; 

        s2 -= floor(s2); 

        sum += abs(s2 - 0.5) - 0.25; 

    

        float s3 = t * 5.09 - 0.6; 

        s3 -= floor(s3); 

        sum += abs(s3 - 0.5) - 0.25; 



        return (sum * 0.1 + 0.9) * value; 



      } 



// Hull Temperate heat glow 

     vec4 TemperatureGlow(float level) 

     { 

        vec4 result = vec4(0); 

    

        result.r = level; 

        result.g = level * level * level; 

        result.b = max(level - 0.7, 0.0) * 2.0; 

        result.a = 1.0; 

    

        return result;    

     } 

   #endif  

    

// Calculate the contribution of a single light. Ought to be a function, but OS X's GLSlang implementation isn't sufficiently clever. 

   #define LIGHT(idx) \ 

        { \ 

           vec3 lightVector   = normalize(gl_LightSource[idx].position.xyz); \ 

           vec3 reflection   = normalize(-reflect(lightVector, v_normal)); \ 

           diffuse += gl_FrontMaterial.diffuse * gl_LightSource[idx].diffuse * max(dot(v_normal, lightVector), 0.0); \ 

           specular += gl_LightSource[idx].diffuse * pow(max(dot(reflection, eyeVector), 0.0), specExponent); \ 

        } 

    

   void main(void) 

   { 

   vec4 diffuse = vec4(0.0), specular = vec4(0.0); 

   vec3 eyeVector = normalize(-v_pos); 

  

// Load texture data 

   vec2 texCoord = gl_TexCoord[0].st; 

   vec4 diffuseMap = texture2D(tex0, texCoord); 

   vec4 maskMap = texture2D(tex1, texCoord); 

    

// calculate specular effects 

   float specIntensity = (diffuseMap.r + diffuseMap.g + diffuseMap.b); 

    

/*   Light 0 is the "showroom" light, used in the demo screen and shipyard. 

     Light 1 is the sun. 

*/ 

   #ifdef OO_LIGHT_0_FIX 

   LIGHT(0); 

   #endif 

   LIGHT(1); 

   diffuse += gl_FrontMaterial.ambient * gl_LightModel.ambient; 

    

// Calculate the lighting 

   vec4 color = diffuse * diffuseMap; 

   #ifdef OO_REDUCED_COMPLEXITY 

// Add in the specular effects for simple shader mode 

   color += specular * color * 3.0 * specIntensity; 

   #endif 



#ifndef OO_REDUCED_COMPLEXITY    

// recolour the diffuse map 

   color += diffuse * maskMap.b * MainhullColor; 

   color += maskMap.a * DecalColor * diffuse;    



// save the modified colour for use in colouring the illumination effect 

   vec4 colourTemp = color; 



// Add in the specular effects for full shader mode 

   color += specular * color * 3.0 * specIntensity; 

    

// Add in the illumination effects. Full Shader mode only 

   color += diffuseMap.a * 4.0 * colourTemp; 



// Add the all over hull temperature glow 

      float hullHeat = max(hull_heat_level - 0.5, 0.0) * 2.0; 

      hullHeat = Pulse(hullHeat * hullHeat, 0.1); 

      color += TemperatureGlow(hullHeat); 

#endif 



// Output final color 

   gl_FragColor = vec4(color.rgb, 1.0); 

   }

[gameController.exitApp]: .GNUstepDefaults synchronized.

Closing log at 2009-01-10 17:11:38 +0200.
Griff what version of oolite are you using ? A trunk 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 »

yes, i am using an old trunk version with the tangent space normal mapping code in it, but i don't think this error is related - i know this may sound like the ravings of a madman but i think it's my graphics card drivers, they leap in and fix errors in my shaders that other peoples graphics cards complain about and i always end up posting shaders full of bugs that run ok on my pc!

in this bit of the shader

Code: Select all

   #define LIGHT(idx) \
        { \
           vec3 lightVector   = normalize(gl_LightSource[idx].position.xyz); \
           vec3 reflection   = normalize(-reflect(lightVector, v_normal)); \
           diffuse += gl_FrontMaterial.diffuse * gl_LightSource[idx].diffuse * max(dot(v_normal, lightVector), 0.0); \
           specular += gl_LightSource[idx].diffuse * pow(max(dot(reflection, eyeVector), 0.0), specExponent); \
        }
are there any blank lines? there musn't be any blank lines or characters (including spaces) after the \ at the end of every line
User avatar
Ark
---- E L I T E ----
---- E L I T E ----
Posts: 664
Joined: Sun Dec 09, 2007 8:22 am
Location: Athens Greece

Post by Ark »

Griff wrote:
yes, i am using an old trunk version with the tangent space normal mapping code in it, but i don't think this error is related - i know this may sound like the ravings of a madman but i think it's my graphics card drivers, they leap in and fix errors in my shaders that other peoples graphics cards complain about and i always end up posting shaders full of bugs that run ok on my pc!

in this bit of the shader

Code: Select all

   #define LIGHT(idx) \
        { \
           vec3 lightVector   = normalize(gl_LightSource[idx].position.xyz); \
           vec3 reflection   = normalize(-reflect(lightVector, v_normal)); \
           diffuse += gl_FrontMaterial.diffuse * gl_LightSource[idx].diffuse * max(dot(v_normal, lightVector), 0.0); \
           specular += gl_LightSource[idx].diffuse * pow(max(dot(reflection, eyeVector), 0.0), specExponent); \
        }
are there any blank lines? there musn't be any blank lines or characters (including spaces) after the \ at the end of every line
Nop!! no black lines
I am using a Gforce9600GT with 180.48 drivers
What Kind of card is this that fixes shader problems?
Fascinating!! :?

Edit:
It only works with full shaders!! I am wondering why?
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 »

yeak i know, it's totally weird! I don't think Ahruman believed me either when i tried to convince him i had a magic graphics card installed in my pc. I've got an nvidia 8800gts card and i think the same graphics drive, that's the latest November 19th one isn't it?
anyway, i've uploaded the oxp again
http://www.box.net/shared/3inge0prh6
maybe something went wrong with the old upload when i edited it to fix the glowing paint stripes?
i've looked in the oolite log and i can't see any errors reported in there about this oxp, so hopefully it will work ok *fingers crossed*
User avatar
Ark
---- E L I T E ----
---- E L I T E ----
Posts: 664
Joined: Sun Dec 09, 2007 8:22 am
Location: Athens Greece

Post by Ark »

Griff wrote:
i think the same graphics drive, that's the latest November 19th one isn't it?
Yes we have the same drivers.
Even more Fascinating!! :lol:

When i have shader effects in full it works ok. That is odd
Post Reply