Page 34 of 136

Posted: Tue Oct 16, 2007 5:40 pm
by Disembodied
Image

Too retro?

Posted: Tue Oct 16, 2007 8:26 pm
by TGHC
No way Disembodied, keep coming you are doing an excellent job.

@Dr Nil, just a thought for the future, don't know if it's feasible but would it be possible to add Griffs neon shader idea, to make the billboards look like neon signs?

Posted: Wed Oct 17, 2007 12:15 pm
by Arexack_Heretic
It would be entirely possible.
Although I suggest leaving the neon signs for what they are and concentrate on the TV-projection aspect.

Use Griff's latest 'monster'shader.

pro:
-it has a bright background texture + animated textures projected on top.
con:
-It requires v1.69+ to work smoothly.
-animated billboards are more than double the work.

Did YAH already use a brightness shader to illuminate the signs?
I'll go check... no it doesn't.
This would be a great default shader for unanimated signs.
(Griff's monster is identical+animation shader merged)

I'll experiment on this a bit.
works. pretty bright though, like turning on a monitor in a darkened room. I advice against using too much white in adds when using lighting-shaders.

just add something like:

Code: Select all

 shaders = 
		{ 
        "yah03.png" = 
			{ 
            vertex_shader = "animatedandnon-animatedwithspec.vertex"; 
            fragment_shader = "animatedandnon-animatedwithspec.fragment"; 
            
            textures = ("yah03a.png", "yah03.png"); 
            uniforms = 
				{ 
					uTime = "timeElapsedSinceSpawn"; 
				}; 
			}; 
    
		};
to the shipdata and copy/edit the following Shaders:

fragment:

Code: Select all

// Information from Oolite.
uniform sampler2D   tex0; // Animated Map
uniform sampler2D   tex1; // Non-animated Map
uniform float       uTime;

// Control factors.
const float         kTimePerFrame = 0.8;
const float         kFrameCount = 2.0;
const float         specExponent = 5.0;
const float         specIntensity = 0.5;

// Derived constants.
const float         kAnimCycleTime = kTimePerFrame * kFrameCount;

// Information from vertex shader.
varying vec3        v_normal;      // Surface normal
varying vec3        v_pos;      // Vertex/fragment position in eye space

// 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()
{

   vec4 diffuse = vec4(0.0), specular = vec4(0.0);
   vec3 eyeVector = normalize(-v_pos);

 // Load texture data
   vec2 fixedcoord = gl_TexCoord[0].st;
   vec2 animatedcoord = fixedcoord;
       
 // Do Maths stuff on animatedcoord to select an animation frame.
   animatedcoord.t += floor(mod(uTime, kAnimCycleTime) / kTimePerFrame);
   // Scale texture co-ordinates to 0..1
   animatedcoord.t /= kFrameCount;   
    
   vec4 animatedMap = texture2D(tex0, animatedcoord);
   vec4 nonanimatedMap = texture2D(tex1, fixedcoord);

/*   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;  
   vec4 color = animatedMap;
   color += nonanimatedMap;
  
    gl_FragColor = color + specular * specIntensity;
}
vertex:

Code: Select all

// Information from Oolite.

varying vec3         v_normal;      // Surface normal
varying vec3         v_pos;      // Vertex/fragment position in eye space

void main(void)
{
   v_normal = normalize(gl_NormalMatrix * gl_Normal);
   v_pos = vec3(gl_ModelViewMatrix * gl_Vertex);
   gl_Position = ftransform();
   gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
}
if animating, edit the 'add-texture' to have animationframes and place them into a single vertical row texture, save and insert this file into the shader-part of the shipdata (I used tha additive -a) edit the *.fragment to reflect the number of frames used. (make sure the shipdata is using this eited version)
Otherwise just set the frames to 1 and use the same texture twice.
(or use a simple lights shader, as used previously in several exampes)

voila.

Posted: Wed Oct 17, 2007 1:44 pm
by Disembodied
Image

Posted: Wed Oct 17, 2007 1:54 pm
by Arexack_Heretic
What are those?
the botanical equivalent of a bombletter?

she's screaming and turned all purple,
secondly the logo looks like a guy doing a sidekick.

So... instead of singing telegram this delivery guy kicks you in the reproductive organs, then shoves a bunch of poisonous photosynthetic-species' equivalents of said organs in your face?

That will teach her to think we are figments of her imagination!
darn solipsists. ;)

Posted: Wed Oct 17, 2007 3:09 pm
by JensAyton
Arexack_Heretic wrote:
It would be entirely possible.
Although I suggest leaving the neon signs for what they are and concentrate on the TV-projection aspect.

Use Griff's latest 'monster'shader.

pro:
-it has a bright background texture + animated textures projected on top.
con:
-It requires v1.69+ to work smoothly.
-animated billboards are more than double the work.
You might recall that the animated shader is a spin-off of my Shady Billboards shader. Which has advanced significantly, and basically hasn’t been released for ages because I wanted to comment the shader code extensively, and also wanted to try some optimizations, but haven’t bothered to get around to finishing it. So here it is anyway:

Shady Billboards 2.0, now with 20 adverts. I can’t be bothered to keep up with Dr Nil; if anyone wants to do the honours, they’re welcome.

Oh, and I don’t know offhand whether it will actually work with 1.69.x. Consider that question an extra element of excitement.

Posted: Wed Oct 17, 2007 3:52 pm
by Disembodied
Arexack_Heretic wrote:
What are those?
the botanical equivalent of a bombletter?

she's screaming and turned all purple,
secondly the logo looks like a guy doing a sidekick.

So... instead of singing telegram this delivery guy kicks you in the reproductive organs, then shoves a bunch of poisonous photosynthetic-species' equivalents of said organs in your face?

That will teach her to think we are figments of her imagination!
darn solipsists. ;)
Well... I can't think of a backstory. :oops: It just seemed like a good idea at the time. I really wanted to find a picture of a woman looking horrified and -- most importantly -- up and back, as if she's being attacked by Godzilla (or a giant tulip), but the only one I could get was black and white and searching for pictures of women on the the internet gets pretty depressing, pretty fast... so I thought "she'll do", coloured her purple and stuck her on. It's called "the creative process". :wink:

As for the logo, that's the Interflora logo with the obligatory extra "o" added in to the name. He's been drop-kicking people in the groin delivering flowers all over the world for decades, as far as I know.

In retrospect, it's possible that she's a blue bony humanoid from Enrienge, and that's what they look like when aroused by the thoughtfulness and spending power of a prospective mate. It's a big galaxy, full of unusual traditions...

Posted: Wed Oct 17, 2007 9:16 pm
by JensAyton
Disembodied wrote:
In retrospect, it's possible that she's a blue bony humanoid from Enrienge, and that's what they look like when aroused by the thoughtfulness and spending power of a prospective mate.
Or, for that matter, he. This is indeed a disturbing universe.

Posted: Thu Oct 18, 2007 3:34 pm
by Disembodied
Ahruman wrote:
Or, for that matter, he. This is indeed a disturbing universe.
True enough... here's another hairy individual of indeterminate gender:

Image

Posted: Fri Oct 19, 2007 12:13 pm
by JensAyton
Ahruman wrote:
…Shady Billboards shader. Which has advanced significantly, and basically hasn’t been released for ages because I wanted to comment the shader code extensively, and also wanted to try some optimizations, but haven’t bothered to get around to finishing it.
I just thought of another problem: ahruman-billboard-bsod.fragment hasn’t been updated to match ahruman-billboard.fragment. Oh, and the use of fwidth() to interpolate between the fancy screen effect and a scaled texture (to reduce aliasing effects) doesn’t work properly in the OS X software renderer, which suggests it may have problems with some hardware.

Posted: Sun Oct 21, 2007 7:02 pm
by Dr. Nil
@Disembodied: Looks great. I also like the Cremoola and Interfloora. :D

Posted: Mon Oct 22, 2007 6:22 am
by Rxke
Disembodied wrote:
searching for pictures of women on the the internet gets pretty depressing, pretty fast...

Heehee, I can imagine :lol:

Posted: Mon Oct 22, 2007 3:05 pm
by Disembodied
@ Dr Nil: thanks, Doc! Here's another (seeking pictures of furry humanoids I found some of chimps-in-suits which I feel obliged to make adverts for):

Image

@ Rxke: add "screaming" to the image search and it gets REALLY depressing. :roll:

Posted: Mon Oct 22, 2007 8:13 pm
by Arexack_Heretic
no orange furry humanoids?

Posted: Mon Oct 22, 2007 10:29 pm
by Disembodied
Arexack_Heretic wrote:
no orange furry humanoids?
Not in suits, no, not that I could find anyway. Although that's not to say there might not be at some point in the future: they'd be easier to fiddle with the colours...