Posted: Wed Sep 15, 2010 7:36 pm
A wonderful response! I shall give it a go (test it out) in a little while. Thank you very much.
For information and discussion about Oolite.
https://bb.oolite.space/
Well gee shucks.ZygoUgo wrote:@Simon.. Glad to see you about, and that's a very scrummy return. Any thoughts about helping update other willing OXP's to fit Griffs' stylings? Your ships are more than welcome in my Ooniverse
Code: Select all
[shader.compile.failure]: ***** ERROR: GLSL fragment shader compilation failed for griff_glow_moss_asteroid.fragment:
>>>>> GLSL log:
Fragment shader failed to compile with the following errors:
ERROR: 1:112: error(#202) No matching overloaded function found mix
ERROR: error(#273) 1 compilation errors. No code generated
[shader.load.fullModeFailed]: ----- WARNING: Could not build shader griff_glow_moss_asteroid.vertex/griff_glow_moss_asteroid.fragment in full complexity mode, trying simple mode.
[shader.compile.failure]: ***** ERROR: GLSL fragment shader compilation failed for griff_glow_moss_asteroid.fragment:
Drat, i didn't test properly, i think it's this line in the fragment shaderEl Viejo wrote:They throw up a whole bunch of these in the log, though:Code: Select all
[shader.compile.failure]: ***** ERROR: GLSL fragment shader compilation failed for griff_glow_moss_asteroid.fragment: >>>>> GLSL log: Fragment shader failed to compile with the following errors: ERROR: 1:112: error(#202) No matching overloaded function found mix ERROR: error(#273) 1 compilation errors. No code generated [shader.load.fullModeFailed]: ----- WARNING: Could not build shader griff_glow_moss_asteroid.vertex/griff_glow_moss_asteroid.fragment in full complexity mode, trying simple mode. [shader.compile.failure]: ***** ERROR: GLSL fragment shader compilation failed for griff_glow_moss_asteroid.fragment:
Code: Select all
color+= mix(gloweffect, 0.0, (LightLevel + Terminator) * InvTerminator);
Code: Select all
color+= mix(gloweffect, vec3(0.0), (LightLevel + Terminator) * InvTerminator);
Code: Select all
uniform sampler2D uColorMap; // Diffuse & Effects mask
uniform sampler2D uNormalMap; // normal map & specular intensity map
uniform sampler2D uCamoNoise; // effects for the swirly camo cloud stuff
varying vec2 vTexCoord;
varying vec3 vEyeVector; // These are all in tangent space
varying vec3 vLight0Vector;
varying vec3 vLight1Vector;
varying float LightLevel;
// Constants
const float KspecExponent = 15.0;
const float k2Pi = 6.283185307179586;
const float kTimeRate = 0.2;
const float uSharpen = 8.0;
const float Terminator = 0.3;
const float InvTerminator = 1.0 / (2.0 * Terminator);
// Uniforms from Oolite
uniform float uTime;
uniform float hull_heat_level;
uniform float uPersonality;
// Select between two camo colours
float CamoEffect(sampler2D texture, vec2 vTexCoord)
{
float n1, n2, n3, n4;
float time = uTime * uPersonality;
n1 = texture2D(texture, vTexCoord + vec2(0.01, 0.005) * time).r;
n2 = texture2D(texture, vTexCoord + vec2(0.013, -0.02) * time).g;
n3 = texture2D(texture, vTexCoord + vec2(-0.008, 0.017) * time).b;
n4 = texture2D(texture, vTexCoord + vec2(-0.019, -0.151) * time).a;
n1 = sin(n1 * k2Pi + time);
n2 = sin(n2 * k2Pi * 3.0 + time * 1.003) * 0.5;
n3 = sin(n3 * k2Pi + time * 2.0);
n4 = sin(n4 * k2Pi + time * 3.337);
// 7.0 is the total magnitude of n1..n4 times two.
float scaledSharpen = uSharpen / 7.0;
float n = (n1 + n2 + n3 + n4);
return smoothstep(0.0, 1.0, n * scaledSharpen);
}
// Irregular flickering function
#ifndef OO_REDUCED_COMPLEXITY
// Hull Temperate heat glow effect
vec3 TemperatureGlow(float level)
{
vec3 result = vec3(0);
result.r = level;
result.g = level * level * level;
result.b = max(level - 0.7, 0.0) * 2.0;
return result;
}
#endif
void Light(in vec3 lightVector, in vec3 normal, in vec3 lightColor, in vec3 eyeVector,
in float KspecExponent, inout vec3 totalDiffuse, inout vec3 totalSpecular)
{
lightVector = normalize(lightVector);
vec3 reflection = normalize(-reflect(lightVector, normal));
totalDiffuse += gl_FrontMaterial.diffuse.rgb * lightColor * max(dot(normal, lightVector), 0.0);
totalSpecular += lightColor * pow(max(dot(reflection, eyeVector), 0.0), KspecExponent);
}
#define LIGHT(idx, vector) Light(vector, normal, gl_LightSource[idx].diffuse.rgb, eyeVector, KspecExponent, diffuse, specular)
void main()
{
vec3 eyeVector = normalize(vEyeVector);
vec3 normal = normalize(texture2D(uNormalMap, vTexCoord).rgb - 0.5);
vec3 colorMap = texture2D(uColorMap, vTexCoord).rgb;
vec3 diffuse = vec3(0.0), specular = vec3(0);
float specIntensity = texture2D(uNormalMap, vTexCoord).a;
#ifdef OO_LIGHT_0_FIX
LIGHT(0, normalize(vLight0Vector));
#endif
LIGHT(1, normalize(vLight1Vector)); // change the 0 to 1 when exporting back to oolite
diffuse += gl_FrontMaterial.ambient.rgb * gl_LightModel.ambient.rgb;
float cycletime = uTime * uPersonality;
vec3 color = diffuse * colorMap + colorMap * specular * specIntensity * 2.0;
vec3 CyclingIllumCol = vec3(clamp(sin(cycletime * 0.5),0.0, 1.0), clamp(sin(cycletime * 0.25), 0.0, 1.0), clamp(sin(cycletime * 0.125), 0.0, 1.0));
float mask = texture2D(uColorMap, vTexCoord).a;
#ifndef OO_REDUCED_COMPLEXITY
// these next glow effects are only available in full shader mode
float camoSelect = CamoEffect(uCamoNoise, vTexCoord);
vec3 camo1 = CyclingIllumCol;
vec3 camo2 = CyclingIllumCol * 2.0;
camo2 = camo2 * camo2; // camo foreground, sun-coloured with increased saturation
vec3 camo = mix(camo1, camo2, camoSelect);
vec3 gloweffect = camo * mask;
// fully dark
if (LightLevel < -Terminator)
{
color += gloweffect;
}
// within the twilight zone, mix
if (abs(LightLevel) < Terminator )
{
color+= mix(gloweffect, vec3(0.0), (LightLevel + Terminator) * InvTerminator);
}
// Add the all over hull temperature glow. Full Shader mode only
float hullHeat = max(hull_heat_level - 0.5, 0.0) * 2.0;
color += TemperatureGlow(hullHeat);
#endif
// do a simpler glow effect for simple shader mode
#ifdef OO_REDUCED_COMPLEXITY
color += mask * CyclingIllumCol;
#endif
gl_FragColor = vec4(color.rgb, 1.0);
}
How about ultra-dense 'unobtanium'.Cmd. Cheyd wrote:One note however, asteroids are too small to have sufficient mass for thermodynamic reactions.
Its not the problem that you wrapped it wrong. The problem is that it will never be possible to UV wrap a seamless tiled map fully around an object. There will always be an area were the joints don't fit. For wrapping a single texture, seamless around an object you will need something like a lat-long map to start with.Griff wrote:been mucking about with some dry cracked earth textures and the parallax shader, .... although once again i've UV unwrapped these really badly - some clearly visible and horrible seams in the texture which the parallax makes even worse !