Ruining the classics (screenshot heavy thread)
Moderators: winston, another_commander
- Uncle Reno
- ---- E L I T E ----
- Posts: 648
- Joined: Mon Apr 24, 2006 12:54 pm
- Location: UK
Because it always shows the current ship name targeted there when you use your ID system.TGHC wrote:but why does it say Krait in the missile indicator?
"Get back or I unleash my lethal spotted batoid!!"
What I do when not reading the Oolite bulletin board!
What I do when not reading the Oolite bulletin board!
- Griff
- Oolite 2 Art Director
- Posts: 2483
- Joined: Fri Jul 14, 2006 12:29 pm
- Location: Probably hugging his Air Fryer
y'know, i've never noticed it say the ship name down by the missile indicator before too busy looking at the laser temperature gauge i guess!
anyway, i imagine everyone's pretty tired of seeing this ship by now but i thought i'd post one more screenshot:-
i've been taking the various shaders ahruman wrote for the 'krait' and it's subentities and adding them into one shader, what i thought was cool here is the hot metal glow on the laser cannons and various engine bits at the back of the ship, i thought this might look cool on the alloy fragments left behing by exploding ships? making them look red hot from the laser fire & explosion, i might have a go at it and if it works maybe write it out as a sort-of tutorial ('sort-of' since i'm not really sure what i'm doing!)
anyway, i imagine everyone's pretty tired of seeing this ship by now but i thought i'd post one more screenshot:-
i've been taking the various shaders ahruman wrote for the 'krait' and it's subentities and adding them into one shader, what i thought was cool here is the hot metal glow on the laser cannons and various engine bits at the back of the ship, i thought this might look cool on the alloy fragments left behing by exploding ships? making them look red hot from the laser fire & explosion, i might have a go at it and if it works maybe write it out as a sort-of tutorial ('sort-of' since i'm not really sure what i'm doing!)
- Arexack_Heretic
- Dangerous Subversive Element
- Posts: 1876
- Joined: Tue Jun 07, 2005 7:32 pm
- Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
- Contact:
- Griff
- Oolite 2 Art Director
- Posts: 2483
- Joined: Fri Jul 14, 2006 12:29 pm
- Location: Probably hugging his Air Fryer
heh, i dunno that krait is starting to look a bit garish now! i'm going overboard on the effects!
what i'm planning on doing soon is painting out some glow & effects maps for one of the standard ships, putting it all into rendermonkey (and hopefully the open source shader program ahruman linked to a few pages back - 'lumiere'?) and uploading it somewhere for us all to have a tinker with and see what we can come up with - hopefully get a shader version of the 'scripters cove' thread going, although ahrumans recent posting about ship materials will bring all the goodness of shaders into some extra <key>'s that you just add to a ships shipdata.plist file to switch on the effects, all the complex stuff will happen behind the scenes!
what i'm planning on doing soon is painting out some glow & effects maps for one of the standard ships, putting it all into rendermonkey (and hopefully the open source shader program ahruman linked to a few pages back - 'lumiere'?) and uploading it somewhere for us all to have a tinker with and see what we can come up with - hopefully get a shader version of the 'scripters cove' thread going, although ahrumans recent posting about ship materials will bring all the goodness of shaders into some extra <key>'s that you just add to a ships shipdata.plist file to switch on the effects, all the complex stuff will happen behind the scenes!
- Arexack_Heretic
- Dangerous Subversive Element
- Posts: 1876
- Joined: Tue Jun 07, 2005 7:32 pm
- Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
- Contact:
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
It’s not gone that far… yet. The material stuff lets you set an overall glow colour for a material, for instance, irrespective of shaders, but it doesn’t allow you to specify a glow map.Griff wrote:…although ahrumans recent posting about ship materials will bring all the goodness of shaders into some extra <key>'s that you just add to a ships shipdata.plist file to switch on the effects, all the complex stuff will happen behind the scenes!
E-mail: [email protected]
- Dr. Nil
- ---- E L I T E ----
- Posts: 983
- Joined: Thu Sep 28, 2006 5:11 pm
- Location: Nearest Hoopy Casino
- Contact:
I'm notGriff wrote:anyway, i imagine everyone's pretty tired of seeing this ship by now
300 billboards in Your Ad Here!
Astromines and more in Commies.
AVAILABLE HERE along with other Oolite eXpansion Packs.
- Griff
- Oolite 2 Art Director
- Posts: 2483
- Joined: Fri Jul 14, 2006 12:29 pm
- Location: Probably hugging his Air Fryer
i've vandalised Ahrumans laserglow shader into a glowing metal fragment shader for use on debris left behind by exploding ships, here is it at work on the 'alloy' metal fragment:-
I'm trying to get the glow amount to decrease over time, the glow amount is being set by a variable called metal_temperature in the shader code, can this be counted down from 1 to 0 in the shader code?
here's the fragment shader code:-
I'm trying to get the glow amount to decrease over time, the glow amount is being set by a variable called metal_temperature in the shader code, can this be counted down from 1 to 0 in the shader code?
here's the fragment shader code:-
Code: Select all
// Information from Oolite.
uniform sampler2D tex0;
uniform sampler2D tex1;
uniform float time;
uniform float metal_temperature;
// Information from vertex shader.
varying vec3 v_normal; // Surface normal
varying vec3 v_pos; // Vertex/fragment position in eye space
// Calculates the levels of R, G & B that make up the glow effect (MetalGlow). Red channel in effects map png proportional to level of effect.
vec4 MetalGlow(float level)
{
vec4 result;
result.rgb = vec3(1.0, 0.5, 0.25) * level;
result.a = 1.0;
return result;
}
// Irregular flickering function.
float Pulse(float value, float timeScale)
{
float t = time * timeScale;
float s0 = t;
s0 -= floor(s0);
float sum = abs( s0 - 0.5);
float s1 = t * 1.7 - 0.05;
s1 -= floor(s1);
sum += abs(s1 - 0.5);
float s2 = t * 2.3 - 0.3;
s2 -= floor(s2);
sum += abs(s2 - 0.5);
float s3 = t * 5.09;
s3 -= floor(s3);
sum += abs(s3 - 0.5);
return (sum * 0.25) * value;
}
// 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 ColorMap = texture2D(tex0, texCoord);
vec4 EffectsMap = texture2D(tex1, texCoord);
float specExponent = EffectsMap.b * 200.0 + 1.0;
float specIntensity = EffectsMap.g * 1.2;
/* Light 0 is the "showroom" light, used in the demo screen and shipyard.
Light 0 is currently disabled, because there's no way for the shader to know when it's turned off.
The solution for this will probably be for Oolite to set its diffuse and specular components to
black when it's not being used.
Light 1 is the sun.
*/
#ifdef OO_LIGHT_0_FIX
LIGHT(0);
#endif
LIGHT(1);
diffuse += gl_FrontMaterial.ambient * gl_LightModel.ambient;
specular = mix(specular, specular * diffuse, 0.0);
vec4 color = diffuse * ColorMap + specular * specIntensity;
float HeatAlphaR = EffectsMap.r * 2.0;
float HeatAlphaB = EffectsMap.r * 0.05;
color += MetalGlow(metal_temperature * HeatAlphaR + HeatAlphaB);
// ...and heat effects
float Heat = max(metal_temperature - 0.5, 0.0) * 2.0;
Heat = Pulse(metal_temperature, 0.1);
float Heat2 = Pulse(metal_temperature, 0.5);
float turnuptheheat = ((Heat + metal_temperature * HeatAlphaR) * HeatAlphaB) + ((Heat2 + metal_temperature * HeatAlphaB) * HeatAlphaR);
color += MetalGlow(turnuptheheat);
gl_FragColor = vec4(color.rgb, 1.0);
}
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Nice!Griff wrote:i've vandalised Ahrumans laserglow shader into a glowing metal fragment shader for use on debris left behind by exploding ships, here is it at work on the 'alloy' metal fragment:-
No. However, in 1.69 or 1.70 this will be possible by setting the initial time (as a uniform) in the “ship script” for the fragment. This’ll involve something along the lines of:Griff wrote:I'm trying to get the glow amount to decrease over time, the glow amount is being set by a variable called metal_temperature in the shader code, can this be counted down from 1 to 0 in the shader code?
Code: Select all
// Ship script (JavaScript):
this.didSpawn = function()
{
this.setShaderUniform("startTime", time);
}
// Shader (GLSL):
uniform float time;
uniform float startTime;
// ...
float elapsedTime = time - startTime;
Come to think of it, a shader-bindable spawnTime uniform might be a more elegant solution.
E-mail: [email protected]
-
- Above Average
- Posts: 25
- Joined: Tue Apr 17, 2007 2:10 pm
- Location: Denmark
Ooh! That looks nice!Griff wrote:i've vandalised Ahrumans laserglow shader into a glowing metal fragment shader for use on debris left behind by exploding ships, here is it at work on the 'alloy' metal fragment
A cool (but probably not easily implemented) effect could be if such a "heated metal glow" could be added to the places a ship's hull was hit during combat. That is, the more hits it takes the more the hull glows (ideally at those points the hull was hit).
- Commander McLane
- ---- 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: