Hard Light Productions Forums

Community Projects => The FreeSpace Upgrade Project => Topic started by: The E on October 05, 2010, 04:55:14 am

Title: Shaders for the MediaVPs
Post by: The E on October 05, 2010, 04:55:14 am
As those of you on IRC are aware, Zacam and I are working on new Shaders for the mediavps. While we are somewhat satisfied with the results so far, I wonder if anyone else here would be able and interested to work on these things. So, if you know GLSL, here's your chance to impress us. We're looking for Shaders that are preferably compatible with Shader Model 2, that can do per-pixel lighting, and that can process a maximum number of lights, as well as use all the textures FSO uses.

Technical stuff:
These Shaders should be used and tested with Antipodes 6.
The following information is passed to shaders by the engine:


The resulting shader should be saved as main-f.sdr for the fragment, and main-v.sdr for the vertex shader.

Note: Shader Model 2 compatibility is entirely optional.
Title: Re: Shaders for the MediaVPs
Post by: Woolie Wool on October 06, 2010, 12:00:30 am
This is exciting! Will SSAO be eventually included? Because that would be badass.
Title: Re: Shaders for the MediaVPs
Post by: The E on October 06, 2010, 01:50:59 am
Not planned at the moment.

However, I'd like you people to give these shaders here a try: http://blueplanet.fsmods.net/E/effects_ppl2.7z

Unpack them, and place the .sdr files in mediavps_3612\data\effects.


As an example, here's the shader source. Code is based on a concept by KeldorKatarn, tweaked to fit in with the antipodes builds by me and Zacam.

main-v.sdr:
Code: [Select]
#ifdef FLAG_ENV_MAP
uniform mat4 envMatrix;
varying vec3 envReflect;
#endif

#ifdef FLAG_NORMAL_MAP
varying mat3 tbnMatrix;
#endif

#ifdef FLAG_FOG
varying float fogDist;
#endif

varying vec4 position;
varying vec3 lNormal;

void main()
{
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_Position = ftransform();

 // Transform the normal into eye space and normalize the result.
position = gl_ModelViewMatrix * gl_Vertex;
vec3 normal = normalize(gl_NormalMatrix * gl_Normal);
lNormal = normal;

 #ifdef FLAG_NORMAL_MAP
 // Setup stuff for normal maps
vec3 t = normalize(gl_NormalMatrix * gl_MultiTexCoord1.xyz);
vec3 b = cross(normal, t) * gl_MultiTexCoord1.w;
tbnMatrix = mat3(t, b, normal);
 #endif

 #ifdef FLAG_ENV_MAP
 // Environment mapping reflection vector.
envReflect = reflect(position.xyz, normal);
envReflect = vec3(envMatrix * vec4(envReflect, 0.0));
envReflect = normalize(envReflect);
 #endif

gl_FrontColor = gl_Color;

 #ifdef FLAG_FOG
fogDist = clamp((gl_Position.z - gl_Fog.start) * 0.75 * gl_Fog.scale, 0.0, 1.0);
 #endif

 #ifdef __GLSL_CG_DATA_TYPES
 // Check necessary for ATI specific behavior
gl_ClipVertex = (gl_ModelViewMatrix * gl_Vertex);
 #endif
}

main-f.sdr:
Code: [Select]
#ifdef FLAG_LIGHT
uniform int n_lights;
#endif

#ifdef FLAG_DIFFUSE_MAP
uniform sampler2D sBasemap;
#endif

#ifdef FLAG_GLOW_MAP
uniform sampler2D sGlowmap;
#endif

#ifdef FLAG_SPEC_MAP
uniform sampler2D sSpecmap;
#endif

#ifdef FLAG_ENV_MAP
uniform samplerCube sEnvmap;
uniform bool alpha_spec;
varying vec3 envReflect;
#endif

#ifdef FLAG_NORMAL_MAP
uniform sampler2D sNormalmap;
varying mat3 tbnMatrix;
#endif

#ifdef FLAG_FOG
varying float fogDist;
#endif

varying vec4 position;
varying vec3 lNormal;

#if SHADER_MODEL == 2
  #define MAX_LIGHTS 2
#else
  #define MAX_LIGHTS 8
#endif

void main()
{
float attenuation;
float NdotL;
float NdotHV;
vec3 halfV;
vec3 lightDir;

vec3 eyeDir = vec3(normalize(-position).xyz); // Camera is at (0,0,0) in ModelView space
vec4 lightAmbientDiffuse = vec4(0.0, 0.0, 0.0, 1.0);
vec4 lightDiffuse = vec4(0.0, 0.0, 0.0, 1.0);
vec4 lightAmbient = gl_FrontMaterial.emission + (gl_LightModel.ambient * gl_FrontMaterial.ambient);
vec4 lightSpecular = vec4(0.0, 0.0, 0.0, 1.0);

 #ifdef FLAG_LIGHT
  #ifdef FLAG_NORMAL_MAP
// Normal map - convert from DXT5nm
vec3 normal;
normal.rg = (texture2D(sNormalmap, gl_TexCoord[0].xy).ag * 2.0) - 1.0;
normal.b = sqrt(1.0 - dot(normal.rg, normal.rg));
normal = normalize(tbnMatrix * normal);
  #else
vec3 normal = lNormal;
  #endif

#pragma optionNV unroll all
for (int i = 0; i < MAX_LIGHTS; ++i) {
  #if SHADER_MODEL > 2
if (i > n_lights)
break;
  #endif
float specularIntensity = 1.0;

// Attenuation and light direction
if (gl_LightSource[i].position.w != 0.0 && i == 0) {
// Positional light source
float dist = distance(gl_LightSource[i].position.xyz, position.xyz);

float spotEffect = 1.0;

if (gl_LightSource[i].spotCutoff < 91.0) {
spotEffect = dot(normalize(gl_LightSource[i].spotDirection), normalize(-position.xyz));

if (spotEffect < gl_LightSource[i].spotCosCutoff) {
spotEffect = 0.0;
}
}

attenuation = spotEffect / (gl_LightSource[i].constantAttenuation + (gl_LightSource[i].linearAttenuation * dist) + (gl_LightSource[i].quadraticAttenuation * dist) * dist);

lightDir = normalize(gl_LightSource[i].position.xyz - position.xyz);

specularIntensity = 8.6; // Point light
} else {
// Directional light source
attenuation = 1.0;
lightDir = normalize(gl_LightSource[i].position.xyz);

specularIntensity = 3.0; // Directional light
}

// Ambient and Diffuse
NdotL = max(dot(normal, lightDir), 0.0);
if (NdotL > 0.0)
lightAmbient += (gl_FrontLightProduct[i].ambient * attenuation);

lightDiffuse += ((gl_FrontLightProduct[i].diffuse * NdotL) * attenuation);

// Specular
halfV = normalize(eyeDir + lightDir);
NdotHV = clamp(dot(normal, halfV), 0.0, 1.0);

lightSpecular += ((gl_FrontLightProduct[i].specular * pow(NdotHV, gl_FrontMaterial.shininess)) * attenuation) * specularIntensity;
}

lightAmbientDiffuse = lightAmbient + lightDiffuse;
 #else
lightAmbientDiffuse = gl_Color;
lightSpecular = gl_SecondaryColor;
 #endif

 #ifdef FLAG_DIFFUSE_MAP
 // Base color
vec4 baseColor = gl_Color * texture2D(sBasemap, gl_TexCoord[0].xy);
 #else
vec4 baseColor = gl_Color;
 #endif

vec4 fragmentColor = baseColor * max(lightAmbientDiffuse, gl_LightModel.ambient - 0.425);
fragmentColor.a = baseColor.a + (dot(lightSpecular, lightSpecular) * 0.1);

 #ifdef FLAG_SPEC_MAP
 // Spec color
float specularFactor = 1.75;
fragmentColor.rgb += specularFactor * (texture2D(sSpecmap, gl_TexCoord[0].xy).rgb * lightSpecular.rgb);
 #endif

 #ifdef FLAG_ENV_MAP
 // Env color
vec3 envIntensity = (alpha_spec) ? vec3(texture2D(sSpecmap, gl_TexCoord[0].xy).a) : texture2D(sSpecmap, gl_TexCoord[0].xy).rgb;
fragmentColor.a += dot(textureCube(sEnvmap, envReflect).rgb, textureCube(sEnvmap, envReflect).rgb) * 0.4;
fragmentColor.rgb += textureCube(sEnvmap, envReflect).rgb * envIntensity;
 #endif

 #ifdef FLAG_GLOW_MAP
 // Glow color
fragmentColor.rgb += texture2D(sGlowmap, gl_TexCoord[0].xy).rgb * 1.5;
 #endif

 #ifdef FLAG_FOG
fragmentColor.rgb = mix(fragmentColor.rgb, gl_Fog.color.rgb, fogDist);
 #endif

gl_FragColor = fragmentColor;
}
Title: Re: Shaders for the MediaVPs
Post by: Raven2001 on October 06, 2010, 05:55:51 am
More shaders! Sounds great!

Could you give a rough description of what those shaders are supposed to do, for those of us who are crap at understanding code? :)
Title: Re: Shaders for the MediaVPs
Post by: The E on October 06, 2010, 06:02:08 am
Well, basically, Shaders are programs that run on your GPU that are responsible for producing pretty pictures from raw data. The original mediavps shaders are built to emulate the fixed render pipeline as closely as possible (with the addition of normal maps, obviously).

These shaders, on the other hand, move the lighting processing from a per-Vertex to a per-Pixel model. Previously, lighting values were only generated for every vertex in the on-screen geometry and then interpolated between adjacent vertices. These ones process lighting much more accurately. In addition, the previous shaders only did normal mapping calculations for the strongest light in the scene, these ones use normal maps for all lights.

Now, to get these working on SM2-level cards, it was unfortunately necessary to cut down on the number of lights being processed. On SM3 or better cards, these shaders will render all 8 lights, on SM2, only the 2 strongest ones are used. That's the point I would like to see addressed; the more lights we can get on SM2, the better (with the added hope that any optimizations done for SM2 will allow these thingies to run faster on SM3 as well).

But the point of this topic is for others to post shaders as well; just to get some variety going.
Title: Re: Shaders for the MediaVPs
Post by: Kolgena on October 06, 2010, 09:04:16 am
Sounds impressive. (I too, know jack all about code, though I understand a bit of the theory of how shaders work)

What kind of performance are we looking to get from these shaders? (Also, how do the ones you just posted perform compared to current ones?)
Title: Re: Shaders for the MediaVPs
Post by: The E on October 06, 2010, 09:06:54 am
More accurate lighting means more math needed, as a result, these might be a bit slower. I haven't done any benchmarking on them, but the performance hit should be minimal on modern hardware.
Title: Re: Shaders for the MediaVPs
Post by: Kolgena on October 06, 2010, 09:30:04 am
I just tested them in massivebattle2. Lighting is much more detailed now, especially in the way the cap ships respond to explosion lights. They're no longer awash in yellow with no normal map detail.

Flicker as the engine decides which lights to draw is pretty bad though, and isn't something my screenshots can capture. It's the same as it was before, but since the lighting is much more vivid, it becomes more obvious. If there's a way, it'd be nice to fix the behavior now that we're tweaking light rendering anyways. Part of it is probably due to my lighting settings, which aren't customized around the new lighting behavior. It makes the shivan stuff look too shiny and something like crinkled tinfoil.

Screenshots were taken after Orion and Hecate died. That means that all green lights are prometheus, all purple lights are subach. Orange is either flak or exploding fighters. White is the sun.

-fov 0.60 -spec_exp 4.5 -spec_tube 1.8 -spec_point 2.2 -spec_static 3 -ambient_factor 105 -ogl_spec 85 -no_emissive_light -bloom_intensity 80

Overall, it's a huge improvement. In less busy "real" missions, the lighting should appear less buggy than it is.

Edit: You've probably come across this: http://www.opengl.org/registry/specs/ARB/shadow_ambient.txt (http://www.opengl.org/registry/specs/ARB/shadow_ambient.txt). Can we expect shadows as an eventuality of your work? :D

[attachment deleted by admin]
Title: Re: Shaders for the MediaVPs
Post by: Zacam on October 06, 2010, 11:22:19 am
Shadowing and/or Ambient Occlusion are planned (at least by me) to be in the works at some point.

If we can get a shader library developed for the shaders to access rather than being limited by Vertex->Fragment (as not all GPU OpenGL compilers will support passing back from Fragment->Vertex) then this means we can see more lights by building our own light structures and then passing those. Then it can select to either run some lights in the Vertex shader, and the rest in the fragment shader. This might also allow for more lights on SM2.0 due to execution limits, but I'm not sure (it's been a long time since dealing with non-pooled unified arch)

Why our own light's structure? Well, I have a theory that says the reason why the normal mapping didn't work on the old shaders on ATi cards is 22-fold: exposure to n_lights from the engine (though upon reflection, I'm wrong on that one) and the fact that under the old shaders, -normal was only applying to a fixed gl_LightSource, which may or may not be created.

Additionally, we need to look at building our own structures as several things in the existing shaders are deprecated, which forces relying on compatibility being present. If you look at the above concept shaders, we had to add a "#pragma optionNV unroll all" so that an nVidia card running the 2xx.xx series drives could actually use the light loop without throwing a relative-addressedarrays error to the Cg Compiler. We shouldn't _have_ to be relying on a #pragma option that in itself could end up disappearing on us.

But to address your screenshots Kolgena, those are pretty nice. And yes, there is a Specular highlighting issue with weapons fire reflectivity as it also apparently has some creation "hang-time" (it seems to highlights for the lifetime of the effect rather than by proximity to surface) which is another thing that could be addressed by defining our own structures in a library system.

In regards to the specular specifically:
Code: (main-f.sdr) [Select]
specularIntensity = 8.6; // Point light
specularIntensity = 3.0; // Directional light

If you set those two to 4.3 and 1.5 respectively, you'll get a near perfect Spec amount as the existing shaders, but the highlighting effect "hang-time" will still persist.

I personally use:
-bloom_intensity 90 -ambient_factor 35 -no_emissive_light -spec_exp 11 -spec_point 0.6 -spec_static 0.8 -spec_tube 0.4 -ogl_spec 30
Title: Re: Shaders for the MediaVPs
Post by: Kolgena on October 06, 2010, 07:10:08 pm
I don't think the shader is giving insignia any lighting. Either that, or it's something else making it look strange.
Title: Re: Shaders for the MediaVPs
Post by: Zacam on October 06, 2010, 08:21:25 pm
If in ref to MediaVPs models: Not all ships that should have insignia have them. And in many, either something is flipped or not set right.

For the Ulysses, for example, one wing displays fine, but the other one is more subdued and more transparent. This is simply because of how the model was set up and will likely be corrected at some point.

If you'd like to provide a screenshot of any FSU material that you think is rendering wrong, I can confirm if it is the shader or not.
Title: Re: Shaders for the MediaVPs
Post by: The E on October 06, 2010, 08:44:32 pm
In case of the decals, be aware that those never, ever get passed to the shaders, I believe (Or if they do, they are only treated with the basic lighting shader, without the benefit of Normals, shines, etc).
Title: Re: Shaders for the MediaVPs
Post by: Zacam on October 06, 2010, 10:20:25 pm
Hmm. Quite right. That should be interesting to try and "fix".
Title: Re: Shaders for the MediaVPs
Post by: Macfie on October 07, 2010, 04:41:25 am
I found a couple of problems with the shaders.  
One, the weapons effects appear to be too exaggerated.  They cause an excessive flash on the large ships present in the mission.  This was in an FSPort mission so there were no beams being used, only lasers and missiles.  
Secondly on the Orion in the mission the tiles in the hull appear to be surrounded by a transparent line that allows you to see through the ship.

I'm using Windows Vista and a Nvidia GT120 video card.
I tried both the Antipodes 6d and the latest nightly build.  The problem goes away when the shaders are removed

[attachment deleted by admin]
Title: Re: Shaders for the MediaVPs
Post by: The E on October 07, 2010, 04:58:33 am

Secondly on the Orion in the mission the tiles in the hull appear to be surrounded by a transparent line that allows you to see through the ship.

We can haz screenshots?
Title: Re: Shaders for the MediaVPs
Post by: pecenipicek on October 07, 2010, 06:42:13 am
as a side note, this overall increases the shinyness of already shiny-as-hell ships.
Title: Re: Shaders for the MediaVPs
Post by: Kolgena on October 07, 2010, 09:22:57 am
That it does. Still, with changed lighting tags, you can make it look closer to the original look. Try light intensities that are 1/4 of what you have now, and drop oglspec by a fair bit.

I mean, with what is essentially a lighting system haulover, you can't expect settings for the old system to keep working.
Title: Re: Shaders for the MediaVPs
Post by: pecenipicek on October 07, 2010, 10:42:08 am
I dont, i'm just commenting.



I'm quite aware of the fact that this throws most of the old values out the window, and requires proper tweaking.
Title: Re: Shaders for the MediaVPs
Post by: Kolgena on October 07, 2010, 11:17:14 am
My reply was more directed at Macfie, or people like me who didn't tweak their light settings after installing the shaders.
Title: Re: Shaders for the MediaVPs
Post by: rscaper1070 on October 07, 2010, 11:27:25 am
Updating the wiki with settings that apply to these shaders would be a good idea.
Title: Re: Shaders for the MediaVPs
Post by: Zacam on October 07, 2010, 12:23:40 pm
Actually, changing the cmdline options don't need to happen.
Changing the above mentioned specularIntensity changes (to 4.3 and 1.5 respectively) should provide practical results.

Most ATI users can go into the shaders and change:
Code: (main-f.sdr) [Select]
if (gl_LightSource[i].position.w != 0.0 && i == 0) {
to
Code: (main-f.sdr) [Select]
if (gl_LightSource[i].position.w == 1.0) {
As well, there is a possibility that a driver update may work as well. ATI is rather notorious for their drivers, especially on older cards.

For nVidia users of the 257.12/257.21/258.69/258.96 drivers, you can update to the 259.31 (Developer Drivers) or possibly 260.63 (Beta Drivers) and change the above displayed gl_LightSource line and delete the "#pragma optionNV unroll all" line just above it. Otherwise, you're sadly stuck with what is currently here or the existing non-optimized .12 shaders.
Title: Re: Shaders for the MediaVPs
Post by: Macfie on October 07, 2010, 01:15:50 pm
My reply was more directed at Macfie, or people like me who didn't tweak their light settings after installing the shaders.

Actually I did tweak the light settings.  I was really more concerned with the fact I could see through the Orion.  The before was prior to a weapons discharge and the after was the lighting change that occured post discharge.
Title: Re: Shaders for the MediaVPs
Post by: Kolgena on October 07, 2010, 02:38:31 pm

Most ATI users can go into the shaders and change:
Code: (main-f.sdr) [Select]
if (gl_LightSource[i].position.w != 0.0 && i == 0) {
to
Code: (main-f.sdr) [Select]
if (gl_LightSource[i].position.w == 1.0) {
As well, there is a possibility that a driver update may work as well. ATI is rather notorious for their drivers, especially on older cards.

For nVidia users of the 257.12/257.21/258.69/258.96 drivers, you can update to the 259.31 (Developer Drivers) or possibly 260.63 (Beta Drivers) and change the above displayed gl_LightSource line and delete the "#pragma optionNV unroll all" line just above it. Otherwise, you're sadly stuck with what is currently here or the existing non-optimized .12 shaders.


What is this supposed to do? Enable better hardware support or fix the lighting bugs?
Title: Re: Shaders for the MediaVPs
Post by: Zacam on October 07, 2010, 03:36:12 pm
Well, whatever it is or is not supposed to do, it won't catch anything on fire, so maybe you can try it and then you can tell me what it actually does.

On the nVidia developer drivers for my 8800 GT, 9800 and 460, it's a significant and pleasant difference.
Title: Re: Shaders for the MediaVPs
Post by: Kolgena on October 07, 2010, 04:18:26 pm
Yeah, I applied the specular value halving and the ==1 thing at the same time, so I honestly can't say what the ==1 thing does... :/

I'm inclined to say that it looks better, but not why or how. Edit: Lighting from damage lightning looks a ton better, but I don't know what that means for other lights in the scene.

As a side note, when I'm close up to something like a Ravana, and it has lots of point lights reflecting off of it, my frames die hardcore :D I probably won't be able to play at 1080p on my mobility 3650 anymore, but that's okay.


Not a double post:

I can reproduce the invisibility lines problem that Macfie first noticed. It seems to be a normal map problem, but only for certain textures. You can see other normal mapped sections on the same ship that do not suffer the problem. (The ones that work have narrower mapped grooves, if that matters at all). Edit: It is a normal map problem. Turning them off fixes the problem, while turning anything else off does not. Size/style of the normal mapping seems to have nothing to do with it (obviously), as the Aeolus with a similar thick groove scheme doesn't seem to be affected.

[attachment deleted by admin]
Title: Re: Shaders for the MediaVPs
Post by: Zacam on October 08, 2010, 01:39:32 am
Problem is the Capital01-02-Normal.dds file. It's too "extreme" on it's ranges with White and Black being too close together.

I did a spot replacement of that file, problem (no pun intended) disappears.

This may well be visible under the .12 shaders, or may be so muted (because -normals are only driven by 1 light in those) that nobody noticed until now.
(EDIT: The .12 shaders might not have made the area transparent, but super black/dark Babylon5-shadow ship strange looking or speckled)
(2nd Edit: It also appears that the lighting direction on the normal is the wrong way around. On the Green channel, the bright spots should be to the left, not the right)
(3rd Edit: Attached fixed map)

4th Edit: In looking at other ship normal maps, when viewing only the Green and Alpha channels, the lines are _supposed_ to look like protrusions (pop out TO you) not recessed (going away from you), so I can only guess that there is some sort of previously unknown UV issue with the model, because otherwise if the directionality held true for all the rest of the models, we'd be seeing this with every other ship in the game.

5th Edit: For a better clarification, look at a nicely defined normal map like VCTile1-Normal.dds

[attachment deleted by admin]
Title: Re: Shaders for the MediaVPs
Post by: Zacam on October 08, 2010, 02:47:41 pm
Double. Sue me.

So, while the issue is the normal maps having excessive range, it should be handled better than to induce transparent clipping.

Code: (main-f.sdr) [Select]
#ifdef FLAG_LIGHT
uniform int n_lights;
#endif

#ifdef FLAG_DIFFUSE_MAP
uniform sampler2D sBasemap;
#endif

#ifdef FLAG_GLOW_MAP
uniform sampler2D sGlowmap;
#endif

#ifdef FLAG_SPEC_MAP
uniform sampler2D sSpecmap;
#endif

#ifdef FLAG_ENV_MAP
uniform samplerCube sEnvmap;
uniform bool alpha_spec;
varying vec3 envReflect;
#endif

#ifdef FLAG_NORMAL_MAP
uniform sampler2D sNormalmap;
varying mat3 tbnMatrix;
#endif

#ifdef FLAG_FOG
varying float fogDist;
#endif

varying vec4 position;
varying vec3 lNormal;

#if SHADER_MODEL == 2
  #define MAX_LIGHTS 2
#else
  #define MAX_LIGHTS 8
#endif

void main()
{
float attenuation;
float NdotL;
float NdotHV;
vec3 lightDir;

vec3 eyeDir = vec3(normalize(-position).xyz); // Camera is at (0,0,0) in ModelView space
vec4 lightAmbientDiffuse = vec4(0.0, 0.0, 0.0, 1.0);
vec4 lightDiffuse = vec4(0.0, 0.0, 0.0, 1.0);
vec4 lightAmbient = gl_FrontMaterial.emission + (gl_LightModel.ambient * gl_FrontMaterial.ambient);
vec4 lightSpecular = vec4(0.0, 0.0, 0.0, 1.0);
vec2 texCoord = gl_TexCoord[0].xy;

 #ifdef FLAG_LIGHT
  #ifdef FLAG_NORMAL_MAP
// Normal map - convert from DXT5nm
vec3 normal;
normal.rg = (texture2D(sNormalmap, texCoord).ag * 2.0) - 1.0;
normal.b = sqrt(1.0 - dot(normal.rg, normal.rg));
normal = normalize(tbnMatrix * normal);
  #else
vec3 normal = lNormal;
  #endif

#pragma optionNV unroll all
for (int i = 0; i < MAX_LIGHTS; ++i) {
  #if SHADER_MODEL > 2
if (i > n_lights)
break;
  #endif
float specularIntensity = 1.0;

// Attenuation and light direction
  #if SHADER_MODEL > 2
if (gl_LightSource[i].position.w == 1.0) {
  #else
if (gl_LightSource[i].position.w == 1.0 && i != 0) {
  #endif
// Positional light source
float dist = distance(gl_LightSource[i].position.xyz, position.xyz);

float spotEffect = 1.0;

if (gl_LightSource[i].spotCutoff < 91.0) {
spotEffect = dot(normalize(gl_LightSource[i].spotDirection), normalize(-position.xyz));

if (spotEffect < gl_LightSource[i].spotCosCutoff) {
spotEffect = 0.0;
}
}

attenuation = spotEffect / (gl_LightSource[i].constantAttenuation + (gl_LightSource[i].linearAttenuation * dist) + (gl_LightSource[i].quadraticAttenuation * dist * dist));

lightDir = normalize(gl_LightSource[i].position.xyz - position.xyz);

specularIntensity = 4.3; // Point light
} else {
// Directional light source
attenuation = 1.0;
lightDir = normalize(gl_LightSource[i].position.xyz);

specularIntensity = 1.5; // Directional light
}

// Ambient and Diffuse
NdotL = max(dot(normal, lightDir), 0.0);
lightAmbient += (gl_FrontLightProduct[i].ambient * attenuation);
lightDiffuse += ((gl_FrontLightProduct[i].diffuse * NdotL) * attenuation);

// Specular
NdotHV = clamp(dot(normal, normalize(eyeDir + lightDir)), 0.0, 1.0);
lightSpecular += ((gl_FrontLightProduct[i].specular * pow(max(0.0, NdotHV), gl_FrontMaterial.shininess)) * attenuation) * specularIntensity;
}

lightAmbientDiffuse = lightAmbient + lightDiffuse;
 #else
lightAmbientDiffuse = gl_Color;
lightSpecular = gl_SecondaryColor;
 #endif

 #ifdef FLAG_DIFFUSE_MAP
 // Base color
vec4 baseColor = gl_Color * texture2D(sBasemap, texCoord);
 #else
vec4 baseColor = gl_Color;
 #endif

vec4 fragmentColor = baseColor * max(lightAmbientDiffuse, gl_LightModel.ambient - 0.425);
fragmentColor.a = baseColor.a + (dot(lightSpecular, lightSpecular) * 0.1);

 #ifdef FLAG_SPEC_MAP
 // Spec color
float specularFactor = 1.75;
fragmentColor.rgb += lightSpecular.rgb * (texture2D(sSpecmap, texCoord).rgb * specularFactor);
 #else
fragmentColor.rgb += lightSpecular.rgb * (baseColor.rgb * 0.6);
 #endif

 #ifdef FLAG_ENV_MAP
 // Env color
vec3 envIntensity = (alpha_spec) ? vec3(texture2D(sSpecmap, texCoord).a) : texture2D(sSpecmap, texCoord).rgb;
fragmentColor.a += (dot(textureCube(sEnvmap, envReflect).rgb, textureCube(sEnvmap, envReflect).rgb) * 0.3);
fragmentColor.rgb += textureCube(sEnvmap, envReflect).rgb * envIntensity;
 #endif

 #ifdef FLAG_GLOW_MAP
 // Glow color
fragmentColor.rgb += texture2D(sGlowmap, texCoord).rgb * 1.5;
 #endif

 #ifdef FLAG_FOG
fragmentColor.rgb = mix(fragmentColor.rgb, gl_Fog.color.rgb, fogDist);
 #endif

gl_FragColor = fragmentColor;
}
Title: Re: Shaders for the MediaVPs
Post by: pecenipicek on October 08, 2010, 03:14:30 pm
also, models with only the diffuse texture come out being... well, transparent. (not a big problem there for me, just throwing it out as a comment)
Title: Re: Shaders for the MediaVPs
Post by: Macfie on October 08, 2010, 04:33:52 pm
The Orion map is still not completely fixed. There are still portions that are transparent you have to look very closely to see it but the lines on some of the tiles are transparent. You have to be very close to the Orion to see it so it is not a big problem. Didn't post a screen shot because it was difficult to see in the screen shot. It mostly shows up in the round design on the port side of the Orion.  I think it's in the capitol01-01 normal map.
Title: Re: Shaders for the MediaVPs
Post by: Zacam on October 08, 2010, 04:39:45 pm
also, models with only the diffuse texture come out being... well, transparent. (not a big problem there for me, just throwing it out as a comment)

Wait, what? With what I just posted, or with what was posted earlier?

With what I just posted (and the previous -v.sdr because nothing changed there), I disabled all but the diffuse maps for the Ulysses and it showed up just fine.

I do know that these shaders are a little less forgiving of some UV/Geometry errors. Look at the Charybdis in the LAB and notice that the bottom rear is completely transparent now. Until/Unless you switch to Fixed Rendering.
Title: Re: Shaders for the MediaVPs
Post by: Zacam on October 08, 2010, 04:41:00 pm
The Orion map is still not completely fixed. There are still portions that are transparent you have to look very closely to see it but the lines on some of the tiles are transparent. You have to be very close to the Orion to see it so it is not a big problem. Didn't post a screen shot because it was difficult to see in the screen shot. It mostly shows up in the round design on the port side of the Orion.  I think it's in the capitol01-01 normal map.

Correct, I noticed that later, but then decided that having a clamp in the shaders might be better than allowing transparency clipping (Except maybe as a Dev tool). The maps still need fixing, but at least with the above recent post, you should now have a solid appearing Orion.
Title: Re: Shaders for the MediaVPs
Post by: Macfie on October 08, 2010, 06:41:53 pm
Everything seems to work for the Orion without the modified map using the modified main-f.sdr.
Title: Re: Shaders for the MediaVPs
Post by: pecenipicek on October 08, 2010, 07:37:54 pm
The Orion map is still not completely fixed. There are still portions that are transparent you have to look very closely to see it but the lines on some of the tiles are transparent. You have to be very close to the Orion to see it so it is not a big problem. Didn't post a screen shot because it was difficult to see in the screen shot. It mostly shows up in the round design on the port side of the Orion.  I think it's in the capitol01-01 normal map.
the new one fixed it.



as a side note, and its something i've noticed since starting to work with textures for real, env-mapping is applied always with non-antipodes builds if a shine map is present and the alpha map is missing from it. with an opacity 0 alpha map there should be no env-mapping, but without an alpha map present in the shine texture, it behaves like its at opacity 100.

with antipodes, it has approximately 50% env map (eyeballing it here), even tho the model itself has only the diffuse map.


F3 lab screenie, env map disabled
(http://img340.imageshack.us/img340/3717/screen0105.jpg)
F3 lab screenie, env map enabled
(http://img46.imageshack.us/img46/1850/screen0104s.jpg)




Do note, however, that this is just a temp model, i cant rule out any mesh idiocy or other problems. I do not think it matters in this case tho, as i've had the env-mapping thing happen with other models too in non-antipodes builds. (no alpha in shine = full blown env map)
Title: Re: Shaders for the MediaVPs
Post by: Woolie Wool on October 08, 2010, 09:41:09 pm
http://www.youtube.com/watch?v=FbUwxpC1FsQ

This is one of the weirdest bugs I've ever seen.
Title: Re: Shaders for the MediaVPs
Post by: Kolgena on October 08, 2010, 09:46:57 pm
It looks like it might be caused by a point white light with high intensity or proximity is lighting up the cockpit. Either an explosion effect or damage lighting. I didn't look at a high-res version of the vid though, so I can't be sure.


Btw, the new shaders Zacam posted fixes transparency, but in spots where it used to be transparent, it's now solid black regardless of lighting. Is this normal? (This is on the GTC Hyperion of BP)
Title: Re: Shaders for the MediaVPs
Post by: Talon 1024 on October 08, 2010, 11:17:18 pm
Here are the problems I've encountered so far with the latest shaders...

1. Weapon blasts still illuminate ships, even after they have disappeared.  This problem does not go away even if I restart the mission. [EDIT: Occurs on 3.6.12 final.  Does not occur on Antipodes 6, but it appears that this problem is "replaced" by problem 3 when running Antipodes 6.  The position of the lights is relative to the camera's position.]
(http://www.ciinet.org/kevin/myimages/ASWnewshaders.png) (http://www.ciinet.org/kevin/myimages/ASWnewshaders.png)
2. Ships without all map types (diffuse/spec/normal/glow) will disappear if they are affected by the shaders. [EDIT: Occurs on Antipodes 6, but not 3.6.12 final.]

[EDIT]
3. This problem (ships become black (actually transparent) and white) occurs on Antipodes 6, but not 3.6.12 final.
(http://www.ciinet.org/kevin/myimages/ASWshaderbug2.png) (http://www.ciinet.org/kevin/myimages/ASWshaderbug2.png)
Title: Re: Shaders for the MediaVPs
Post by: Zacam on October 09, 2010, 06:39:53 am
http://www.youtube.com/watch?v=FbUwxpC1FsQ

This is one of the weirdest bugs I've ever seen.

I'm pretty sure Wing Commander will have it's own shaders as it will have it's own optimizations it will be running.

Here are the problems I've encountered so far with the latest shaders...

1. Weapon blasts still illuminate ships, even after they have disappeared.  This problem does not go away even if I restart the mission. [EDIT: Occurs on 3.6.12 final.  Does not occur on Antipodes 6, but it appears that this problem is "replaced" by problem 3 when running Antipodes 6.  The position of the lights is relative to the camera's position.]

While it _is_ possible to run these shaders on Trunk/Nightlies, they don't have the code for recognizing the "#if SHADER_MODEL" pre-processor options, so as a result, it doesn't handle them. At all.

2. Ships without all map types (diffuse/spec/normal/glow) will disappear if they are affected by the shaders. [EDIT: Occurs on Antipodes 6, but not 3.6.12 final.]

Uh....wut. ?? As a test, I deleted all bu the diffuse maps on the MediaVP Ulysses. Displayed just fine. LAB was checked by toggling map types off and on as well as running the builds with the command line option disabled.

3. This problem (ships become black (actually transparent) and white) occurs on Antipodes 6, but not 3.6.12 final.

I'd like to see your fs2_open.log from that. As well as your system specs (specifically Video Card and what driver version)
Title: Re: Shaders for the MediaVPs
Post by: Talon 1024 on October 09, 2010, 08:10:25 am
http://www.youtube.com/watch?v=FbUwxpC1FsQ

This is one of the weirdest bugs I've ever seen.

I'm pretty sure Wing Commander will have it's own shaders as it will have it's own optimizations it will be running.
Wing Commander Saga will have it's own shaders, but me and Woolie Wool can only have what's available to everyone else.
2. Ships without all map types (diffuse/spec/normal/glow) will disappear if they are affected by the shaders. [EDIT: Occurs on Antipodes 6, but not 3.6.12 final.]

Uh....wut. ?? As a test, I deleted all bu the diffuse maps on the MediaVP Ulysses. Displayed just fine. LAB was checked by toggling map types off and on as well as running the builds with the command line option disabled.
Try putting it in a mission and firing weapons at it...  Instead of being illuminated by the weapon blasts, it will just disappear until the weapon blasts are gone.  At least, that's what happened to me.
3. This problem (ships become black (actually transparent) and white) occurs on Antipodes 6, but not 3.6.12 final.

I'd like to see your fs2_open.log from that. As well as your system specs (specifically Video Card and what driver version)
Here you go.
Code: [Select]
==========================================================================
DEBUG SPEW: No debug_filter.cfg found, so only general, error, and warning
categories can be shown and no debug_filter.cfg info will be saved.
==========================================================================
FreeSpace version: 3.6.13
Passed cmdline options:
  -spec_exp 15
  -ogl_spec 40
  -spec_static 2.7
  -spec_point 5.0
  -spec_tube 4.0
  -ambient_factor 80
  -env
  -mipmap
  -missile_lighting
  -glow
  -spec
  -normal
  -3dshockwave
  -post_process
  -ballistic_gauge
  -dualscanlines
  -rearm_timer
  -targetinfo
  -3dwarp
  -ship_choice_3d
  -weapon_choice_3d
  -warp_flash
  -mod ASW1_3612,mediavps_3612
Building file index...
Found root pack 'C:\Program Files\Games\GOG.com\Freespace2\ASW1_3612\ASW1_3612.vp' with a checksum of 0xd5e22b30
Found root pack 'C:\Program Files\Games\GOG.com\Freespace2\ASW1_3612\ASW_3612_adv.vp' with a checksum of 0x5c319768
Found root pack 'C:\Program Files\Games\GOG.com\Freespace2\ASW1_3612\ASW_3612_Intro.vp' with a checksum of 0xadda0cc1
Found root pack 'C:\Program Files\Games\GOG.com\Freespace2\ASW1_3612\ASW_3612_Normals.vp' with a checksum of 0x1581b3b4
Found root pack 'C:\Program Files\Games\GOG.com\Freespace2\mediavps_3612\3612_Ant-Cache.vp' with a checksum of 0x64d89f2a
Found root pack 'C:\Program Files\Games\GOG.com\Freespace2\mediavps_3612\MV_Advanced.vp' with a checksum of 0x4b8b0f5a
Found root pack 'C:\Program Files\Games\GOG.com\Freespace2\mediavps_3612\MV_Assets.vp' with a checksum of 0x529cc70f
Found root pack 'C:\Program Files\Games\GOG.com\Freespace2\mediavps_3612\MV_Effects.vp' with a checksum of 0xb9a9a485
Found root pack 'C:\Program Files\Games\GOG.com\Freespace2\mediavps_3612\MV_Music.vp' with a checksum of 0xb3e21469
Found root pack 'C:\Program Files\Games\GOG.com\Freespace2\mediavps_3612\MV_Root.vp' with a checksum of 0x6ffd5c78
Found root pack 'C:\Program Files\Games\GOG.com\Freespace2\Root_fs2.vp' with a checksum of 0xce10d76c
Found root pack 'C:\Program Files\Games\GOG.com\Freespace2\smarty_fs2.vp' with a checksum of 0xddeb3b1e
Found root pack 'C:\Program Files\Games\GOG.com\Freespace2\sparky_fs2.vp' with a checksum of 0x164fe65a
Found root pack 'C:\Program Files\Games\GOG.com\Freespace2\sparky_hi_fs2.vp' with a checksum of 0xa11d56f1
Found root pack 'C:\Program Files\Games\GOG.com\Freespace2\stu_fs2.vp' with a checksum of 0xd77da83a
Found root pack 'C:\Program Files\Games\GOG.com\Freespace2\tango1_fs2.vp' with a checksum of 0x4c25221e
Found root pack 'C:\Program Files\Games\GOG.com\Freespace2\tango2_fs2.vp' with a checksum of 0x86920b82
Found root pack 'C:\Program Files\Games\GOG.com\Freespace2\tango3_fs2.vp' with a checksum of 0x705e8d71
Found root pack 'C:\Program Files\Games\GOG.com\Freespace2\tangoA_fs2.vp' with a checksum of 0x2e10c984
Found root pack 'C:\Program Files\Games\GOG.com\Freespace2\tangoB_fs2.vp' with a checksum of 0x0a5f4659
Found root pack 'C:\Program Files\Games\GOG.com\Freespace2\warble_fs2.vp' with a checksum of 0xd85c305d
Searching root 'C:\Program Files\Games\GOG.com\Freespace2\ASW1_3612\' ... 35 files
Searching root pack 'C:\Program Files\Games\GOG.com\Freespace2\ASW1_3612\ASW1_3612.vp' ... 1226 files
Searching root pack 'C:\Program Files\Games\GOG.com\Freespace2\ASW1_3612\ASW_3612_adv.vp' ... 143 files
Searching root pack 'C:\Program Files\Games\GOG.com\Freespace2\ASW1_3612\ASW_3612_Intro.vp' ... 1 files
Searching root pack 'C:\Program Files\Games\GOG.com\Freespace2\ASW1_3612\ASW_3612_Normals.vp' ... 28 files
Searching root 'C:\Program Files\Games\GOG.com\Freespace2\mediavps_3612\' ... 125 files
Searching root pack 'C:\Program Files\Games\GOG.com\Freespace2\mediavps_3612\3612_Ant-Cache.vp' ... 199 files
Searching root pack 'C:\Program Files\Games\GOG.com\Freespace2\mediavps_3612\MV_Advanced.vp' ... 1283 files
Searching root pack 'C:\Program Files\Games\GOG.com\Freespace2\mediavps_3612\MV_Assets.vp' ... 1527 files
Searching root pack 'C:\Program Files\Games\GOG.com\Freespace2\mediavps_3612\MV_Effects.vp' ... 1876 files
Searching root pack 'C:\Program Files\Games\GOG.com\Freespace2\mediavps_3612\MV_Music.vp' ... 32 files
Searching root pack 'C:\Program Files\Games\GOG.com\Freespace2\mediavps_3612\MV_Root.vp' ... 94 files
Searching root 'C:\Program Files\Games\GOG.com\Freespace2\' ... 25 files
Searching root pack 'C:\Program Files\Games\GOG.com\Freespace2\Root_fs2.vp' ... 157 files
Searching root pack 'C:\Program Files\Games\GOG.com\Freespace2\smarty_fs2.vp' ... 10 files
Searching root pack 'C:\Program Files\Games\GOG.com\Freespace2\sparky_fs2.vp' ... 3027 files
Searching root pack 'C:\Program Files\Games\GOG.com\Freespace2\sparky_hi_fs2.vp' ... 1337 files
Searching root pack 'C:\Program Files\Games\GOG.com\Freespace2\stu_fs2.vp' ... 2355 files
Searching root pack 'C:\Program Files\Games\GOG.com\Freespace2\tango1_fs2.vp' ... 32 files
Searching root pack 'C:\Program Files\Games\GOG.com\Freespace2\tango2_fs2.vp' ... 15 files
Searching root pack 'C:\Program Files\Games\GOG.com\Freespace2\tango3_fs2.vp' ... 10 files
Searching root pack 'C:\Program Files\Games\GOG.com\Freespace2\tangoA_fs2.vp' ... 0 files
Searching root pack 'C:\Program Files\Games\GOG.com\Freespace2\tangoB_fs2.vp' ... 0 files
Searching root pack 'C:\Program Files\Games\GOG.com\Freespace2\warble_fs2.vp' ... 52 files
Searching root 'd:\' ... 0 files
Found 25 roots and 13589 files.
Setting language to English
TBM  =>  Starting parse of 'mv_core-lcl.tbm' ...
TBM  =>  Starting parse of 'ASW_strings-lcl.tbm' ...
Initializing OpenAL...
  OpenAL Vendor     : Creative Labs Inc.
  OpenAL Renderer   : Software
  OpenAL Version    : 1.1

  Found extension "ALC_EXT_EFX".

  Sample rate: 44100 (44100)
  EFX enabled: NO
  Playback device: Generic Hardware on Realtek HD Audio output
  Capture device: Realtek HD Audio Input
... OpenAL successfully initialized!
Initializing OpenGL graphics device at 1280x1024 with 32-bit color...
  Initializing WGL...
  Requested WGL Video values = R: 8, G: 8, B: 8, depth: 32, double-buffer: 1
  Actual WGL Video values    = R: 8, G: 8, B: 8, depth: 32, double-buffer: 1
  OpenGL Vendor    : NVIDIA Corporation
  OpenGL Renderer  : GeForce 9800 GT/PCI/SSE2
  OpenGL Version   : 3.3.0

  Using extension "GL_EXT_fog_coord".
  Using extension "GL_ARB_multitexture".
  Using extension "GL_ARB_texture_env_add".
  Using extension "GL_ARB_texture_compression".
  Using extension "GL_EXT_texture_compression_s3tc".
  Using extension "GL_EXT_texture_filter_anisotropic".
  Using extension "GL_ARB_texture_env_combine".
  Using extension "GL_EXT_compiled_vertex_array".
  Using extension "GL_EXT_draw_range_elements".
  Using extension "GL_ARB_texture_mirrored_repeat".
  Using extension "GL_ARB_texture_non_power_of_two".
  Using extension "GL_ARB_vertex_buffer_object".
  Using extension "GL_ARB_pixel_buffer_object".
  Using extension "GL_SGIS_generate_mipmap".
  Using extension "GL_EXT_framebuffer_object".
  Using extension "GL_ARB_texture_rectangle".
  Using extension "GL_EXT_bgra".
  Using extension "GL_ARB_texture_cube_map".
  Using extension "GL_EXT_texture_lod_bias".
  Using extension "GL_ARB_point_sprite".
  Using extension "GL_ARB_shading_language_100".
  Using extension "GL_ARB_shader_objects".
  Using extension "GL_ARB_vertex_shader".
  Using extension "GL_ARB_fragment_shader".
  Using extension "GL_NV_vertex_program3".
  Found special extension function "wglSwapIntervalEXT".

  Compiling shader: main-v.sdr (null-v.sdr), main-f.sdr (null-f.sdr)
  Compiling shader: main-v.sdr (l-v.sdr), main-f.sdr (lb-f.sdr)
  Compiling shader: main-v.sdr (b-v.sdr), main-f.sdr (b-f.sdr)
  Compiling shader: main-v.sdr (b-v.sdr), main-f.sdr (bg-f.sdr)
  Compiling shader: main-v.sdr (l-v.sdr), main-f.sdr (lbg-f.sdr)
  Compiling shader: main-v.sdr (l-v.sdr), main-f.sdr (lbgs-f.sdr)
  Compiling shader: main-v.sdr (l-v.sdr), main-f.sdr (lbs-f.sdr)
  Compiling shader: main-v.sdr (le-v.sdr), main-f.sdr (lbgse-f.sdr)
  Compiling shader: main-v.sdr (le-v.sdr), main-f.sdr (lbse-f.sdr)
  Compiling shader: main-v.sdr (ln-v.sdr), main-f.sdr (lbgn-f.sdr)
  Compiling shader: main-v.sdr (ln-v.sdr), main-f.sdr (lbgsn-f.sdr)
  Compiling shader: main-v.sdr (ln-v.sdr), main-f.sdr (lbn-f.sdr)
  Compiling shader: main-v.sdr (ln-v.sdr), main-f.sdr (lbsn-f.sdr)
  Compiling shader: main-v.sdr (lne-v.sdr), main-f.sdr (lbgsne-f.sdr)
  Compiling shader: main-v.sdr (lne-v.sdr), main-f.sdr (lbsne-f.sdr)
  Compiling shader: main-v.sdr (lf-v.sdr), main-f.sdr (lfb-f.sdr)
  Compiling shader: main-v.sdr (lf-v.sdr), main-f.sdr (lfbg-f.sdr)
  Compiling shader: main-v.sdr (lf-v.sdr), main-f.sdr (lfbgs-f.sdr)
  Compiling shader: main-v.sdr (lf-v.sdr), main-f.sdr (lfbs-f.sdr)
  Compiling shader: main-v.sdr (lfe-v.sdr), main-f.sdr (lfbgse-f.sdr)
  Compiling shader: main-v.sdr (lfe-v.sdr), main-f.sdr (lfbse-f.sdr)
  Compiling shader: main-v.sdr (lfn-v.sdr), main-f.sdr (lfbgn-f.sdr)
  Compiling shader: main-v.sdr (lfn-v.sdr), main-f.sdr (lfbgsn-f.sdr)
  Compiling shader: main-v.sdr (lfn-v.sdr), main-f.sdr (lfbn-f.sdr)
  Compiling shader: main-v.sdr (lfn-v.sdr), main-f.sdr (lfbsn-f.sdr)
  Compiling shader: main-v.sdr (lfne-v.sdr), main-f.sdr (lfbgsne-f.sdr)
  Compiling shader: main-v.sdr (lfne-v.sdr), main-f.sdr (lfbsne-f.sdr)
  Compiling shader: main-v.sdr (l-v.sdr), main-f.sdr (null-f.sdr)
  Compiling shader: main-v.sdr (l-v.sdr), main-f.sdr (lg-f.sdr)
  Compiling shader: main-v.sdr (l-v.sdr), main-f.sdr (lgs-f.sdr)
  Compiling shader: main-v.sdr (l-v.sdr), main-f.sdr (ls-f.sdr)
  Compiling shader: main-v.sdr (le-v.sdr), main-f.sdr (lgse-f.sdr)
  Compiling shader: main-v.sdr (le-v.sdr), main-f.sdr (lse-f.sdr)
  Compiling shader: main-v.sdr (ln-v.sdr), main-f.sdr (lgn-f.sdr)
  Compiling shader: main-v.sdr (ln-v.sdr), main-f.sdr (lgsn-f.sdr)
  Compiling shader: main-v.sdr (ln-v.sdr), main-f.sdr (ln-f.sdr)
  Compiling shader: main-v.sdr (ln-v.sdr), main-f.sdr (lsn-f.sdr)
  Compiling shader: main-v.sdr (lne-v.sdr), main-f.sdr (lgsne-f.sdr)
  Compiling shader: main-v.sdr (lne-v.sdr), main-f.sdr (lsne-f.sdr)

  Compiling post-processing shader 1 ...
  Compiling post-processing shader 2 ...
  Compiling post-processing shader 3 ...
  Compiling post-processing shader 4 ...

  Max texture units: 4 (32)
  Max elements vertices: 1048576
  Max elements indices: 1048576
  Max texture size: 8192x8192
  Max render buffer size: 8192x8192
  Can use compressed textures: YES
  Texture compression available: YES
  Post-processing enabled: YES
  Using trilinear texture filter.
  Using GLSL for model rendering.
  OpenGL Shader Version: 3.30 NVIDIA via Cg compiler
... OpenGL init is complete!
Size of bitmap info = 760 KB
Size of bitmap extra info = 52 bytes
ANI cursorweb with size 24x24 (25.0% wasted)
GRAPHICS: Initializing default colors...
SCRIPTING: Beginning initialization sequence...
SCRIPTING: Beginning Lua initialization...
LUA: Opening LUA state...
LUA: Initializing base Lua libraries...
LUA: Beginning ADE initialization
ADE: Initializing enumeration constants...
ADE: Assigning Lua session...
SCRIPTING: Beginning main hook parse sequence....
Wokka!  Error opening file (scripting.tbl)!
TABLES: Unable to parse 'scripting.tbl'!  Error code = 5.
TBM  =>  Starting parse of 'mv_flak-sct.tbm' ...
TBM  =>  Starting parse of 'mv_exp-sct.tbm' ...
TBM  =>  Starting parse of 'mv_dbrs-sct.tbm' ...
SCRIPTING: Inititialization complete.
SCRIPTING: Splash screen overrides checked
SCRIPTING: Splash hook has been run
SCRIPTING: Splash screen conditional hook has been run
Using high memory settings...
Wokka!  Error opening file (interface.tbl)!
WMCGUI: Unable to parse 'interface.tbl'!  Error code = 5.
TBM  =>  Starting parse of 'mv_effects-sdf.tbm' ...
ANI 2_radar1 with size 209x170 (33.6% wasted)
Windows reported 16 joysticks, we found 0
Current soundtrack set to -1 in event_music_reset_choices
TBM  =>  Starting parse of 'mv_music-mus.tbm' ...
TBM  =>  Starting parse of 'mv_effects-mfl.tbm' ...
TBM  =>  Starting parse of 'ASW-mfl.tbm' ...
TBM  =>  Starting parse of 'mv_effects-amr.tbm' ...
TBM  =>  Starting parse of 'mv_effects-wxp.tbm' ...
TBM  =>  Starting parse of 'ASW_effects-wxp.tbm' ...
BMPMAN: Found EFF (exp20.eff) with 75 frames at 20 fps.
BMPMAN: Found EFF (ExpMissileHit1.eff) with 92 frames at 20 fps.
BMPMAN: Found EFF (exp04.eff) with 49 frames at 22 fps.
BMPMAN: Found EFF (exp05.eff) with 93 frames at 20 fps.
BMPMAN: Found EFF (exp06.eff) with 92 frames at 22 fps.
BMPMAN: Found EFF (capflash.eff) with 40 frames at 10 fps.
BMPMAN: Found EFF (Maxim_Impact.eff) with 23 frames at 30 fps.
ANI Lamprey_Impact with size 80x80 (37.5% wasted)
BMPMAN: Found EFF (bomb_flare.eff) with 100 frames at 25 fps.
BMPMAN: Found EFF (HFlakExp.eff) with 48 frames at 22 fps.
ANI Kratos_impact with size 80x80 (37.5% wasted)
BMPMAN: Found EFF (ParticleExp01.eff) with 10 frames at 8 fps.
BMPMAN: Found EFF (ParticleSmoke01.eff) with 54 frames at 15 fps.
BMPMAN: Found EFF (shieldhit01a.eff) with 23 frames at 21 fps.
BMPMAN: Found EFF (sup.eff) with 109 frames at 25 fps.
BMPMAN: Found EFF (ScythImpact.eff) with 4 frames at 30 fps.
TBM  =>  Starting parse of 'mv_core-wep.tbm' ...
TBM  =>  Starting parse of 'mv_effects-wep.tbm' ...
TBM  =>  Starting parse of 'mv_assets-wep.tbm' ...
TBM  =>  Starting parse of 'htlmissiles-wep.tbm' ...
TBM  =>  Starting parse of 'asw-3612-shv-wep.tbm' ...
TBM  =>  Starting parse of 'asw-aip.tbm' ...
TBM  =>  Starting parse of 'mv_effects-obt.tbm' ...
TBM  =>  Starting parse of 'asw-obt.tbm' ...
TBM  =>  Starting parse of 'mv_core-shp.tbm' ...
TBM  =>  Starting parse of 'mv_effects-shp.tbm' ...
TBM  =>  Starting parse of 'mv_assets-shp.tbm' ...
TBM  =>  Starting parse of 'mv_core-hdg.tbm' ...
TBM  =>  Starting parse of 'mv_effects-str.tbm' ...
TBM  =>  Starting parse of 'ASW-str.tbm' ...
loading animated cursor "cursor"
ANI cursor with size 24x24 (25.0% wasted)
MediaVPs: Explosions script loaded!
MediaVPs: Flaming debris script loaded!
Ships.tbl is : INVALID!!!!
Weapons.tbl is : INVALID!!!!
cfile_init() took 2739
Got event GS_EVENT_GAME_INIT (49) in state NOT A VALID STATE (0)
ANI cursor.ani with size 24x24 (25.0% wasted)
Got event GS_EVENT_MAIN_MENU (0) in state GS_STATE_INITIAL_PLAYER_SELECT (37)
Someone passed an extension to bm_load for file 'Ancient.pcx'
WARNING => Ship class GTF Apollo not located in Ship_info[] in player file
Wokka!  Error opening file (freespace.fc2)!
Error parsing 'freespace.fc2'
Error code = 5.
Someone passed an extension to bm_load_animation for file 'empty.eff'
BMPMAN: Found EFF (empty.eff) with 1 frames at 1 fps.
Someone passed an extension to bm_load_animation for file 'empty.eff'
Someone passed an extension to bm_load_animation for file 'empty.eff'
Someone passed an extension to bm_load_animation for file 'empty.eff'
Someone passed an extension to bm_load_animation for file 'empty.eff'
Someone passed an extension to bm_load_animation for file 'empty.eff'
No music file exists to play music at the main menu!
Frame  0 too long!!: frametime = 1.102 (1.102)
Frame  0 too long!!: frametime = 1.288 (1.288)
Got event GS_EVENT_CAMPAIGN_ROOM (54) in state GS_STATE_MAIN_MENU (1)
Wokka!  Error opening file (freespace.fc2)!
Error parsing 'freespace.fc2'
Error code = 5.
Frame  0 too long!!: frametime = 0.891 (0.891)
Got event GS_EVENT_MAIN_MENU (0) in state GS_STATE_CAMPAIGN_ROOM (42)
Someone passed an extension to bm_load_animation for file 'empty.eff'
BMPMAN: Found EFF (empty.eff) with 1 frames at 1 fps.
Someone passed an extension to bm_load_animation for file 'empty.eff'
Someone passed an extension to bm_load_animation for file 'empty.eff'
Someone passed an extension to bm_load_animation for file 'empty.eff'
Someone passed an extension to bm_load_animation for file 'empty.eff'
Someone passed an extension to bm_load_animation for file 'empty.eff'
Frame  0 too long!!: frametime = 0.472 (0.472)
Got event GS_EVENT_TECH_MENU (11) in state GS_STATE_MAIN_MENU (1)
Techroom successfully initialized, now changing tab...
Loading model 'KatoNew.pof'
IBX: Found a good IBX to read for 'KatoNew.pof'.
IBX-DEBUG => POF checksum: 0xc7f3bfa3, IBX checksum: 0x1744a112 -- "KatoNew.pof"
Frame  0 too long!!: frametime = 2.913 (2.913)
Frame  0 too long!!: frametime = 0.584 (0.584)
Got event GS_EVENT_SIMULATOR_ROOM (58) in state GS_STATE_TECH_MENU (7)
Freeing all existing models...
Frame  0 too long!!: frametime = 0.781 (0.781)
Got event GS_EVENT_START_GAME (1) in state GS_STATE_SIMULATOR_ROOM (20)
=================== STARTING LEVEL LOAD ==================
BMPMAN: Found EFF (2_Loading.eff) with 14 frames at 15 fps.
Starting model page in...
Beginning level bitmap paging...
BMPMAN: Found EFF (particlesmoke02.eff) with 39 frames at 24 fps.
TBM  =>  Starting parse of 'mv_effects-fbl.tbm' ...
TBM  =>  Starting parse of 'ASW-fbl.tbm' ...
BMPMAN: Found EFF (WarpMap01.eff) with 30 frames at 30 fps.
BMPMAN: Found EFF (WarpMap02.eff) with 30 frames at 30 fps.
BMPMAN: Found EFF (Rock_Exp.eff) with 55 frames at 30 fps.
BMPMAN: Found EFF (BlueBoom.eff) with 122 frames at 25 fps.
Loading warp model
Loading model 'warp.pof'
IBX: Found a good IBX to read for 'warp.pof'.
IBX-DEBUG => POF checksum: 0xbf802ad0, IBX checksum: 0xe7aa5a55 -- "warp.pof"
 600
BMPMAN: Found EFF (shieldhit03a.eff) with 22 frames at 30 fps.
SHOCKWAVE =>  Loading default shockwave model...
Loading model 'shockwave.pof'
BMPMAN: Found EFF (shockwave3d-glow.eff) with 159 frames at 24 fps.
Model shockwave.pof has a null moment of inertia!  (This is only a problem if the model is a ship.)
IBX: Found a good IBX to read for 'shockwave.pof'.
IBX-DEBUG => POF checksum: 0xa85bec39, IBX checksum: 0x9af155c2 -- "shockwave.pof"
SHOCKWAVE =>  Default model load: SUCCEEDED!!
MISSION LOAD: 'ASWD_03.fs2'
Hmmm... Extension passed to mission_load...
Starting mission message count : 1
Ending mission message count : 2
Current soundtrack set to -1 in event_music_reset_choices
Current soundtrack set to -1 in event_music_set_soundtrack
Loading model 'Akrotiri.pof'
No subsystems found for model "Akrotiri.pof".
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Found live debris model for 'turret01a'
Found live debris model for 'turret01a'
IBX: Found a good IBX to read for 'Akrotiri.pof'.
IBX-DEBUG => POF checksum: 0x7607db22, IBX checksum: 0x4443c4ab -- "Akrotiri.pof"
Submodel 'turret01c' is detail level 2 of 'turret01a'
Submodel 'turret01b' is detail level 1 of 'turret01a'
Loading model 'Akrotiri.pof'
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Turret object not found for turret firing point in model
Found live debris model for 'turret01a'
Found live debris model for 'turret01a'
IBX: Found a good IBX to read for 'Akrotiri.pof'.
IBX-DEBUG => POF checksum: 0x7607db22, IBX checksum: 0x4443c4ab -- "Akrotiri.pof"
Submodel 'turret01c' is detail level 2 of 'turret01a'
Submodel 'turret01b' is detail level 1 of 'turret01a'
Loading model 'KatoNew.pof'
IBX: Found a good IBX to read for 'KatoNew.pof'.
IBX-DEBUG => POF checksum: 0xc7f3bfa3, IBX checksum: 0x1744a112 -- "KatoNew.pof"
Loading model 'Achladia.pof'
Potential problem found: Unrecognized subsystem type 'fighterbay', believed to be in ship Achladia.pof
IBX: Found a good IBX to read for 'Achladia.pof'.
IBX-DEBUG => POF checksum: 0xbdd2e577, IBX checksum: 0x6090bbfa -- "Achladia.pof"
Allocating space for at least 31 new ship subsystems ...  a total of 200 is now available (31 in-use).
Loading model 'AeCruiser.pof'
IBX: Found a good IBX to read for 'AeCruiser.pof'.
IBX-DEBUG => POF checksum: 0x9e5fd3a4, IBX checksum: 0x203de572 -- "AeCruiser.pof"
Loading model 'AeFighter.pof'
IBX: Found a good IBX to read for 'AeFighter.pof'.
IBX-DEBUG => POF checksum: 0x8445a8ab, IBX checksum: 0x1ca39667 -- "AeFighter.pof"
Loading model 'AeBomber.pof'
IBX: Found a good IBX to read for 'AeBomber.pof'.
IBX-DEBUG => POF checksum: 0x30f2feb1, IBX checksum: 0x08b5b183 -- "AeBomber.pof"
Submodel 'thruster01b' is detail level 1 of 'thruster01a'
Submodel 'thruster01c' is detail level 2 of 'thruster01a'
Submodel 'thruster02b' is detail level 1 of 'thruster02a'
Loading model 'Tylisos.pof'
IBX: Found a good IBX to read for 'Tylisos.pof'.
IBX-DEBUG => POF checksum: 0xe14f5882, IBX checksum: 0x5418563d -- "Tylisos.pof"
Loading model 'Phylaki.pof'
IBX: Found a good IBX to read for 'Phylaki.pof'.
IBX-DEBUG => POF checksum: 0xd64cc586, IBX checksum: 0x5df8949d -- "Phylaki.pof"
Loading model 'AeCorvette.pof'
Potential problem found: Unrecognized subsystem type 'fighterbay01', believed to be in ship AeCorvette.pof
Potential problem found: Unrecognized subsystem type 'fighterbay02', believed to be in ship AeCorvette.pof
IBX: Found a good IBX to read for 'AeCorvette.pof'.
IBX-DEBUG => POF checksum: 0xd6467a07, IBX checksum: 0x254c46d0 -- "AeCorvette.pof"
Loading model 'Zakros.pof'
IBX: Found a good IBX to read for 'Zakros.pof'.
IBX-DEBUG => POF checksum: 0x79b468e5, IBX checksum: 0x6dc7057a -- "Zakros.pof"
Submodel 'turret01b' is detail level 1 of 'turret01a'
Submodel 'turret01b-arm' is detail level 1 of 'turret01a-arm'
Loading model 'Akrotiri.pof'
Potential problem found: Unrecognized subsystem type 'fighterbay', believed to be in ship Akrotiri.pof
Found live debris model for 'turret01a'
Found live debris model for 'turret01a'
IBX: Found a good IBX to read for 'Akrotiri.pof'.
IBX-DEBUG => POF checksum: 0x7607db22, IBX checksum: 0x4443c4ab -- "Akrotiri.pof"
Submodel 'turret01c' is detail level 2 of 'turret01a'
Submodel 'turret01b' is detail level 1 of 'turret01a'
Loading model 'Dallie_INF.pof'
IBX: Found a good IBX to read for 'Dallie_INF.pof'.
IBX-DEBUG => POF checksum: 0x6486fdd1, IBX checksum: 0xb98b5786 -- "Dallie_INF.pof"
OpenGL: Created 512x512 FBO!
ANI 2_lock1 with size 56x53 (17.2% wasted)
ANI 2_lockspin with size 100x100 (21.9% wasted)
ANI 2_lead1 with size 26x26 (18.8% wasted)
ANI 2_energy2 with size 86x96 (25.0% wasted)
ANI toggle1 with size 57x20 (37.5% wasted)
ANI weapons1 with size 126x20 (37.5% wasted)
ANI weapons1_b with size 150x20 (37.5% wasted)
ANI 2_toparc1 with size 252x60 (6.3% wasted)
ANI 2_toparc2 with size 35x24 (25.0% wasted)
ANI 2_toparc3 with size 41x29 (9.4% wasted)
ANI 2_leftarc with size 103x252 (1.6% wasted)
ANI 2_rightarc1 with size 103x252 (1.6% wasted)
ANI 2_reticle1 with size 40x24 (25.0% wasted)
ANI targhit1 with size 31x21 (34.4% wasted)
ANI energy1 with size 12x41 (35.9% wasted)
ANI targetview1 with size 137x156 (39.1% wasted)
ANI targetview2 with size 4x96 (25.0% wasted)
ANI targetview3 with size 7x20 (37.5% wasted)
ANI damage1 with size 148x25 (21.9% wasted)
ANI support1 with size 108x24 (25.0% wasted)
ANI objective1 with size 149x21 (34.4% wasted)
ANI wingman1 with size 71x53 (17.2% wasted)
ANI wingman2 with size 35x53 (17.2% wasted)
ANI wingman3 with size 14x53 (17.2% wasted)
ANI netlag1 with size 29x30 (6.3% wasted)
ANI head1 with size 164x132 (48.4% wasted)
ANI time1 with size 47x23 (28.1% wasted)
Loading model 'starfield.pof'
Model starfield.pof has a null moment of inertia!  (This is only a problem if the model is a ship.)
IBX: Found a good IBX to read for 'starfield.pof'.
IBX-DEBUG => POF checksum: 0x51900597, IBX checksum: 0xd179f0ac -- "starfield.pof"
ANI debris01 with size 51x38 (40.6% wasted)
ANI debris02 with size 26x19 (40.6% wasted)
ANI debris04 with size 36x27 (15.6% wasted)
=================== STARTING LEVEL DATA LOAD ==================
Loading model 'Kamilari.pof'
IBX: Found a good IBX to read for 'Kamilari.pof'.
IBX-DEBUG => POF checksum: 0xa61c0a65, IBX checksum: 0x148bcbba -- "Kamilari.pof"
Submodel 'vsupport01b-hull' is detail level 1 of 'vsupport01a-hull'
Submodel 'vsupport01c-hull' is detail level 2 of 'vsupport01a-hull'
Submodel 'vsupport01d-hull' is detail level 3 of 'vsupport01a-hull'
Submodel 'thruster01b' is detail level 1 of 'thruster01a'
Submodel 'thruster01c' is detail level 2 of 'thruster01a'
Allocating space for at least 538 new ship subsystems ...  a total of 600 is now available (55 in-use).
About to page in ships!
ANI katoshell with size 112x93 (27.3% wasted)
ANI shield-phylaki with size 112x93 (27.3% wasted)
ANI shield-tylisos with size 112x93 (27.3% wasted)
ANI ZHEL with size 112x93 (27.3% wasted)
ANI shield-dart with size 93x112 (12.5% wasted)
ANI shieldVindhyachal with size 112x93 (27.3% wasted)
BMPMAN: Found EFF (X_Anibitmap.eff) with 60 frames at 26 fps.
BMPMAN: Found EFF (particle_white.eff) with 11 frames at 22 fps.
Loading model 'amissile.pof'
Model amissile.pof has a null moment of inertia!  (This is only a problem if the model is a ship.)
IBX: Found a good IBX to read for 'amissile.pof'.
IBX-DEBUG => POF checksum: 0xc1646391, IBX checksum: 0x517d40b1 -- "amissile.pof"
Loading model 'A-HORNET.pof'
Model A-HORNET.pof has a null moment of inertia!  (This is only a problem if the model is a ship.)
IBX: Found a good IBX to read for 'A-HORNET.pof'.
IBX-DEBUG => POF checksum: 0x6663a8de, IBX checksum: 0x0490b106 -- "A-HORNET.pof"
Loading model 'A-ROCKEYE.pof'
Model A-ROCKEYE.pof has a null moment of inertia!  (This is only a problem if the model is a ship.)
IBX: Found a good IBX to read for 'A-ROCKEYE.pof'.
IBX-DEBUG => POF checksum: 0x6c634f35, IBX checksum: 0x11156053 -- "A-ROCKEYE.pof"
Loading model 'A-TEMPEST.pof'
IBX: Found a good IBX to read for 'A-TEMPEST.pof'.
IBX-DEBUG => POF checksum: 0xf8ca439b, IBX checksum: 0x83a720af -- "A-TEMPEST.pof"
Submodel 'realtempest-b' is detail level 1 of 'realtempest-a'
Submodel 'realtempest-c' is detail level 2 of 'realtempest-a'
Submodel 'thruster01b' is detail level 1 of 'thruster01a'
Submodel 'thruster01c' is detail level 2 of 'thruster01a'
Loading model 'DamnationBomb.pof'
Model DamnationBomb.pof has a null moment of inertia!  (This is only a problem if the model is a ship.)
IBX: Found a good IBX to read for 'DamnationBomb.pof'.
IBX-DEBUG => POF checksum: 0x97893143, IBX checksum: 0xb931bd1b -- "DamnationBomb.pof"
Loading model 'AesdherMissile.pof'
Model AesdherMissile.pof has a null moment of inertia!  (This is only a problem if the model is a ship.)
IBX: Found a good IBX to read for 'AesdherMissile.pof'.
IBX-DEBUG => POF checksum: 0x67719793, IBX checksum: 0x7a46be59 -- "AesdherMissile.pof"
Loading model 'AesdherBomb.pof'
Model AesdherBomb.pof has a null moment of inertia!  (This is only a problem if the model is a ship.)
IBX: Found a good IBX to read for 'AesdherBomb.pof'.
IBX-DEBUG => POF checksum: 0x41c1fc35, IBX checksum: 0xcb8964a3 -- "AesdherBomb.pof"
Loading model 'cmeasure01.pof'
IBX: Found a good IBX to read for 'cmeasure01.pof'.
IBX-DEBUG => POF checksum: 0x562739c3, IBX checksum: 0x76256515 -- "cmeasure01.pof"
Loading model 'debris01.pof'
IBX: Found a good IBX to read for 'debris01.pof'.
IBX-DEBUG => POF checksum: 0x974f214b, IBX checksum: 0x0cb49c79 -- "debris01.pof"
Loading model 'debris02.pof'
IBX: Found a good IBX to read for 'debris02.pof'.
IBX-DEBUG => POF checksum: 0x8e0eed50, IBX checksum: 0x3e979514 -- "debris02.pof"
BMPMAN: Found EFF (Bmuzzle.eff) with 5 frames at 30 fps.
BMPMAN: Found EFF (PMuzzle.eff) with 4 frames at 30 fps.
BMPMAN: Found EFF (GoldMuzzle.eff) with 4 frames at 30 fps.
BMPMAN: Found EFF (Cretemuzzle.eff) with 5 frames at 30 fps.
BMPMAN: Found EFF (AncCMuzzle.eff) with 5 frames at 30 fps.
BMPMAN: Found EFF (AesdMuzzle.eff) with 5 frames at 30 fps.
BMPMAN: Found EFF (ASCmuzzle.eff) with 4 frames at 30 fps.
BMPMAN: Found EFF (Bmuzzle2.eff) with 4 frames at 30 fps.
Paging in mission messages
Stopping model page in...
ANI 2_radar1.ani with size 209x170 (33.6% wasted)
ANI 2_lock1.ani with size 56x53 (17.2% wasted)
ANI 2_lead1.ani with size 26x26 (18.8% wasted)
ANI 2_energy2.ani with size 86x96 (25.0% wasted)
ANI toggle1.ani with size 57x20 (37.5% wasted)
ANI weapons1.ani with size 126x20 (37.5% wasted)
ANI 2_toparc1.ani with size 252x60 (6.3% wasted)
ANI 2_toparc2.ani with size 35x24 (25.0% wasted)
ANI 2_toparc3.ani with size 41x29 (9.4% wasted)
ANI 2_leftarc.ani with size 103x252 (1.6% wasted)
ANI 2_rightarc1.ani with size 103x252 (1.6% wasted)
ANI 2_reticle1.ani with size 40x24 (25.0% wasted)
ANI targhit1.ani with size 31x21 (34.4% wasted)
ANI energy1.ani with size 12x41 (35.9% wasted)
ANI targetview1.ani with size 137x156 (39.1% wasted)
ANI targetview2.ani with size 4x96 (25.0% wasted)
ANI targetview3.ani with size 7x20 (37.5% wasted)
ANI damage1.ani with size 148x25 (21.9% wasted)
ANI support1.ani with size 108x24 (25.0% wasted)
ANI objective1.ani with size 149x21 (34.4% wasted)
ANI wingman1.ani with size 71x53 (17.2% wasted)
ANI wingman2.ani with size 35x53 (17.2% wasted)
ANI wingman3.ani with size 14x53 (17.2% wasted)
ANI netlag1.ani with size 29x30 (6.3% wasted)
ANI head1.ani with size 164x132 (48.4% wasted)
ANI time1.ani with size 47x23 (28.1% wasted)
ANI debris01.ani with size 51x38 (40.6% wasted)
ANI debris02.ani with size 26x19 (40.6% wasted)
ANI debris04.ani with size 36x27 (15.6% wasted)
ANI katoshell.ani with size 112x93 (27.3% wasted)
ANI shield-phylaki.ani with size 112x93 (27.3% wasted)
ANI shield-tylisos.ani with size 112x93 (27.3% wasted)
ANI ZHEL.ani with size 112x93 (27.3% wasted)
ANI shield-dart.ani with size 93x112 (12.5% wasted)
ANI shieldVindhyachal.ani with size 112x93 (27.3% wasted)
User bitmap 'TMP256x256+8'
User bitmap 'TMP256x256+8'
User bitmap 'TMP128x128+8'
Bmpman: 2218/4750 bitmap slots in use.
Ending level bitmap paging...
=================== ENDING LOAD ================
Real count = 290,  Estimated count = 425
================================================
SCRIPTING: Starting flashy deaths script loading

Class: ac kamares
DRM: 0.2
DE: 2
DM: 1
FRM: 1.2
FE: 7
BE: 0.35
BEDu: 3000

Class: ac gordia
DRM: 0.2
DE: 2
DM: 1
FRM: 1.2
FE: 7
BE: 0.35
BEDu: 3000

Class: ac malia
DRM: 0.2
DE: 2
DM: 1
FRM: 1.2
FE: 7
BE: 0.35
BEDu: 3500

Class: ac heraklion
DRM: 0.2
DE: 2
DM: 1
FRM: 1.2
FE: 7
BE: 0.35
BEDu: 3000

Class: acv arkalochori
DRM: 0.2
DE: 2
DM: 1
FRM: 1.2
FE: 7
BE: 0.35
BEDu: 3500

Class: acv mochlos
DRM: 0.2
DE: 2
DM: 1
FRM: 1.2
FE: 7
BE: 0.35
BEDu: 3500

Class: ad pylos
DRM: 0.2
DE: 2
DM: 1
FRM: 1.2
FE: 7
BE: 0.4
BEDu: 4000

Class: ad achladia
DRM: 0.2
DE: 2
DM: 1
FRM: 1.2
FE: 7
BE: 0.4
BEDu: 4000

Class: ad odigitria
DRM: 0.2
DE: 2
DM: 1
FRM: 1.2
FE: 7
BE: 0.4
BEDu: 4000

Class: afr phaistos
DRM: 0.2
DE: 2
DM: 1
FRM: 1
FE: 7
BE: 0.3
BEDu: 3000

Class: ac 1
DRM: 0.2
DE: 1
DM: 1
FRM: 1
FE: 7
BE: 0.15
BEDu: 1500

Class: ai thera
DRM: 0.2
DE: 2
DM: 1
FRM: 1.2
FE: 7
BE: 0.4
BEDu: 4000

Class: at dallie
DRM: 0.2
DE: 2
DM: 1
FRM: 1
FE: 7
BE: 0.25
BEDu: 2500

Class: asd minos
DRM: 0.2
DE: 2
DM: 1
FRM: 1.2
FE: 7
BE: 0.45
BEDu: 4000

Class: aca akrotiri
DRM: 0.2
DE: 2
DM: 1
FRM: 1.2
FE: 7
BE: 0.45
BEDu: 4500

Class: ag knossos
DRM: 0.2
DE: 2
DM: 1
FRM: 1.2
FE: 7
BE: 0.45
BEDu: 4500

Class: st azrael
DRM: 0.2
DE: 2
DM: 1
FRM: 1
FE: 6
BE: 0.15
BEDu: 1500

Class: sfr mephisto
DRM: 0.2
DE: 2
DM: 1
FRM: 1
FE: 6
BE: 0.15
BEDu: 1500

Class: sc 5
DRM: 0.2
DE: 2
DM: 1
FRM: 1
FE: 6
BE: 0.15
BEDu: 1500

Class: sfr asmodeus
DRM: 0.2
DE: 2
DM: 1
FRM: 1
FE: 6
BE: 0.25
BEDu: 2500

Class: sac 2
DRM: 0.2
DE: 2
DM: 1
FRM: 1
FE: 6
BE: 0.15
BEDu: 1500

Class: sc lilith
DRM: 0.2
DE: 2
DM: 1
FRM: 1.2
FE: 6
BE: 0.3
BEDu: 3000

Class: sc cain
DRM: 0.2
DE: 2
DM: 1
FRM: 1.2
FE: 6
BE: 0.3
BEDu: 3000

Class: scv moloch
DRM: 0.2
DE: 2
DM: 1
FRM: 1.2
FE: 6
BE: 0.35
BEDu: 3500

Class: sd vassago
DRM: 0.2
DE: 2
DM: 1
FRM: 1.2
FE: 6
BE: 0.4
BEDu: 4000

Class: sd demon
DRM: 0.2
DE: 2
DM: 1
FRM: 1.2
FE: 6
BE: 0.4
BEDu: 4000

Class: ssg trident
DRM: 0.2
DE: 2
DM: 1
FRM: 1
FE: 6
BE: 5
BEDu: 500

Class: ssd lucifer
DRM: 0.2
DE: 2
DM: 1
FRM: 1.2
FE: 6
BE: 0.4
BEDu: 4000

Class: sj sathanas
DRM: 0.2
DE: 2
DM: 1
FRM: 1.2
FE: 6
BE: 0.45
BEDu: 4500

Class: aesdherian claw
DRM: 0.2
DE: 2
DM: 1
FRM: 1.2
FE: 7
BE: 0.3
BEDu: 3000

Class: aesdherian sword
DRM: 0.2
DE: 2
DM: 1
FRM: 1.2
FE: 7
BE: 0.4
BEDu: 4000

Class: aesdherian crown
DRM: 0.2
DE: 2
DM: 1
FRM: 1.2
FE: 7
BE: 0.4
BEDu: 4000

Class: sslbeam
BEI: 0.2
BEDu: 600
BEDi: 300

Class: ancient super cannon
FR: 100
FE: 6
BEI: 0.6
BEDu: 6000
BEDi: 3000

Class: ancient supercannon#bombardment
FR: 100
FE: 6
BEI: 0.6
BEDu: 6000
BEDi: 3000
MediaVPs: Flaming debris script ACTIVE!
Received post for event GS_EVENT_START_BRIEFING during state transtition. Find Allender if you are unsure if this is bad.
Got event GS_EVENT_START_BRIEFING (15) in state GS_STATE_START_GAME (52)
ANI 2_BriefMap with size 918x400 (21.9% wasted)
ANI iconwing01 with size 32x28 (12.5% wasted)
ANI biconpylos with size 100x18 (43.8% wasted)
ANI biconpylos.ani with size 100x18 (43.8% wasted)
ANI iconNCW with size 100x100 (21.9% wasted)
ANI FadeiconNCW with size 100x100 (21.9% wasted)
ANI FadeiconNCW.ani with size 100x100 (21.9% wasted)
ANI iconNfightSquad with size 100x100 (21.9% wasted)
ANI FadeiconNfightSquad with size 100x100 (21.9% wasted)
ANI FadeiconNfightSquad.ani with size 100x100 (21.9% wasted)
ANI iconAe-bomberw with size 65x91 (28.9% wasted)
ANI FadeIconAe-bomberw with size 65x91 (28.9% wasted)
ANI FadeIconAe-bomberw.ani with size 65x91 (28.9% wasted)
ANI iconEpitaph with size 97x54 (15.6% wasted)
ANI fadeiconEpitaph with size 97x54 (15.6% wasted)
ANI fadeiconEpitaph.ani with size 97x54 (15.6% wasted)
ANI iconhighlight06 with size 186x186 (27.3% wasted)
ANI iconhighlight06.ani with size 186x186 (27.3% wasted)
ANI biconbomberw with size 48x88 (31.3% wasted)
ANI biconbomberw.ani with size 48x88 (31.3% wasted)
ANI biconfighterW with size 54x48 (25.0% wasted)
ANI biconfighterW.ani with size 54x48 (25.0% wasted)
ANI iconhighlight02 with size 164x164 (35.9% wasted)
ANI iconhighlight02.ani with size 164x164 (35.9% wasted)
ANI biconakrotiri with size 180x45 (29.7% wasted)
ANI FadeIcon_Tiri with size 180x45 (29.7% wasted)
ANI FadeIcon_Tiri.ani with size 180x45 (29.7% wasted)
ANI iconhighlight05 with size 206x206 (19.5% wasted)
ANI iconhighlight05.ani with size 206x206 (19.5% wasted)
Frame  0 too long!!: frametime = 39.371 (39.371)
Got event GS_EVENT_SHIP_SELECTION (13) in state GS_STATE_BRIEFING (10)
Got event GS_EVENT_WEAPON_SELECTION (21) in state GS_STATE_SHIP_SELECT (11)
Got event GS_EVENT_ENTER_GAME (2) in state GS_STATE_WEAPON_SELECT (16)
Entering game at time =  74.327
Frame  1 too long!!: frametime = 0.403 (0.403)
ANI Ancient_ani.ani with size 160x120 (6.3% wasted)
SOUND: d:\scp\builds\antipodes\code\sound\ds.cpp:1488 - OpenAL error = 'Invalid Value'
SOUND: d:\scp\builds\antipodes\code\sound\ds.cpp:1488 - OpenAL error = 'Invalid Value'
SOUND: d:\scp\builds\antipodes\code\sound\ds.cpp:1488 - OpenAL error = 'Invalid Value'
SOUND: d:\scp\builds\antipodes\code\sound\ds.cpp:1488 - OpenAL error = 'Invalid Value'
1710 frames executed in  30.012 seconds,  56.977 frames per second.
SOUND: d:\scp\builds\antipodes\code\sound\ds.cpp:1488 - OpenAL error = 'Invalid Value'
SOUND: d:\scp\builds\antipodes\code\sound\ds.cpp:1488 - OpenAL error = 'Invalid Value'
SOUND: d:\scp\builds\antipodes\code\sound\ds.cpp:1488 - OpenAL error = 'Invalid Value'
SOUND: d:\scp\builds\antipodes\code\sound\ds.cpp:1488 - OpenAL error = 'Invalid Value'
SOUND: d:\scp\builds\antipodes\code\sound\ds.cpp:1488 - OpenAL error = 'Invalid Value'
SOUND: d:\scp\builds\antipodes\code\sound\ds.cpp:1488 - OpenAL error = 'Invalid Value'
SOUND: d:\scp\builds\antipodes\code\sound\audiostr.cpp:1107 - OpenAL error = 'Invalid Value'
AUDIOSTR => ErrorExit for ::Create() on wave file: combatzuul
Can not play music. sexp_start_music called when no music file is set for Sexp_music_handle!
SOUND: d:\scp\builds\antipodes\code\sound\ds.cpp:1488 - OpenAL error = 'Invalid Value'
SOUND: d:\scp\builds\antipodes\code\sound\ds.cpp:1488 - OpenAL error = 'Invalid Value'
SOUND: d:\scp\builds\antipodes\code\sound\ds.cpp:1488 - OpenAL error = 'Invalid Value'
SOUND: d:\scp\builds\antipodes\code\sound\ds.cpp:1488 - OpenAL error = 'Invalid Value'
SOUND: d:\scp\builds\antipodes\code\sound\ds.cpp:1488 - OpenAL error = 'Invalid Value'
SOUND: d:\scp\builds\antipodes\code\sound\ds.cpp:1488 - OpenAL error = 'Invalid Value'
SOUND: d:\scp\builds\antipodes\code\sound\ds.cpp:1488 - OpenAL error = 'Invalid Value'
Got event GS_EVENT_END_GAME (4) in state GS_STATE_GAME_PLAY (2)
SOUND: d:\scp\builds\antipodes\code\sound\ds.cpp:1316 - OpenAL error = 'Invalid Operation'
Unloading in mission messages
Someone passed an extension to bm_load_animation for file 'empty.eff'
BMPMAN: Found EFF (empty.eff) with 1 frames at 1 fps.
Someone passed an extension to bm_load_animation for file 'empty.eff'
Someone passed an extension to bm_load_animation for file 'empty.eff'
Someone passed an extension to bm_load_animation for file 'empty.eff'
Someone passed an extension to bm_load_animation for file 'empty.eff'
Someone passed an extension to bm_load_animation for file 'empty.eff'
SOUND: d:\scp\builds\antipodes\code\sound\audiostr.cpp:1107 - OpenAL error = 'Invalid Value'
AUDIOSTR => ErrorExit for ::Create() on wave file: Ancient
No music file exists to play music at the main menu!
Got event GS_EVENT_QUIT_GAME (5) in state GS_STATE_MAIN_MENU (1)
Freeing all existing models...
... Log closed, Sat Oct 09 08:59:29 2010
I was running the mission "Roadblock" with ASW 3.6.12.
My video card is an NVidia GeForce 9800 GT with driver version 258.96
Title: Re: Shaders for the MediaVPs
Post by: Kolgena on October 09, 2010, 08:15:32 am
On an ATI 3650 mobility, TwL/genetix modded CCC v3.95 (which is a mix/match of driver components that is built off the 10.7a WHQL), I can report that I get none of those problems using the shader Zacam released in [code tags] a few posts up. I'm using Antipodes 6a though, and not b/c. Maybe that has something to do with it.
Title: Re: Shaders for the MediaVPs
Post by: Zacam on October 09, 2010, 08:28:04 am
Antipodes 6 of any version is good.

Talon_1024
Again, Trunk (Any 3.6.13 build) doesn't process the #IF SHADER_MODEL define AT ALL which is why (despite having no errors) you are getting weird "ships disappearing when you shoot at them" which will happen regardless of if the model in question has a full suite of maps to begin with. At least it's not specular flaring into being a super bright "Magic Pink" model.

And the 258.96 drivers are the reason the whole "#pragma optionNV unroll all" line exists.

Talon_1024: For you specifically (if you want 3.6.13) modify the following:
Code: (mani-f.sdr - DELETE THIS) [Select]
#if SHADER_MODEL == 2
  #define MAX_LIGHTS 2
#else
  #define MAX_LIGHTS 8
#endif
.....
 #if SHADER_MODEL > 2
if (i > n_lights)
break;
 #endif
.....
 #if SHADER_MODEL > 2
if (gl_LightSource[i].position.w == 1.0) {
 #else
if (gl_LightSource[i].position.w == 1.0 && i != 0) {
 #endif

Replace it with:
Code: [Select]
#define MAX_LIGHTS 8
.....
if (i > n_lights)
break;
.....
(choose one of three or try them all, just NOT at the same time)
if (gl_LightSource[i].position.w == 1.0) {
OR
if (gl_LightSource[i].position.w != 0.0) {
OR
if (gl_LightSource[i].position.w == 1.0 && i == 0) {

Note that the above is to Talon_1024 (or any one else rolling an nVidia and .13 builds) and should not be done on an ATI card, as it won't work.
Title: Re: Shaders for the MediaVPs
Post by: Woolie Wool on October 09, 2010, 10:48:52 am
We are using Antipodes 6. These bugs first showed up for me when I went from 3.6.12 final to Antipodes 6.
Title: Re: Shaders for the MediaVPs
Post by: Talon 1024 on October 09, 2010, 11:56:12 am
@Zacam
I modified the shaders like you said, and the problems I was previously experiencing seem to be gone now, at least with 3.6.12 final. [EDIT: and Antipodes 6]

Out of the options for the third set of lines, this one:
Code: (main-f.sdr) [Select]
if (gl_LightSource[i].position.w == 1.0 && i == 0) {works best for me.
Title: Re: Shaders for the MediaVPs
Post by: Macfie on October 10, 2010, 02:55:18 pm
I'm noticing a significant drop in framerate with the shaders.  I noticed one of the missions seemed choppy so I decided to use the FPS to monitor while playing the mission.  When I was viewing the Orion destroyer the frame rate dropped from 120 fps to 30 fps.  If I used the Antipodes 6d without the shaders it dropped to 100fps initially but then stedied out at 120 fps.  If I used the current nightly build framerate dropped from 120 fps to about 90 fps, and the 3.6.12 was about the same.  I'm currently playing Aftermath and there are not a lot of large ships in the missions so I haven't noticed this before.
Title: Re: Shaders for the MediaVPs
Post by: pecenipicek on October 10, 2010, 05:21:46 pm
its odd that folks who play WiH with this arent complaining about the same thing tho
Title: Re: Shaders for the MediaVPs
Post by: Kolgena on October 10, 2010, 08:18:24 pm
What thing?
Title: Re: Shaders for the MediaVPs
Post by: Macfie on October 10, 2010, 08:21:42 pm
its odd that folks who play WiH with this arent complaining about the same thing tho

So far it's only with the Orion model that I've noticed it.  It could be peculiar to that one model, especially since there have already been problems with the shaders and the Orion model.
Title: Re: Shaders for the MediaVPs
Post by: The E on October 10, 2010, 08:25:00 pm
Personally, I can't see an FPS difference between these ones and the old shaders.
Title: Re: Shaders for the MediaVPs
Post by: Kolgena on October 10, 2010, 08:40:41 pm
Really? What hardware are you using? I'm noticing much lower average FPS in just the shiplab (WiH intro runs beautifully despite the Karuna, after I upgraded to Anti6a), and much much lower minimums in busy scenes. I can drop to single digit slideshow frames if too many lights/reflections are in a scene. I'm making my 3650 mobility push 1080p with post processing though, so I can't say if the shaders are unoptimized or if my rig shouldn't be able to run them anyways.

Something especially taxing is to get up really close to a capital ship while dozens of fighters are spewing primary fire at it. (massivebattle1) It gets worse the more pixels are taken up by the capital ship.
Title: Re: Shaders for the MediaVPs
Post by: The E on October 10, 2010, 08:55:24 pm
I'm using a lowly Radeon X1250. Which is the reason for all those "#if SHADER_MODEL" preprocessor directives.
Title: Re: Shaders for the MediaVPs
Post by: Kolgena on October 10, 2010, 09:04:31 pm
Maybe it's an SM3 thing, or the fact that we're processing 8 lights instead of 2.

Edit: New bug!

Certain nameplates are gimped when using these shaders. Look at a Fenris or leviathan in ship lab, and you'll see that the spot where the nameplate goes responds to light as if it were inverted or something. I'm wondering if this has something to do with your clamp hack. Turning off normal maps fixes it.

I first noticed this when I saw the GTD Raynor with an almost-white nameplate in the credits of WiH, and thought that it was z-fighting from Catalyst AI. Further examination made me see that it was actually a lighting problem. As far as I can tell, at least the Orion's nameplate is not affected. I'm not sure which are and which are not though, and what's determining that.
Title: Re: Shaders for the MediaVPs
Post by: The E on October 11, 2010, 04:31:13 am
I guess any nameplate that relies on alpha blending can be affected by this.
Title: Re: Shaders for the MediaVPs
Post by: Zacam on October 11, 2010, 06:12:10 pm
Nameplates have been a bone of contention with even the .10/.12 shaders, not just these shaders.

Deimos and Hecate are also affected, and so is the Orion, it's just recessed enough that it is not as obvious.
Title: Re: Shaders for the MediaVPs
Post by: Kolgena on November 25, 2010, 11:36:58 pm
Did this die, or are there invisible SVN updates going on?

/necro
Title: Re: Shaders for the MediaVPs
Post by: The E on November 26, 2010, 02:05:51 am
These shaders (or rather, more refined, mostly bugfree versions) will be in the next update.
Title: Re: Shaders for the MediaVPs
Post by: Kolgena on November 26, 2010, 09:23:57 am
How about performance? The ones released drop me from 100+ fps to single digit FPS if a capital ship is taking up my entire screen.
Title: Re: Shaders for the MediaVPs
Post by: The E on November 26, 2010, 11:22:02 am
That's an unfortunate side-effect of the way these shaders work.
Title: Re: Shaders for the MediaVPs
Post by: Zacam on November 29, 2010, 05:14:07 am
Here is the lastest version from SVN. I was going to put these out with the apology edition patch, but since it still requires an experimental build rather than a Release build, some folk thought doing so wasn't an agreeable idea.

Required: Nightly Build post 6627, or any Antipodes 7 or later build.

Code: (main-f.sdr) [Select]
#ifdef FLAG_LIGHT
uniform int n_lights;
#endif

#ifdef FLAG_DIFFUSE_MAP
uniform sampler2D sBasemap;
#endif

#ifdef FLAG_GLOW_MAP
uniform sampler2D sGlowmap;
#endif

#ifdef FLAG_SPEC_MAP
uniform sampler2D sSpecmap;
#endif

#ifdef FLAG_ENV_MAP
uniform samplerCube sEnvmap;
uniform bool alpha_spec;
varying vec3 envReflect;
#endif

#ifdef FLAG_NORMAL_MAP
uniform sampler2D sNormalmap;
varying mat3 tbnMatrix;
#endif

#ifdef FLAG_FOG
varying float fogDist;
#endif

varying vec4 position;
varying vec3 lNormal;

#if SHADER_MODEL == 2
  #define MAX_LIGHTS 2
#else
  #define MAX_LIGHTS 8
#endif

#define SPEC_INTENSITY_POINT 5.3 // Point light
#define SPEC_INTENSITY_DIRECTIONAL 3.0 // Directional light
#define SPECULAR_FACTOR 1.75
#define SPECULAR_ALPHA 0.1
#define SPEC_FACTOR_NO_SPEC_MAP 0.6
#define ENV_ALPHA_FACTOR 0.3
#define GLOW_MAP_INTENSITY 1.5
#define AMBIENT_LIGHT_BOOST 1.0

void main()
{
vec3 eyeDir = vec3(normalize(-position).xyz); // Camera is at (0,0,0) in ModelView space
vec4 lightAmbientDiffuse = vec4(0.0, 0.0, 0.0, 1.0);
vec4 lightDiffuse = vec4(0.0, 0.0, 0.0, 1.0);
vec4 lightAmbient = vec4(0.0, 0.0, 0.0, 1.0);
vec4 lightSpecular = vec4(0.0, 0.0, 0.0, 1.0);
vec2 texCoord = gl_TexCoord[0].xy;

 #ifdef FLAG_LIGHT
  #ifdef FLAG_NORMAL_MAP
// Normal map - convert from DXT5nm
vec3 normal;
normal.rg = (texture2D(sNormalmap, texCoord).ag * 2.0) - 1.0;
normal.b = sqrt(1.0 - dot(normal.rg, normal.rg));
normal = normalize(tbnMatrix * normal);
  #else
vec3 normal = lNormal;
  #endif

vec3 lightDir;
lightAmbient = gl_FrontMaterial.emission + (gl_LightModel.ambient * gl_FrontMaterial.ambient);

#pragma optionNV unroll all
for (int i = 0; i < MAX_LIGHTS; ++i) {
 #if SHADER_MODEL > 2
if (i > n_lights)
break;
 #endif
float specularIntensity = 1.0;
float attenuation = 1.0;

// Attenuation and light direction
 #if SHADER_MODEL > 2
if (gl_LightSource[i].position.w == 1.0) {
 #else
if (gl_LightSource[i].position.w == 1.0 && i != 0) {
 #endif
// Positional light source
float dist = distance(gl_LightSource[i].position.xyz, position.xyz);

float spotEffect = 1.0;

 #if SHADER_MODEL > 2
if (gl_LightSource[i].spotCutoff < 91.0) {
spotEffect = dot(normalize(gl_LightSource[i].spotDirection), normalize(-position.xyz));

if (spotEffect < gl_LightSource[i].spotCosCutoff) {
spotEffect = 0.0;
}
}
 #endif

attenuation = spotEffect / (gl_LightSource[i].constantAttenuation + (gl_LightSource[i].linearAttenuation * dist) + (gl_LightSource[i].quadraticAttenuation * dist * dist));

lightDir = normalize(gl_LightSource[i].position.xyz - position.xyz);

specularIntensity = SPEC_INTENSITY_POINT; // Point light
} else {
// Directional light source
lightDir = normalize(gl_LightSource[i].position.xyz);

specularIntensity = SPEC_INTENSITY_DIRECTIONAL; // Directional light
}

// Ambient and Diffuse
lightAmbient += (gl_FrontLightProduct[i].ambient * attenuation);
lightDiffuse += ((gl_FrontLightProduct[i].diffuse * max(dot(normal, lightDir), 0.0)) * attenuation);

// Specular
float NdotHV = clamp(dot(normal, normalize(eyeDir + lightDir)), 0.0, 1.0);
lightSpecular += ((gl_FrontLightProduct[i].specular * pow(max(0.0, NdotHV), gl_FrontMaterial.shininess)) * attenuation) * specularIntensity;
}

lightAmbientDiffuse = lightAmbient + lightDiffuse;
 #else
lightAmbientDiffuse = gl_Color;
lightSpecular = gl_SecondaryColor;
 #endif

 #ifdef FLAG_DIFFUSE_MAP
 // Base color
vec4 baseColor = texture2D(sBasemap, texCoord);
 #else
vec4 baseColor = gl_Color;
 #endif
 
vec4 fragmentColor;
fragmentColor.rgb = baseColor.rgb * max(lightAmbientDiffuse.rgb * AMBIENT_LIGHT_BOOST, gl_LightModel.ambient.rgb - 0.425);
fragmentColor.a = baseColor.a;

 #ifdef FLAG_SPEC_MAP
 // Spec color
fragmentColor.rgb += lightSpecular.rgb * (texture2D(sSpecmap, texCoord).rgb * SPECULAR_FACTOR);
fragmentColor.a += (dot(lightSpecular.a, lightSpecular.a) * SPECULAR_ALPHA);
 #else
fragmentColor.rgb += lightSpecular.rgb * (baseColor.rgb * SPEC_FACTOR_NO_SPEC_MAP);
 #endif

 #ifdef FLAG_ENV_MAP
 // Env color
vec3 envIntensity = (alpha_spec) ? vec3(texture2D(sSpecmap, texCoord).a) : texture2D(sSpecmap, texCoord).rgb;
fragmentColor.a += (dot(textureCube(sEnvmap, envReflect).rgb, textureCube(sEnvmap, envReflect).rgb) * ENV_ALPHA_FACTOR);
fragmentColor.rgb += textureCube(sEnvmap, envReflect).rgb * envIntensity;
 #endif

 #ifdef FLAG_GLOW_MAP
 // Glow color
fragmentColor.rgb += texture2D(sGlowmap, texCoord).rgb * GLOW_MAP_INTENSITY;
 #endif

 #ifdef FLAG_FOG
fragmentColor.rgb = mix(fragmentColor.rgb, gl_Fog.color.rgb, fogDist);
 #endif

gl_FragColor = fragmentColor;
}

Code: (main-v.sdr) [Select]
#ifdef FLAG_ENV_MAP
uniform mat4 envMatrix;
varying vec3 envReflect;
#endif

#ifdef FLAG_NORMAL_MAP
varying mat3 tbnMatrix;
#endif

#ifdef FLAG_FOG
varying float fogDist;
#endif

varying vec4 position;
varying vec3 lNormal;

void main()
{
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_Position = ftransform();
gl_FrontColor = gl_Color;
gl_FrontSecondaryColor = vec4(0.0, 0.0, 0.0, 1.0);

 // Transform the normal into eye space and normalize the result.
position = gl_ModelViewMatrix * gl_Vertex;
vec3 normal = normalize(gl_NormalMatrix * gl_Normal);
lNormal = normal;

 #ifdef FLAG_NORMAL_MAP
 // Setup stuff for normal maps
vec3 t = normalize(gl_NormalMatrix * gl_MultiTexCoord1.xyz);
vec3 b = cross(normal, t) * gl_MultiTexCoord1.w;
tbnMatrix = mat3(t, b, normal);
 #endif

 #ifdef FLAG_ENV_MAP
 // Environment mapping reflection vector.
envReflect = reflect(position.xyz, normal);
envReflect = vec3(envMatrix * vec4(envReflect, 0.0));
envReflect = normalize(envReflect);
 #endif

 #ifdef FLAG_FOG
fogDist = clamp((gl_Position.z - gl_Fog.start) * 0.75 * gl_Fog.scale, 0.0, 1.0);
 #endif

 #ifdef __GLSL_CG_DATA_TYPES
 // Check necessary for ATI specific behavior
gl_ClipVertex = (gl_ModelViewMatrix * gl_Vertex);
 #endif
}

Note for nVidia Users: The graphics drivers 257.15 through 258.96 have some issues with the way that nVidia chose to handle deprecating some OpenGL features for their OpenGL 4.0 cards that causes for some interesting graphical side effects on non-OpenGL 4.0 cards. It is highly recommended that you upgrade to 260.99 if at all possible!

There is also an OpenGL 4.0 developer driver versioned as 259.31 that will also work appropriately with these shaders.
Title: Re: Shaders for the MediaVPs
Post by: Kolgena on December 01, 2010, 01:49:48 am
Are these the same version as the ones released in the BP Lighting thread?
Title: Re: Shaders for the MediaVPs
Post by: Fury on December 01, 2010, 02:01:05 am
Should be.
Title: Re: Shaders for the MediaVPs
Post by: rscaper1070 on December 05, 2010, 05:23:20 pm
I've been using these shaders for awhile now and everything was fine. Today I decided to reinstall UR3 and then a whole bunch of stuff went wonky. I suddenly got the white boxes but I replaced the shaders and they went away. I'm still getting an error in the log though. Also not sure what's going on with the GVF Tauret, I did a search but nothing came up. Could Unreal have corrupted my Freespace files?

Code: [Select]
==========================================================================
DEBUG SPEW: No debug_filter.cfg found, so only general, error, and warning
categories can be shown and no debug_filter.cfg info will be saved.
==========================================================================
FreeSpace version: 3.6.13.6775
Passed cmdline options:
  -spec_exp 16
  -ogl_spec 32
  -spec_static 1.25
  -spec_point 1.5
  -spec_tube 1.5
  -ambient_factor 120
  -mipmap
  -missile_lighting
  -glow
  -spec
  -no_emissive_light
  -normal
  -3dshockwave
  -post_process
  -bloom_intensity 90
  -cache_bitmaps
  -ballistic_gauge
  -dualscanlines
  -orbradar
  -rearm_timer
  -targetinfo
  -3dwarp
  -ship_choice_3d
  -weapon_choice_3d
  -warp_flash
  -snd_preload
  -mod Cockpitmod,mediavps_3612
  -window
Building file index...
Found root pack 'C:\Games\FreeSpace2\mediavps_3612\3613_Update.vp' with a checksum of 0x19cf9a3d
Found root pack 'C:\Games\FreeSpace2\mediavps_3612\MV_Advanced.vp' with a checksum of 0x4b8b0f5a
Found root pack 'C:\Games\FreeSpace2\mediavps_3612\MV_AnimGlows.vp' with a checksum of 0x6a554026
Found root pack 'C:\Games\FreeSpace2\mediavps_3612\MV_Assets.vp' with a checksum of 0x529cc70f
Found root pack 'C:\Games\FreeSpace2\mediavps_3612\MV_Effects.vp' with a checksum of 0xb9a9a485
Found root pack 'C:\Games\FreeSpace2\mediavps_3612\MV_Music.vp' with a checksum of 0xb3e21469
Found root pack 'C:\Games\FreeSpace2\mediavps_3612\MV_RadarIcons.vp' with a checksum of 0x31dd7781
Found root pack 'C:\Games\FreeSpace2\mediavps_3612\MV_Root.vp' with a checksum of 0x6ffd5c78
Found root pack 'C:\Games\FreeSpace2\multi-mission-pack.vp' with a checksum of 0x377695e0
Found root pack 'C:\Games\FreeSpace2\multi-voice-pack.vp' with a checksum of 0xd50e7442
Found root pack 'C:\Games\FreeSpace2\root_fs2.vp' with a checksum of 0xce10d76c
Found root pack 'C:\Games\FreeSpace2\smarty_fs2.vp' with a checksum of 0xddeb3b1e
Found root pack 'C:\Games\FreeSpace2\sparky_fs2.vp' with a checksum of 0x164fe65a
Found root pack 'C:\Games\FreeSpace2\sparky_hi_fs2.vp' with a checksum of 0xa11d56f1
Found root pack 'C:\Games\FreeSpace2\stu_fs2.vp' with a checksum of 0xd77da83a
Found root pack 'C:\Games\FreeSpace2\tango1_fs2.vp' with a checksum of 0x4c25221e
Found root pack 'C:\Games\FreeSpace2\tango2_fs2.vp' with a checksum of 0x86920b82
Found root pack 'C:\Games\FreeSpace2\tango3_fs2.vp' with a checksum of 0x705e8d71
Found root pack 'C:\Games\FreeSpace2\warble_fs2.vp' with a checksum of 0xd85c305d
Searching root 'C:\Games\FreeSpace2\Cockpitmod\' ... 399 files
Searching root 'C:\Games\FreeSpace2\mediavps_3612\' ... 163 files
Searching root pack 'C:\Games\FreeSpace2\mediavps_3612\3613_Update.vp' ... 216 files
Searching root pack 'C:\Games\FreeSpace2\mediavps_3612\MV_Advanced.vp' ... 1283 files
Searching root pack 'C:\Games\FreeSpace2\mediavps_3612\MV_AnimGlows.vp' ... 1641 files
Searching root pack 'C:\Games\FreeSpace2\mediavps_3612\MV_Assets.vp' ... 1527 files
Searching root pack 'C:\Games\FreeSpace2\mediavps_3612\MV_Effects.vp' ... 1876 files
Searching root pack 'C:\Games\FreeSpace2\mediavps_3612\MV_Music.vp' ... 32 files
Searching root pack 'C:\Games\FreeSpace2\mediavps_3612\MV_RadarIcons.vp' ... 24 files
Searching root pack 'C:\Games\FreeSpace2\mediavps_3612\MV_Root.vp' ... 94 files
Searching root 'C:\Games\FreeSpace2\' ... 27 files
Searching root pack 'C:\Games\FreeSpace2\multi-mission-pack.vp' ... 110 files
Searching root pack 'C:\Games\FreeSpace2\multi-voice-pack.vp' ... 307 files
Searching root pack 'C:\Games\FreeSpace2\root_fs2.vp' ... 157 files
Searching root pack 'C:\Games\FreeSpace2\smarty_fs2.vp' ... 10 files
Searching root pack 'C:\Games\FreeSpace2\sparky_fs2.vp' ... 3027 files
Searching root pack 'C:\Games\FreeSpace2\sparky_hi_fs2.vp' ... 1337 files
Searching root pack 'C:\Games\FreeSpace2\stu_fs2.vp' ... 2355 files
Searching root pack 'C:\Games\FreeSpace2\tango1_fs2.vp' ... 32 files
Searching root pack 'C:\Games\FreeSpace2\tango2_fs2.vp' ... 15 files
Searching root pack 'C:\Games\FreeSpace2\tango3_fs2.vp' ... 10 files
Searching root pack 'C:\Games\FreeSpace2\warble_fs2.vp' ... 52 files
Found 22 roots and 14694 files.
AutoLang: Language auto-detection successful...
Setting language to English
TBM  =>  Starting parse of 'mv_core-lcl.tbm' ...
Initializing OpenAL...
  OpenAL Vendor     : Creative Labs Inc.
  OpenAL Renderer   : Software
  OpenAL Version    : 1.1

  Found extension "ALC_EXT_EFX".

  Sample rate: 44100 (44100)
  EFX enabled: NO
  Playback device: Generic Software on Speakers (Realtek High Definition Audio)
  Capture device: Microphone (Realtek High Defini
... OpenAL successfully initialized!
Failed to init speech
Initializing OpenGL graphics device at 1360x768 with 32-bit color...
  Initializing WGL...
  Requested WGL Video values = R: 8, G: 8, B: 8, depth: 32, double-buffer: 1
  Actual WGL Video values    = R: 8, G: 8, B: 8, depth: 32, double-buffer: 1
  OpenGL Vendor    : ATI Technologies Inc.
  OpenGL Renderer  : ATI Radeon HD 4300/4500 Series   
  OpenGL Version   : 3.3.10317 Compatibility Profile Context

  Using extension "GL_EXT_fog_coord".
  Using extension "GL_ARB_multitexture".
  Using extension "GL_ARB_texture_env_add".
  Using extension "GL_ARB_texture_compression".
  Using extension "GL_EXT_texture_compression_s3tc".
  Using extension "GL_EXT_texture_filter_anisotropic".
  Using extension "GL_ARB_texture_env_combine".
  Using extension "GL_EXT_compiled_vertex_array".
  Using extension "GL_EXT_draw_range_elements".
  Using extension "GL_ARB_texture_mirrored_repeat".
  Using extension "GL_ARB_texture_non_power_of_two".
  Using extension "GL_ARB_vertex_buffer_object".
  Using extension "GL_ARB_pixel_buffer_object".
  Using extension "GL_SGIS_generate_mipmap".
  Using extension "GL_EXT_framebuffer_object".
  Using extension "GL_ARB_texture_rectangle".
  Using extension "GL_EXT_bgra".
  Using extension "GL_ARB_texture_cube_map".
  Using extension "GL_EXT_texture_lod_bias".
  Using extension "GL_ARB_point_sprite".
  Using extension "GL_ARB_shading_language_100".
  Using extension "GL_ARB_shader_objects".
  Using extension "GL_ARB_vertex_shader".
  Using extension "GL_ARB_fragment_shader".
  Using extension "GL_ARB_shader_texture_lod".
  Found special extension function "wglSwapIntervalEXT".

  Compiling shader: main-v.sdr (null-v.sdr), main-f.sdr (null-f.sdr)
  Compiling shader: main-v.sdr (l-v.sdr), main-f.sdr (lb-f.sdr)
Shader failed to link:
Fragment shader(s) failed to link,  vertex shader(s) failed to link.
unexpected error.
unexpected error.

ERROR! Unable to create shader program!
  Shader in_error!  Disabling GLSL model rendering!

  Compiling post-processing shader 1 ...
  Compiling post-processing shader 2 ...
  Compiling post-processing shader 3 ...
  Compiling post-processing shader 4 ...

  Max texture units: 8 (16)
  Max elements vertices: 2147483647
  Max elements indices: 16777215
  Max texture size: 8192x8192
  Max render buffer size: 8192x8192
  Can use compressed textures: YES
  Texture compression available: YES
  Post-processing enabled: YES
  Using trilinear texture filter.
  OpenGL Shader Version: 3.30
... OpenGL init is complete!
Size of bitmap info = 760 KB
Size of bitmap extra info = 52 bytes
ANI cursorweb with size 24x24 (25.0% wasted)
GRAPHICS: Initializing default colors...
SCRIPTING: Beginning initialization sequence...
SCRIPTING: Beginning Lua initialization...
LUA: Opening LUA state...
LUA: Initializing base Lua libraries...
LUA: Beginning ADE initialization
ADE: Initializing enumeration constants...
ADE: Assigning Lua session...
SCRIPTING: Beginning main hook parse sequence....
Wokka!  Error opening file (scripting.tbl)!
TABLES: Unable to parse 'scripting.tbl'!  Error code = 5.
TBM  =>  Starting parse of 'mv_flak-sct.tbm' ...
TBM  =>  Starting parse of 'mv_dbrs-sct.tbm' ...
TBM  =>  Starting parse of 'mv_exp-sct.tbm' ...
SCRIPTING: Inititialization complete.
SCRIPTING: Splash screen overrides checked
SCRIPTING: Splash hook has been run
SCRIPTING: Splash screen conditional hook has been run
Using high memory settings...
Wokka!  Error opening file (interface.tbl)!
WMCGUI: Unable to parse 'interface.tbl'!  Error code = 5.
TBM  =>  Starting parse of 'mv_effects-sdf.tbm' ...
Windows reported 16 joysticks, we found 1
Current soundtrack set to -1 in event_music_reset_choices
TBM  =>  Starting parse of 'mv_music-mus.tbm' ...
TBM  =>  Starting parse of 'mv_effects-mfl.tbm' ...
Wokka!  Error opening file (armor.tbl)!
TABLES: Unable to parse 'armor.tbl'!  Error code = 5.
TBM  =>  Starting parse of 'mv_effects-amr.tbm' ...
TBM  =>  Starting parse of 'mv_effects-wxp.tbm' ...
BMPMAN: Found EFF (exp20.eff) with 75 frames at 20 fps.
BMPMAN: Found EFF (ExpMissileHit1.eff) with 92 frames at 20 fps.
BMPMAN: Found EFF (exp04.eff) with 49 frames at 22 fps.
BMPMAN: Found EFF (exp05.eff) with 93 frames at 20 fps.
BMPMAN: Found EFF (exp06.eff) with 92 frames at 22 fps.
BMPMAN: Found EFF (capflash.eff) with 40 frames at 10 fps.
BMPMAN: Found EFF (Maxim_Impact.eff) with 23 frames at 30 fps.
ANI Lamprey_Impact with size 80x80 (37.5% wasted)
TBM  =>  Starting parse of 'mv_core-wep.tbm' ...
TBM  =>  Starting parse of 'mv_assets-wep.tbm' ...
TBM  =>  Starting parse of 'mv_effects-wep.tbm' ...
TBM  =>  Starting parse of 'mv_effects-obt.tbm' ...
TBM  =>  Starting parse of 'radar-shp.tbm' ...
TBM  =>  Starting parse of 'mv_effects-shp.tbm' ...
TBM  =>  Starting parse of 'mv_assets-shp.tbm' ...
TBM  =>  Starting parse of 'mv_core-shp.tbm' ...
TBM  =>  Starting parse of 'AoACockpits-shp.tbm' ...
ANI support1 with size 108x24 (25.0% wasted)
ANI damage1 with size 148x25 (21.9% wasted)
ANI wingman1 with size 71x53 (17.2% wasted)
ANI wingman2 with size 35x53 (17.2% wasted)
ANI wingman3 with size 14x53 (17.2% wasted)
ANI toggle1 with size 57x20 (37.5% wasted)
ANI head1 with size 164x132 (48.4% wasted)
ANI weapons1 with size 126x20 (37.5% wasted)
ANI weapons1_b with size 150x20 (37.5% wasted)
ANI objective1 with size 149x21 (34.4% wasted)
ANI energy1 with size 12x41 (35.9% wasted)
ANI targetview1 with size 137x156 (39.1% wasted)
ANI targetview2 with size 4x96 (25.0% wasted)
ANI targetview3 with size 7x20 (37.5% wasted)
ANI 2_radar1 with size 179x146 (43.0% wasted)
ANI 2_energy2 with size 86x96 (25.0% wasted)
ANI 2_reticle1 with size 40x24 (25.0% wasted)
ANI targhit1 with size 31x21 (34.4% wasted)
ANI 2_leftarc with size 103x252 (1.6% wasted)
ANI 2_rightarc1 with size 103x252 (1.6% wasted)
ANI 2_toparc2 with size 35x24 (25.0% wasted)
ANI 2_toparc3 with size 41x29 (9.4% wasted)
ANI netlag1 with size 29x30 (6.3% wasted)
ANI 2_lead1 with size 26x26 (18.8% wasted)
ANI 2_lock1 with size 56x53 (17.2% wasted)
ANI 2_lockspin with size 100x100 (21.9% wasted)
ANI time1 with size 47x23 (28.1% wasted)
ANI targetview1_2 with size 274x116 (9.4% wasted)
TBM  =>  Starting parse of 'mv_core-hdg.tbm' ...
TBM  =>  Starting parse of 'mv_effects-str.tbm' ...
loading animated cursor "cursor"
ANI cursor with size 24x24 (25.0% wasted)
MediaVPs: Flaming debris script loaded!
MediaVPs: Explosions script loaded!
Ships.tbl is : VALID
Weapons.tbl is : VALID
cfile_init() took 399
Got event GS_EVENT_GAME_INIT (49) in state NOT A VALID STATE (0)
ANI cursor.ani with size 24x24 (25.0% wasted)
Got event GS_EVENT_MAIN_MENU (0) in state GS_STATE_INITIAL_PLAYER_SELECT (37)
Someone passed an extension to bm_load for file 'vasudan1.pcx'
ANI 2_mainwalk.ani with size 209x477 (6.8% wasted)
ANI 2_mainflyby.ani with size 509x189 (26.2% wasted)
ANI 2_maincrane.ani with size 192x116 (9.4% wasted)
ANI 2_mainexit.ani with size 319x174 (32.0% wasted)
ANI 2_mainbarracks.ani with size 273x158 (38.3% wasted)
ANI 2_mainreadyroom.ani with size 231x145 (43.4% wasted)
ANI 2_maintechroom.ani with size 69x119 (7.0% wasted)
ANI 2_mainoptions.ani with size 337x206 (19.5% wasted)
ANI 2_maincampaign.ani with size 308x190 (25.8% wasted)
Got event GS_EVENT_NEW_CAMPAIGN (26) in state GS_STATE_MAIN_MENU (1)
Got event GS_EVENT_START_GAME (1) in state GS_STATE_MAIN_MENU (1)
=================== STARTING LEVEL LOAD ==================
Reassigning player to squadron 203rd Scorpions
Someone passed an extension to bm_load for file 'vasudan1.pcx'
ANI 2_Loading with size 824x43 (32.8% wasted)
ANI 2_Loading.ani with size 824x43 (32.8% wasted)
Starting model page in...
Beginning level bitmap paging...
BMPMAN: Found EFF (particleexp01.eff) with 10 frames at 8 fps.
BMPMAN: Found EFF (particlesmoke01.eff) with 51 frames at 30 fps.
BMPMAN: Found EFF (particlesmoke02.eff) with 39 frames at 24 fps.
TBM  =>  Starting parse of 'mv_effects-fbl.tbm' ...
BMPMAN: Found EFF (WarpMap01.eff) with 30 frames at 30 fps.
BMPMAN: Found EFF (WarpMap02.eff) with 30 frames at 30 fps.
BMPMAN: Found EFF (Rock_Exp.eff) with 55 frames at 30 fps.
Loading warp model
Loading model 'warp.pof'
IBX: Found a good IBX to read for 'warp.pof'.
IBX-DEBUG => POF checksum: 0xbf802ad0, IBX checksum: 0xe7aa5a55 -- "warp.pof"
 300
BMPMAN: Found EFF (shieldhit01a.eff) with 23 frames at 21 fps.
BMPMAN: Found EFF (shieldhit02a.eff) with 45 frames at 30 fps.
BMPMAN: Found EFF (shieldhit03a.eff) with 22 frames at 30 fps.
SHOCKWAVE =>  Loading default shockwave model...
Loading model 'shockwave.pof'
BMPMAN: Found EFF (shockwave3d-glow.eff) with 159 frames at 24 fps.
Model shockwave.pof has a null moment of inertia!  (This is only a problem if the model is a ship.)
IBX: Found a good IBX to read for 'shockwave.pof'.
IBX-DEBUG => POF checksum: 0xa85bec39, IBX checksum: 0x9af155c2 -- "shockwave.pof"
SHOCKWAVE =>  Default model load: SUCCEEDED!!
MISSION LOAD: 'SM2-09.fs2'
Hmmm... Extension passed to mission_load...
Reassigning player to squadron 203rd Scorpions
Someone passed an extension to bm_load for file 'vasudan1.pcx'
Starting mission message count : 205
Ending mission message count : 235
Current soundtrack set to -1 in event_music_reset_choices
Loading model 'fighter2v-01.pof'
IBX: Found a good IBX to read for 'fighter2v-01.pof'.
IBX-DEBUG => POF checksum: 0xf10e3efe, IBX checksum: 0x34dc8c92 -- "fighter2v-01.pof"
Loading model 'corvette2r-01.pof'
Unknown special object type $path29 while reading model corvette2r-01.pof
IBX: Found a good IBX to read for 'corvette2r-01.pof'.
IBX-DEBUG => POF checksum: 0x7420b86f, IBX checksum: 0x4dc3a564 -- "corvette2r-01.pof"
Submodel 'turret21b' is detail level 1 of 'turret21a'
Submodel 'turret22b' is detail level 1 of 'turret22a'
Allocating space for at least 32 new ship subsystems ...  a total of 200 is now available (32 in-use).
Loading model 'corvette2s-01.pof'
BMPMAN: Found EFF (corvstile3-glow.eff) with 37 frames at 15 fps.
Unknown special object type $path17 while reading model corvette2s-01.pof
Unknown special object type $path25 while reading model corvette2s-01.pof
Unknown special object type $path15 while reading model corvette2s-01.pof
Potential problem found: Unrecognized subsystem type 'fighterbay', believed to be in ship corvette2s-01.pof
Potential problem found: Unrecognized subsystem type 'reactor', believed to be in ship corvette2s-01.pof
IBX: Found a good IBX to read for 'corvette2s-01.pof'.
IBX-DEBUG => POF checksum: 0xe86c38c5, IBX checksum: 0x83e4343a -- "corvette2s-01.pof"
Loading model 'fighter03.pof'
BMPMAN: Found EFF (fighter03-glow.eff) with 37 frames at 25 fps.
IBX: Found a good IBX to read for 'fighter03.pof'.
IBX-DEBUG => POF checksum: 0x9f0d3e2e, IBX checksum: 0xfa2cfcf8 -- "fighter03.pof"
Loading model 'fighter2v-03.pof'
IBX: Found a good IBX to read for 'fighter2v-03.pof'.
IBX-DEBUG => POF checksum: 0xd3de39a9, IBX checksum: 0xc0071bd5 -- "fighter2v-03.pof"
Loading model 'bomber2v-02.pof'
IBX: Found a good IBX to read for 'bomber2v-02.pof'.
IBX-DEBUG => POF checksum: 0xf8211b62, IBX checksum: 0x33e2676d -- "bomber2v-02.pof"
Submodel 'hercb' is detail level 1 of 'herca'
Submodel 'hercc' is detail level 2 of 'herca'
Submodel 'hercd' is detail level 3 of 'herca'
Loading model 'cruiser2s-01.pof'
BMPMAN: Found EFF (cruistiles2-glow.eff) with 50 frames at 25 fps.
BMPMAN: Found EFF (cruistiles4-glow.eff) with 50 frames at 25 fps.
BMPMAN: Found EFF (cruistiles5-glow.eff) with 37 frames at 15 fps.
Potential problem found: Unrecognized subsystem type 'reactor', believed to be in ship cruiser2s-01.pof
IBX: Found a good IBX to read for 'cruiser2s-01.pof'.
IBX-DEBUG => POF checksum: 0x96a2dce5, IBX checksum: 0xf522fb26 -- "cruiser2s-01.pof"
Submodel 'cruiser2s-01b' is detail level 1 of 'cruiser2s-01a'
Submodel 'cruiser2s-01c' is detail level 2 of 'cruiser2s-01a'
Submodel 'cruiser2s-01d' is detail level 3 of 'cruiser2s-01a'
Loading model 'cruiser03.pof'
IBX: Found a good IBX to read for 'cruiser03.pof'.
IBX-DEBUG => POF checksum: 0xf9cc8638, IBX checksum: 0x54166f9f -- "cruiser03.pof"
Loading model 'corvette2v-01.pof'
IBX: Found a good IBX to read for 'corvette2v-01.pof'.
IBX-DEBUG => POF checksum: 0xd5ba13a1, IBX checksum: 0x0f6dbf54 -- "corvette2v-01.pof"
Loading model 'fighter2s-02.pof'
BMPMAN: Found EFF (fighter2s-02-glow.eff) with 37 frames at 25 fps.
IBX: Found a good IBX to read for 'fighter2s-02.pof'.
IBX-DEBUG => POF checksum: 0x85ec93bc, IBX checksum: 0xc2486863 -- "fighter2s-02.pof"
Loading model 'fighter2s-03.pof'
BMPMAN: Found EFF (fighter2s-03-glow.eff) with 40 frames at 26 fps.
IBX: Found a good IBX to read for 'fighter2s-03.pof'.
IBX-DEBUG => POF checksum: 0x26d0ea87, IBX checksum: 0xec91e864 -- "fighter2s-03.pof"
Submodel 'fighter-b' is detail level 1 of 'fighter-a'
Submodel 'fighter-c' is detail level 2 of 'fighter-a'
Submodel 'fighter-d' is detail level 3 of 'fighter-a'
Loading model 'fighter2v-02.pof'
Model fighter2v-02.pof has a null moment of inertia!  (This is only a problem if the model is a ship.)
IBX: Found a good IBX to read for 'fighter2v-02.pof'.
IBX-DEBUG => POF checksum: 0xedd45ca6, IBX checksum: 0x317c25b1 -- "fighter2v-02.pof"
WARNING: "For ship 'GVF Tauret', detail level mismatch (POF needs 5)" at ship.cpp:8410
WARNING: "GVF Tauret (fighter2v-02.pof) has a null moment of inertia!" at ship.cpp:4210
WARNING: "For ship 'GVF Tauret', detail level mismatch (POF needs 5)" at ship.cpp:8410
WARNING: "GVF Tauret (fighter2v-02.pof) has a null moment of inertia!" at ship.cpp:4210
WARNING: "For ship 'GVF Tauret', detail level mismatch (POF needs 5)" at ship.cpp:8410
WARNING: "GVF Tauret (fighter2v-02.pof) has a null moment of inertia!" at ship.cpp:4210
WARNING: "For ship 'GVF Tauret', detail level mismatch (POF needs 5)" at ship.cpp:8410
WARNING: "GVF Tauret (fighter2v-02.pof) has a null moment of inertia!" at ship.cpp:4210
ANI gas with size 128x127 (0.8% wasted)
Adding default sun.
=================== STARTING LEVEL DATA LOAD ==================
Loading model 'support2t-01.pof'
IBX: Found a good IBX to read for 'support2t-01.pof'.
IBX-DEBUG => POF checksum: 0x6512c7b6, IBX checksum: 0xc0ade8e6 -- "support2t-01.pof"
Submodel 'bodyb' is detail level 1 of 'bodya'
Submodel 'bodyc' is detail level 2 of 'bodya'
Submodel 'bodyd' is detail level 3 of 'bodya'
Loading model 'support2v-01.pof'
IBX: Found a good IBX to read for 'support2v-01.pof'.
IBX-DEBUG => POF checksum: 0x0abd41b4, IBX checksum: 0x511e9c8b -- "support2v-01.pof"
Submodel 'hercb' is detail level 1 of 'herca'
Submodel 'hercc' is detail level 2 of 'herca'
Submodel 'hercd' is detail level 3 of 'herca'
Allocating space for at least 172 new ship subsystems ...  a total of 400 is now available (117 in-use).
About to page in ships!
ANI shieldfv-01 with size 112x93 (27.3% wasted)
ANI shieldfv-02 with size 112x93 (27.3% wasted)
ANI shieldbv-02 with size 112x93 (27.3% wasted)
ANI shieldbv-01 with size 112x93 (27.3% wasted)
ANI shield-f03 with size 112x93 (27.3% wasted)
ANI shieldfs-02 with size 112x93 (27.3% wasted)
ANI shieldfs-03 with size 112x93 (27.3% wasted)
BMPMAN: Found EFF (Subach_AniBitmap.eff) with 6 frames at 5 fps.
BMPMAN: Found EFF (PrometheusR_AniBitmap.eff) with 12 frames at 5 fps.
BMPMAN: Found EFF (Prometheus_AniBitmap.eff) with 12 frames at 5 fps.
ANI Lamprey_Particle with size 92x86 (32.8% wasted)
BMPMAN: Found EFF (Alouqua_AniBitmap.eff) with 6 frames at 20 fps.
BMPMAN: Found EFF (particle_red.eff) with 11 frames at 22 fps.
BMPMAN: Found EFF (SbeamAglow.eff) with 24 frames at 60 fps.
BMPMAN: Found EFF (SbeamAC.eff) with 30 frames at 40 fps.
BMPMAN: Found EFF (particle_blue.eff) with 11 frames at 22 fps.
BMPMAN: Found EFF (AAAbeamAglow.eff) with 35 frames at 30 fps.
BMPMAN: Found EFF (AAAbeamAB.eff) with 15 frames at 15 fps.
BMPMAN: Found EFF (particle_green.eff) with 11 frames at 22 fps.
BMPMAN: Found EFF (GreenBeam2Glow.eff) with 30 frames at 60 fps.
BMPMAN: Found EFF (particle_yellow.eff) with 11 frames at 22 fps.
BMPMAN: Found EFF (beamglow6.eff) with 60 frames at 26 fps.
Loading model 'Blip.pof'
IBX: Found a good IBX to read for 'Blip.pof'.
IBX-DEBUG => POF checksum: 0x8701ba27, IBX checksum: 0x3ee2fcac -- "Blip.pof"
Submodel 'blipb' is detail level 1 of 'blipa'
Submodel 'blipc' is detail level 2 of 'blipa'
Submodel 'blipd' is detail level 3 of 'blipa'
Loading model 'rockeye.pof'
IBX: Found a good IBX to read for 'rockeye.pof'.
IBX-DEBUG => POF checksum: 0x821bc51b, IBX checksum: 0x5a0fae49 -- "rockeye.pof"
Submodel 'rockeye-b' is detail level 1 of 'rockeye-a'
Submodel 'rockeye-c' is detail level 2 of 'rockeye-a'
Submodel 'thruster01b' is detail level 1 of 'thruster01a'
Submodel 'thruster01c' is detail level 2 of 'thruster01a'
Loading model 'Tempest.pof'
IBX: Found a good IBX to read for 'Tempest.pof'.
IBX-DEBUG => POF checksum: 0x4fcb12af, IBX checksum: 0xef8699b5 -- "Tempest.pof"
Loading model 'NewHornet.pof'
IBX: Found a good IBX to read for 'NewHornet.pof'.
IBX-DEBUG => POF checksum: 0x2c76000e, IBX checksum: 0x19f7f55e -- "NewHornet.pof"
Loading model 'bombardier.pof'
IBX: Found a good IBX to read for 'bombardier.pof'.
IBX-DEBUG => POF checksum: 0x11edee12, IBX checksum: 0x19816d20 -- "bombardier.pof"
Submodel 'realhornet-b' is detail level 1 of 'realhornet-a'
Submodel 'realhornet-c' is detail level 2 of 'realhornet-a'
Loading model 'crossbow.pof'
No subsystems found for model "crossbow.pof".
IBX: Found a good IBX to read for 'crossbow.pof'.
IBX-DEBUG => POF checksum: 0x19e682bb, IBX checksum: 0x885d0786 -- "crossbow.pof"
Loading model 'tagb.pof'
IBX: Found a good IBX to read for 'tagb.pof'.
IBX-DEBUG => POF checksum: 0x647d1541, IBX checksum: 0x419d0e2f -- "tagb.pof"
Submodel 'tagbreal-b' is detail level 1 of 'tagbreal-a'
Submodel 'tagbreal-c' is detail level 2 of 'tagbreal-a'
Loading model 'piranha.pof'
IBX: Found a good IBX to read for 'piranha.pof'.
IBX-DEBUG => POF checksum: 0x484195d2, IBX checksum: 0x38b567e1 -- "piranha.pof"
BMPMAN: Found EFF (shockwave01.eff) with 98 frames at 30 fps.
Loading model 'stilettoII.pof'
IBX: Found a good IBX to read for 'stilettoII.pof'.
IBX-DEBUG => POF checksum: 0xc03ac47f, IBX checksum: 0x21dd34b9 -- "stilettoII.pof"
BMPMAN: Found EFF (missilespew04.eff) with 20 frames at 30 fps.
Loading model 'belial.pof'
IBX: Found a good IBX to read for 'belial.pof'.
IBX-DEBUG => POF checksum: 0x99bae2a2, IBX checksum: 0x77d1d113 -- "belial.pof"
Loading model 'cmeasure01.pof'
IBX: Found a good IBX to read for 'cmeasure01.pof'.
IBX-DEBUG => POF checksum: 0x562739c3, IBX checksum: 0x76256515 -- "cmeasure01.pof"
Loading model 'S_Rockeye.pof'
BMPMAN: Found EFF (smissile1-glow.eff) with 20 frames at 20 fps.
IBX: Found a good IBX to read for 'S_Rockeye.pof'.
IBX-DEBUG => POF checksum: 0x4a2c27f4, IBX checksum: 0xb83aec46 -- "S_Rockeye.pof"
Loading model 'S_Hornet.pof'
IBX: Found a good IBX to read for 'S_Hornet.pof'.
IBX-DEBUG => POF checksum: 0xb2f69e71, IBX checksum: 0xebab0a4c -- "S_Hornet.pof"
Loading model 'S_Harpoon.pof'
IBX: Found a good IBX to read for 'S_Harpoon.pof'.
IBX-DEBUG => POF checksum: 0x76d846b5, IBX checksum: 0x542f5294 -- "S_Harpoon.pof"
Loading model 'S_Trebuchet.pof'
IBX: Found a good IBX to read for 'S_Trebuchet.pof'.
IBX-DEBUG => POF checksum: 0x9a344f4d, IBX checksum: 0x66297058 -- "S_Trebuchet.pof"
Loading model 'ShivanCluster.pof'
IBX: Found a good IBX to read for 'ShivanCluster.pof'.
IBX-DEBUG => POF checksum: 0x4b5c01e9, IBX checksum: 0x74308692 -- "ShivanCluster.pof"
Loading model 'MX-50.pof'
DDS ERROR: Couldn't open 'wep-mx50-shine.dds' -- DDS was in an unsupported/unknown format
IBX: Found a good IBX to read for 'MX-50.pof'.
IBX-DEBUG => POF checksum: 0x25d2520e, IBX checksum: 0xc624dc0f -- "MX-50.pof"
Loading model 'Interceptor.pof'
IBX: Found a good IBX to read for 'Interceptor.pof'.
IBX-DEBUG => POF checksum: 0x74aa90ad, IBX checksum: 0xfdd1d169 -- "Interceptor.pof"
Loading model 'hornet.pof'
IBX: Found a good IBX to read for 'hornet.pof'.
IBX-DEBUG => POF checksum: 0x066a989a, IBX checksum: 0x8d7227a4 -- "hornet.pof"
Loading model 'debris01.pof'
IBX: Found a good IBX to read for 'debris01.pof'.
IBX-DEBUG => POF checksum: 0x974f214b, IBX checksum: 0x0cb49c79 -- "debris01.pof"
Loading model 'debris02.pof'
IBX: Found a good IBX to read for 'debris02.pof'.
IBX-DEBUG => POF checksum: 0x8e0eed50, IBX checksum: 0x3e979514 -- "debris02.pof"
BMPMAN: Found EFF (explode1.eff) with 43 frames at 25 fps.
BMPMAN: Found EFF (PWmuzzle.eff) with 4 frames at 30 fps.
BMPMAN: Found EFF (Gmuzzle.eff) with 5 frames at 30 fps.
BMPMAN: Found EFF (Bmuzzle.eff) with 5 frames at 30 fps.
BMPMAN: Found EFF (Rmuzzle.eff) with 4 frames at 30 fps.
BMPMAN: Found EFF (Cmuzzle.eff) with 4 frames at 30 fps.
Paging in mission messages
Stopping model page in...
ANI Lamprey_Impact.ani with size 80x80 (37.5% wasted)
ANI support1.ani with size 108x24 (25.0% wasted)
ANI damage1.ani with size 148x25 (21.9% wasted)
ANI wingman1.ani with size 71x53 (17.2% wasted)
ANI wingman2.ani with size 35x53 (17.2% wasted)
ANI wingman3.ani with size 14x53 (17.2% wasted)
ANI toggle1.ani with size 57x20 (37.5% wasted)
ANI head1.ani with size 164x132 (48.4% wasted)
ANI weapons1.ani with size 126x20 (37.5% wasted)
ANI weapons1_b.ani with size 150x20 (37.5% wasted)
ANI objective1.ani with size 149x21 (34.4% wasted)
ANI energy1.ani with size 12x41 (35.9% wasted)
ANI targetview1.ani with size 137x156 (39.1% wasted)
ANI targetview2.ani with size 4x96 (25.0% wasted)
ANI targetview3.ani with size 7x20 (37.5% wasted)
ANI 2_radar1.ani with size 179x146 (43.0% wasted)
ANI 2_energy2.ani with size 86x96 (25.0% wasted)
ANI 2_reticle1.ani with size 40x24 (25.0% wasted)
ANI targhit1.ani with size 31x21 (34.4% wasted)
ANI 2_leftarc.ani with size 103x252 (1.6% wasted)
ANI 2_rightarc1.ani with size 103x252 (1.6% wasted)
ANI 2_toparc2.ani with size 35x24 (25.0% wasted)
ANI 2_toparc3.ani with size 41x29 (9.4% wasted)
ANI netlag1.ani with size 29x30 (6.3% wasted)
ANI 2_lead1.ani with size 26x26 (18.8% wasted)
ANI 2_lock1.ani with size 56x53 (17.2% wasted)
ANI 2_lockspin.ani with size 100x100 (21.9% wasted)
ANI time1.ani with size 47x23 (28.1% wasted)
ANI targetview1_2.ani with size 274x116 (9.4% wasted)
ANI 2_Loading.ani with size 824x43 (32.8% wasted)
ANI gas.ani with size 128x127 (0.8% wasted)
ANI shieldfv-01.ani with size 112x93 (27.3% wasted)
ANI shieldfv-02.ani with size 112x93 (27.3% wasted)
ANI shieldbv-02.ani with size 112x93 (27.3% wasted)
ANI shieldbv-01.ani with size 112x93 (27.3% wasted)
ANI shield-f03.ani with size 112x93 (27.3% wasted)
ANI shieldfs-02.ani with size 112x93 (27.3% wasted)
ANI shieldfs-03.ani with size 112x93 (27.3% wasted)
ANI Lamprey_Particle.ani with size 92x86 (32.8% wasted)
User bitmap 'TMP308x190+16'
User bitmap 'TMP337x206+16'
User bitmap 'TMP69x119+16'
User bitmap 'TMP231x145+16'
User bitmap 'TMP273x158+16'
User bitmap 'TMP319x174+16'
User bitmap 'TMP192x116+16'
User bitmap 'TMP509x189+16'
User bitmap 'TMP209x477+16'
User bitmap 'TMP256x256+8'
User bitmap 'TMP256x256+8'
User bitmap 'TMP128x128+8'
Bmpman: 2325/4750 bitmap slots in use.
Ending level bitmap paging...
=================== ENDING LOAD ================
Real count = 574,  Estimated count = 425
================================================
MediaVPs: Flaming debris script ACTIVE!
SCRIPTING: Starting flashy deaths script loading

Class: gtf ulysses
FRM: 1
FE: 1

Class: gtf hercules
FRM: 1
FE: 1

Class: gtf hercules mark ii
FRM: 1
FE: 1

Class: gtf ares
FRM: 1
FE: 1

Class: gtf erinyes
FRM: 1
FE: 1

Class: gtf loki
FRM: 1
FE: 1

Class: gtf pegasus
FRM: 1
FE: 1

Class: gtf perseus
FRM: 1
FE: 1

Class: gtf myrmidon
FRM: 1
FE: 1

Class: sf mara (terrans)
FRM: 1
FE: 1

Class: gtb artemis
FRM: 1
FE: 1

Class: gtb artemis d.h.
FRM: 1
FE: 1

Class: gtb medusa
FRM: 1
FE: 1

Class: gtb ursa
FRM: 1
FE: 1

Class: gtb zeus
FRM: 1
FE: 1

Class: gtb boanerges
FRM: 1
FE: 1

Class: gtdr amazon
FRM: 1
FE: 1

Class: gtdr amazon advanced
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 6
BE: 0.45
BEDu: 5000
BEDM: 2.5

Class: gts hygeia
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 1

Class: gtfr triton
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 6
BE: 0.45
BEDu: 5000
BEDM: 2.5

Class: tc-tri
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 6
BE: 0.4
BEDu: 4000
BEDM: 2.5

Class: gtfr poseidon
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 6

Class: tc 2
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 1

Class: tsc 2
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 1

Class: tac 1
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 1

Class: ttc 1
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 1

Class: gtc fenris
DRM: 0.25
DE: 2
DM: 1
FRM: 2
FE: 6
BE: 0.6
BEDu: 8000
BEDM: 2.5

Class: gtm hippocrates
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 6
BE: 0.6
BEDu: 8000
BEDM: 2.5

Class: gtc leviathan
DRM: 0.25
DE: 2
DM: 1
FRM: 2
FE: 6
BE: 0.6
BEDu: 8000
BEDM: 2.5

Class: gtsc faustus
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 6
BE: 0.6
BEDu: 8000
BEDM: 2.5

Class: gtg zephyrus
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 6
BE: 0.55
BEDu: 7000
BEDM: 2.5

Class: gta charybdis
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 6
BE: 0.5
BEDu: 6000
BEDM: 2.5

Class: gtd orion
DRM: 0.25
DE: 2
DM: 1
FRM: 2
FE: 6
BE: 0.7
BEDu: 10000
BEDM: 2.5

Class: gtd hecate
DRM: 0.25
DE: 2
DM: 1
FRM: 2
FE: 6
BE: 0.7
BEDu: 10000
BEDM: 2.5

Class: gtd orion#2 (bastion)
DRM: 0.25
DE: 2
DM: 1
FRM: 2
FE: 6
BE: 0.7
BEDu: 10000
BEDM: 2.5

Class: gtd hades
DRM: 0.25
DE: 2
DM: 1
FRM: 2
FE: 6
BE: 0.7
BEDu: 10000
BEDM: 2.5

Class: gti arcadia
DRM: 0.25
DE: 2
DM: 1
FRM: 2
FE: 6
BE: 0.7
BEDu: 10000
BEDM: 2.5

Class: gtva colossus
DRM: 0.25
DE: 2
DM: 1
FRM: 5
FE: 6
BE: 0.75
BEDu: 11000
BEDM: 2.5

Class: gtcv deimos
DRM: 0.25
DE: 2
DM: 1
FRM: 2
FE: 6
BE: 0.65
BEDu: 9000
BEDM: 2.5

Class: gtc aeolus
DRM: 0.25
DE: 2
DM: 1
FRM: 2
FE: 6
BE: 0.6
BEDu: 8000
BEDM: 2.5

Class: ntf iceni
DRM: 0.25
DE: 2
DM: 1
FRM: 2
FE: 6
BE: 0.65
BEDu: 9000
BEDM: 2.5

Class: ntf boadicea
DRM: 0.25
DE: 2
DM: 1
FRM: 2
FE: 6
BE: 0.6
BEDu: 8000
BEDM: 2.5

Class: gtt elysium
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 6

Class: gtt argo
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 6
BE: 0.4
BEDu: 4000
BEDM: 2.5

Class: gti ganymede
DRM: 0.25
DE: 2
DM: 1
FRM: 2
FE: 6
BE: 0.7
BEDu: 10000
BEDM: 2.5

Class: knossos
DRM: 0.25
DE: 2
DM: 1
FRM: 5
FE: 6
BE: 0.8
BEDu: 12000
BEDM: 2.5

Class: gtsg watchdog
FRM: 1
FE: 1

Class: gtsg cerberus
FRM: 1
FE: 1

Class: gtsg alastor
FRM: 1
FE: 1

Class: gtep hermes
FRM: 1
FE: 1

Class: tc-meson bomb
FRM: 4
FE: 6
BE: 0.8
BEDu: 10000
BEDM: 10

Class: gtsg mjolnir
DRM: 0.25
DE: 2
DM: 1
FRM: 2
FE: 6
BE: 0.6
BEDu: 8000
BEDM: 2.5

Class: gtsg mjolnir#home
DRM: 0.25
DE: 2
DM: 1
FRM: 2
FE: 6
BE: 0.6
BEDu: 8000
BEDM: 2.5

Class: gvf seth
FRM: 1
FE: 1

Class: gvf horus
FRM: 1
FE: 1

Class: gvf thoth
FRM: 1
FE: 1

Class: gvf serapis
FRM: 1
FE: 1

Class: gvf tauret
FRM: 1
FE: 1

Class: gvb sekhmet
FRM: 1
FE: 1

Class: gvb osiris
FRM: 1
FE: 1

Class: gvb bakha
FRM: 1
FE: 1

Class: gvf ptah
FRM: 1
FE: 1

Class: gvs nephthys
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 6

Class: gvt isis
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 6

Class: pvfr ma'at
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 6

Class: gvfr bes
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 6

Class: vac 5
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 1

Class: vac 4
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 1

Class: gvfr satis
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 6
BE: 0.45
BEDu: 5000
BEDM: 2.5

Class: gvg anuket
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 6
BE: 0.55
BEDu: 7000
BEDM: 2.5

Class: gvc aten
DRM: 0.25
DE: 2
DM: 1
FRM: 2
FE: 6
BE: 0.6
BEDu: 8000
BEDM: 2.5

Class: gvc mentu
DRM: 0.25
DE: 2
DM: 1
FRM: 2
FE: 6
BE: 0.6
BEDu: 8000
BEDM: 2.5

Class: gvcv sobek
DRM: 0.25
DE: 2
DM: 1
FRM: 2
FE: 6
BE: 0.65
BEDu: 9000
BEDM: 2.5

Class: gvd typhon
DRM: 0.25
DE: 2
DM: 1
FRM: 2
FE: 6
BE: 0.7
BEDu: 10000
BEDM: 2.5

Class: gvsg ankh
FRM: 1
FE: 1

Class: gvsg edjo
FRM: 1
FE: 1

Class: gvep ra
FRM: 1
FE: 1

Class: gva setekh
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 6
BE: 0.5
BEDu: 6000
BEDM: 2.5

Class: gvd hatshepsut
DRM: 0.25
DE: 2
DM: 1
FRM: 2
FE: 6
BE: 0.7
BEDu: 10000
BEDM: 2.5

Class: sf dragon
FRM: 1
FE: 1

Class: sf basilisk
FRM: 1
FE: 1

Class: sf manticore
FRM: 1
FE: 1

Class: sf aeshma
FRM: 1
FE: 1

Class: sf mara
FRM: 1
FE: 1

Class: sf astaroth
FRM: 1
FE: 1

Class: sb nephilim
FRM: 1
FE: 1

Class: sb taurvi
FRM: 1
FE: 1

Class: sb nahema
FRM: 1
FE: 1

Class: sb seraphim
FRM: 1
FE: 1

Class: st azrael
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 6

Class: sfr dis
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 6
BE: 0.45
BEDu: 5000
BEDM: 2.5

Class: sac 3
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 6
BE: 0.4
BEDu: 4000
BEDM: 2.5

Class: sfr mephisto
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 6

Class: sc 5
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 1

Class: sfr asmodeus
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 6
BE: 0.45
BEDu: 5000
BEDM: 2.5

Class: sac 2
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 1

Class: sc lilith
DRM: 0.25
DE: 2
DM: 1
FRM: 2
FE: 6
BE: 0.6
BEDu: 8000
BEDM: 2.5

Class: sc rakshasa
DRM: 0.25
DE: 2
DM: 1
FRM: 2
FE: 6
BE: 0.6
BEDu: 8000
BEDM: 2.5

Class: sd demon
DRM: 0.25
DE: 2
DM: 1
FRM: 2
FE: 6
BE: 0.7
BEDu: 10000
BEDM: 2.5

Class: sd ravana
DRM: 0.25
DE: 2
DM: 1
FRM: 2
FE: 6
BE: 0.7
BEDu: 10000
BEDM: 2.5

Class: sd lucifer
DRM: 0.25
DE: 2
DM: 1
FRM: 2
FE: 6
BE: 0.7
BEDu: 10000
BEDM: 2.5

Class: ssg trident
FRM: 1
FE: 1

Class: ssg belial
FRM: 1
FE: 1

Class: ssg rahu
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 6
BE: 0.55
BEDu: 7000
BEDM: 2.5

Class: scv moloch
DRM: 0.25
DE: 2
DM: 1
FRM: 2
FE: 6
BE: 0.65
BEDu: 9000
BEDM: 2.5

Class: sj sathanas
DRM: 0.25
DE: 2
DM: 1
FRM: 5
FE: 6
BE: 0.75
BEDu: 11000
BEDM: 2.5

Class: shivan comm node
DRM: 0.25
DE: 2
DM: 1
FRM: 1
FE: 6
BE: 0.65
BEDu: 9000
BEDM: 2.5

Class: sred
BEI: 0.2
BEDu: 200
BEDi: 100

Class: lred
BEI: 0.2
BEDu: 600
BEDi: 300

Class: bfred
BEI: 0.2
BEDu: 2100
BEDi: 1050

Class: terslash
BEI: 0.2
BEDu: 350
BEDi: 175

Class: lterslash
BEI: 0.2
BEDu: 150
BEDi: 75

Class: bfgreen
BEI: 0.2
BEDu: 1900
BEDi: 950

Class: lrbgreen
BEI: 0.2
BEDu: 1900
BEDi: 950

Class: bgreen
BEI: 0.2
BEDu: 1200
BEDi: 650

Class: sgreen
BEI: 0.2
BEDu: 210
BEDi: 105

Class: svas
BEI: 0.2
BEDu: 350
BEDi: 175

Class: bvas
BEI: 0.2
BEDu: 1100
BEDi: 550

Class: vslash
BEI: 0.2
BEDu: 750
BEDi: 375

Class: green beam
BEI: 0.2
BEDu: 200
BEDi: 100

Class: mjolnirbeam
BEI: 0.2
BEDu: 750
BEDi: 375

Class: mjolnirbeam#home
BEI: 0.2
BEDu: 400
BEDi: 200

Class: cyclops
FR: 100
FE: 6
BEI: 0.6
BEDu: 2000
BEDi: 1000

Class: cyclops#short
FR: 100
FE: 6
BEI: 0.6
BEDu: 2000
BEDi: 1000

Class: rebel bomb
FR: 100
FE: 6
BEI: 0.6
BEDu: 400
BEDi: 200

Class: helios
FR: 100
FE: 6
BEI: 0.6
BEDu: 6800
BEDi: 3400

Class: unknown bomb
FR: 100
FE: 6
BEI: 0.6
BEDu: 1500
BEDi: 750

Class: unknown megabomb
FR: 100
FE: 6
BEI: 0.6
BEDu: 3200
BEDi: 1600

Class: shivan bomb
FR: 100
FE: 6
BEI: 0.6
BEDu: 2000
BEDi: 1000

Class: shivan bomb#short
FR: 100
FE: 6
BEI: 0.6
BEDu: 2000
BEDi: 1000

Class: shivan weak bomb
FR: 100
FE: 6
BEI: 0.6
BEDu: 400
BEDi: 200

Class: shivan megabomb
FR: 100
FE: 6
BEI: 0.6
BEDu: 6800
BEDi: 3400

Class: fusion mortar
FR: 20
FE: 6
BEI: 0.2
BEDu: 80
BEDi: 40

Class: vasudan flux cannon
FR: 20
FE: 6
BEI: 0.4
BEDu: 500
BEDi: 250
Received post for event GS_EVENT_START_BRIEFING during state transtition. Find Allender if you are unsure if this is bad.
Got event GS_EVENT_START_BRIEFING (15) in state GS_STATE_START_GAME (52)
ANI 2_BriefMap with size 918x400 (21.9% wasted)
ANI iconwing01 with size 32x28 (12.5% wasted)
Loading model 'fighter07.pof'
IBX: Found a good IBX to read for 'fighter07.pof'.
IBX-DEBUG => POF checksum: 0x14e1c998, IBX checksum: 0xd6efa7b5 -- "fighter07.pof"
Submodel 'fighter07b' is detail level 1 of 'fighter07a'
Submodel 'fighter07c' is detail level 2 of 'fighter07a'
Submodel 'fighter07d' is detail level 3 of 'fighter07a'
Loading model 'fighter08.pof'
Potential problem found: Unrecognized subsystem type 'ABFlaps', believed to be in ship fighter08.pof
IBX: Found a good IBX to read for 'fighter08.pof'.
IBX-DEBUG => POF checksum: 0xa3d1fd3f, IBX checksum: 0x42c4ab5b -- "fighter08.pof"
Loading model 'fighter09.pof'
IBX: Found a good IBX to read for 'fighter09.pof'.
IBX-DEBUG => POF checksum: 0x0f31635c, IBX checksum: 0x9d8a4efa -- "fighter09.pof"
ANI iconSD4 with size 56x24 (25.0% wasted)
ANI iconScalpel with size 56x24 (25.0% wasted)
ANI iconflail with size 56x24 (25.0% wasted)
ANI iconPromR with size 56x24 (25.0% wasted)
ANI iconPromS with size 56x24 (25.0% wasted)
ANI iconNewton with size 56x24 (25.0% wasted)
ANI iconLich with size 56x24 (25.0% wasted)
Loading model 'tempest_tech.pof'
IBX: Found a good IBX to read for 'tempest_tech.pof'.
IBX-DEBUG => POF checksum: 0x457ab425, IBX checksum: 0xc444d920 -- "tempest_tech.pof"
Loading model 'newhornet_tech.pof'
IBX: Found a good IBX to read for 'newhornet_tech.pof'.
IBX-DEBUG => POF checksum: 0xe97f1fa7, IBX checksum: 0xb0958a83 -- "newhornet_tech.pof"
Loading model 'crossbow_tech.pof'
IBX: Found a good IBX to read for 'crossbow_tech.pof'.
IBX-DEBUG => POF checksum: 0x3c2d3c20, IBX checksum: 0xe793cd75 -- "crossbow_tech.pof"
Loading model 'piranha_tech.pof'
IBX: Found a good IBX to read for 'piranha_tech.pof'.
IBX-DEBUG => POF checksum: 0x4334dee5, IBX checksum: 0x389c84be -- "piranha_tech.pof"
Loading model 'stilettoII_tech.pof'
IBX: Found a good IBX to read for 'stilettoII_tech.pof'.
IBX-DEBUG => POF checksum: 0xf50214c4, IBX checksum: 0xc31b26fb -- "stilettoII_tech.pof"
ANI iconS-super with size 200x89 (30.5% wasted)
ANI fadeiconS-super with size 200x89 (30.5% wasted)
ANI fadeiconS-super.ani with size 200x89 (30.5% wasted)
ANI icons-cruiser with size 70x28 (12.5% wasted)
ANI Fadeicons-cruiser with size 70x28 (12.5% wasted)
ANI Fadeicons-cruiser.ani with size 70x28 (12.5% wasted)
ANI icons-fighterW with size 59x40 (37.5% wasted)
ANI Fadeicons-FighterW with size 59x40 (37.5% wasted)
ANI Fadeicons-FighterW.ani with size 59x40 (37.5% wasted)
ANI iconv-bomberW with size 71x82 (35.9% wasted)
ANI Fadeiconv-BomberW with size 71x82 (35.9% wasted)
ANI Fadeiconv-BomberW.ani with size 71x82 (35.9% wasted)
ANI iconhighlight03 with size 270x270 (47.3% wasted)
ANI iconhighlight03.ani with size 270x270 (47.3% wasted)
Frame  0 too long!!: frametime = 31.641 (31.641)
ANI iconS-super.ani with size 200x89 (30.5% wasted)
Got event GS_EVENT_ENTER_GAME (2) in state GS_STATE_BRIEFING (10)
Entering game at time =  44.037
Regenerating local nebula!
ANI Head-VP1a.ani with size 160x120 (6.3% wasted)
ANI Head-CM2b.ani with size 160x120 (6.3% wasted)
Got event GS_EVENT_END_GAME (4) in state GS_STATE_GAME_PLAY (2)
SOUND: d:\scp\builds\antipodes\code\sound\ds.cpp:1291 - OpenAL error = 'Invalid Operation'
Unloading in mission messages
Got event GS_EVENT_QUIT_GAME (5) in state GS_STATE_MAIN_MENU (1)
Freeing all existing models...
... Log closed, Sun Dec 05 16:07:12 2010
Title: Re: Shaders for the MediaVPs
Post by: The E on December 05, 2010, 05:30:03 pm
No, this has nothing to do with Unreal.

It might have something to do with that cockpitmod thing. Does the cockpitmod include an alternate version of the tauret model? How does the cockpitmod alter the tauret tbl entry?

Title: Re: Shaders for the MediaVPs
Post by: rscaper1070 on December 05, 2010, 06:02:52 pm
No, the only things in cockpit mod are Terran pofs from the AoA cockpit pack. Just to be sure I removed Cockpit mod and nothing changed.
Title: Re: Shaders for the MediaVPs
Post by: The E on December 05, 2010, 06:06:45 pm
Code: [Select]
Searching root pack 'C:\Games\FreeSpace2\mediavps_3612\MV_Assets.vp' ... 1527 files
Searching root pack 'C:\Games\FreeSpace2\mediavps_3612\MV_Effects.vp' ... 1876 files
Searching root pack 'C:\Games\FreeSpace2\mediavps_3612\MV_Root.vp' ... 94 files

These files are corrupted and need to be replaced.
Title: Re: Shaders for the MediaVPs
Post by: rscaper1070 on December 06, 2010, 12:30:20 am
Well I redownloaded the files you suggested and the problem with the Tauret remains. The game plays fine though. The white boxes came back so I installed the older 10-10 ATI drivers and that fixed it.
Title: Re: Shaders for the MediaVPs
Post by: The E on April 06, 2011, 12:33:31 pm
The render engine improvements discussion has been split out and moved here: http://www.hard-light.net/forums/index.php?topic=75502.0
Title: Re: Shaders for the MediaVPs
Post by: Kolgena on May 18, 2011, 03:35:51 pm
Does -spec_exp still do anything under these shaders? I tried 0, 2, and 994, and they all look pretty identical to me in the ship lab. (I'm assuming the sun light actually listens to the flag)
Title: Re: Shaders for the MediaVPs
Post by: Zacam on May 18, 2011, 06:48:57 pm

-spec_exp does indeed work, but you'll want to re-read the Wiki on that one.

-spec_static is what controls the lighting from Suns. And it won't show nearly as much in the Lab as the Lab isn't lit by a "Sun" (afaik).
Title: Re: Shaders for the MediaVPs
Post by: Kolgena on May 18, 2011, 09:15:00 pm
Oh, I meant exactly that. I checked via the ship lab, which I was aware is a sun.

The sun's spot sizes didn't show much change, which is why I asked.
Title: Re: Shaders for the MediaVPs
Post by: The E on May 30, 2011, 05:47:03 am
Uhh, no. The light in the lab is NOT a sun. It's just a light.
Title: Re: Shaders for the MediaVPs
Post by: Kolgena on June 27, 2011, 10:51:13 pm
Now, I could be wrong, but are multiple lights supposed to be able to react with normal maps? I remember back when the shaders were standalone effect files, that such was the case. Explosions would show normal map detail, and everything was dazzling.

I think at some point the nightlies had the shaders integrated into them, so I thought that it would be okay to get rid of the standalone shaders if I am using the latest nightly. Now, I could be wrong, and my eyes are just tired (or my lighting settings are poor) but as of right now, weapons light and explosions don't seem to affect the normal map. They're using the old interpolation-between-vertex lighting model that we had before.

Anyone else notice this?

Attached are two examples. Look especially at the ship hull at the left of the image, but also at the Karunas.

[attachment deleted by ninja]
Title: Re: Shaders for the MediaVPs
Post by: chief1983 on June 27, 2011, 11:32:05 pm
Can you post a debug log from a run where this would happen?  Also, do they seem to be working elsewhere, in the ship lab, etc?
Title: Re: Shaders for the MediaVPs
Post by: Kolgena on June 27, 2011, 11:39:56 pm
Well, I put these files back in the effects folder, and this is what it looks like now (back to fragment lighting with normal maps). Clearly a huge difference, so something's up.

main-f.sdr
Code: [Select]
#ifdef FLAG_LIGHT
uniform int n_lights;
#endif

#ifdef FLAG_DIFFUSE_MAP
uniform sampler2D sBasemap;
#endif

#ifdef FLAG_GLOW_MAP
uniform sampler2D sGlowmap;
#endif

#ifdef FLAG_SPEC_MAP
uniform sampler2D sSpecmap;
#endif

#ifdef FLAG_ENV_MAP
uniform samplerCube sEnvmap;
uniform bool alpha_spec;
varying vec3 envReflect;
#endif

#ifdef FLAG_NORMAL_MAP
uniform sampler2D sNormalmap;
varying mat3 tbnMatrix;
#endif

#ifdef FLAG_FOG
varying float fogDist;
#endif

varying vec4 position;
varying vec3 lNormal;

#if SHADER_MODEL == 2
  #define MAX_LIGHTS 2
#else
  #define MAX_LIGHTS 8
#endif

#define SPEC_INTENSITY_POINT 4.3 // Point light
#define SPEC_INTENSITY_DIRECTIONAL 1.5 // Directional light
#define SPECULAR_FACTOR 1.75
#define SPECULAR_ALPHA 0.1
#define SPEC_FACTOR_NO_SPEC_MAP 0.6
#define ENV_ALPHA_FACTOR 0.3
#define GLOW_MAP_INTENSITY 1.5
#define AMBIENT_LIGHT_BOOST 1.0

void main()
{
vec3 eyeDir = vec3(normalize(-position).xyz); // Camera is at (0,0,0) in ModelView space
vec4 lightAmbientDiffuse = vec4(0.0, 0.0, 0.0, 1.0);
vec4 lightDiffuse = vec4(0.0, 0.0, 0.0, 1.0);
vec4 lightAmbient = vec4(0.0, 0.0, 0.0, 1.0);
vec4 lightSpecular = vec4(0.0, 0.0, 0.0, 1.0);
vec2 texCoord = gl_TexCoord[0].xy;

 #ifdef FLAG_LIGHT
  #ifdef FLAG_NORMAL_MAP
// Normal map - convert from DXT5nm
vec3 normal;
normal.rg = (texture2D(sNormalmap, texCoord).ag * 2.0) - 1.0;
normal.b = sqrt(1.0 - dot(normal.rg, normal.rg));
normal = normalize(tbnMatrix * normal);
  #else
vec3 normal = lNormal;
  #endif

vec3 lightDir;
lightAmbient = gl_FrontMaterial.emission + (gl_LightModel.ambient * gl_FrontMaterial.ambient);

#pragma optionNV unroll all
for (int i = 0; i < MAX_LIGHTS; ++i) {
  #if SHADER_MODEL > 2
if (i > n_lights)
break;
  #endif
float specularIntensity = 1.0;
float attenuation = 1.0;

// Attenuation and light direction
  #if SHADER_MODEL > 2
if (gl_LightSource[i].position.w == 1.0) {
  #else
if (gl_LightSource[i].position.w == 1.0 && i != 0) {
  #endif
// Positional light source
float dist = distance(gl_LightSource[i].position.xyz, position.xyz);

float spotEffect = 1.0;

attenuation = spotEffect / (gl_LightSource[i].constantAttenuation + (gl_LightSource[i].linearAttenuation * dist) + (gl_LightSource[i].quadraticAttenuation * dist * dist));

lightDir = normalize(gl_LightSource[i].position.xyz - position.xyz);

specularIntensity = SPEC_INTENSITY_POINT; // Point light
} else {
// Directional light source
lightDir = normalize(gl_LightSource[i].position.xyz);

specularIntensity = SPEC_INTENSITY_DIRECTIONAL; // Directional light
}

// Ambient and Diffuse
lightAmbient += (gl_FrontLightProduct[i].ambient * attenuation);
lightDiffuse += ((gl_FrontLightProduct[i].diffuse * max(dot(normal, lightDir), 0.0)) * attenuation);

// Specular
float NdotHV = clamp(dot(normal, normalize(eyeDir + lightDir)), 0.0, 1.0);
lightSpecular += ((gl_FrontLightProduct[i].specular * pow(max(0.0, NdotHV), gl_FrontMaterial.shininess)) * attenuation) * specularIntensity;
}

lightAmbientDiffuse = lightAmbient + lightDiffuse;
 #else
lightAmbientDiffuse = gl_Color;
lightSpecular = gl_SecondaryColor;
 #endif

 #ifdef FLAG_DIFFUSE_MAP
 // Base color
vec4 baseColor = texture2D(sBasemap, texCoord);
 #else
vec4 baseColor = gl_Color;
 #endif
 
vec4 fragmentColor;
fragmentColor.rgb = baseColor.rgb * max(lightAmbientDiffuse.rgb * AMBIENT_LIGHT_BOOST, gl_LightModel.ambient.rgb - 0.425);
fragmentColor.a = baseColor.a;

 #ifdef FLAG_SPEC_MAP
 // Spec color
fragmentColor.rgb += lightSpecular.rgb * (texture2D(sSpecmap, texCoord).rgb * SPECULAR_FACTOR);
fragmentColor.a += (dot(lightSpecular.a, lightSpecular.a) * SPECULAR_ALPHA);
 #else
fragmentColor.rgb += lightSpecular.rgb * (baseColor.rgb * SPEC_FACTOR_NO_SPEC_MAP);
 #endif

 #ifdef FLAG_ENV_MAP
 // Env color
vec3 envIntensity = (alpha_spec) ? vec3(texture2D(sSpecmap, texCoord).a) : texture2D(sSpecmap, texCoord).rgb;
fragmentColor.a += (dot(textureCube(sEnvmap, envReflect).rgb, textureCube(sEnvmap, envReflect).rgb) * ENV_ALPHA_FACTOR);
fragmentColor.rgb += textureCube(sEnvmap, envReflect).rgb * envIntensity;
 #endif

 #ifdef FLAG_GLOW_MAP
 // Glow color
fragmentColor.rgb += texture2D(sGlowmap, texCoord).rgb * GLOW_MAP_INTENSITY;
 #endif

 #ifdef FLAG_FOG
fragmentColor.rgb = mix(fragmentColor.rgb, gl_Fog.color.rgb, fogDist);
 #endif

gl_FragColor = fragmentColor;
}

main-v.sdr
Code: [Select]
#ifdef FLAG_ENV_MAP
uniform mat4 envMatrix;
varying vec3 envReflect;
#endif

#ifdef FLAG_NORMAL_MAP
varying mat3 tbnMatrix;
#endif

#ifdef FLAG_FOG
varying float fogDist;
#endif

varying vec4 position;
varying vec3 lNormal;

void main()
{
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_Position = ftransform();
gl_FrontColor = gl_Color;
gl_FrontSecondaryColor = vec4(0.0, 0.0, 0.0, 1.0);

 // Transform the normal into eye space and normalize the result.
position = gl_ModelViewMatrix * gl_Vertex;
vec3 normal = normalize(gl_NormalMatrix * gl_Normal);
lNormal = normal;

 #ifdef FLAG_NORMAL_MAP
 // Setup stuff for normal maps
vec3 t = normalize(gl_NormalMatrix * gl_MultiTexCoord1.xyz);
vec3 b = cross(normal, t) * gl_MultiTexCoord1.w;
tbnMatrix = mat3(t, b, normal);
 #endif

 #ifdef FLAG_ENV_MAP
 // Environment mapping reflection vector.
envReflect = reflect(position.xyz, normal);
envReflect = vec3(envMatrix * vec4(envReflect, 0.0));
envReflect = normalize(envReflect);
 #endif

 #ifdef FLAG_FOG
fogDist = clamp((gl_Position.z - gl_Fog.start) * 0.75 * gl_Fog.scale, 0.0, 1.0);
 #endif

 #ifdef __GLSL_CG_DATA_TYPES
 // Check necessary for ATI specific behavior
gl_ClipVertex = (gl_ModelViewMatrix * gl_Vertex);
 #endif
}


Now with Debug log WITHOUT the shaders in effects.

[attachment deleted by ninja]
Title: Re: Shaders for the MediaVPs
Post by: The E on June 28, 2011, 03:47:08 am
Given that the shaders in the exe are identical to the shaders you posted here, I have no clue what's going on. To be honest, those first screenshots posted look like they do not have any normal mapping active at all, which is a bit baffling.

Also, if you removed the custom per-fragment shaders from the mediavps directory, then the exe will not fall back onto the built-in defaults, but onto the shaders in mv_root, which are still the old per-vertex shaders.
Title: Re: Shaders for the MediaVPs
Post by: Kolgena on June 28, 2011, 09:37:54 am
That's probably the explanation. I'm using the mv_root from the release thread, which I'm quite sure contains the old shaders.

If that's the case, it's probably worth mentioning to people that if they're using these shaders, that it's temporarily not okay to get rid of them without reverting.
Title: Re: Shaders for the MediaVPs
Post by: The E on June 28, 2011, 09:46:23 am
Quote from:
If that's the case, it's probably worth mentioning to people that if they're using these shaders, that it's temporarily not okay to get rid of them without reverting.

I have no idea what you said there. Seriously, no idea how to parse that sentence.
Title: Re: Shaders for the MediaVPs
Post by: Kolgena on June 28, 2011, 09:55:01 am
lol my bad.

If it's the case that having mv_root will force loading of the old shaders instead of letting the .exe use its new ones, then it's probably not good that we're giving out advice telling people that it's okay to get rid of the standalone shaders in the effects folder.

Is that somewhat better?
Title: Re: Shaders for the MediaVPs
Post by: The E on June 28, 2011, 09:59:15 am
Uhhh, no?

Remember, this is a topic for advanced modders. People who have an understanding of how FSO file loading works. People who realize that the built-in shaders are only used when no other shaders can be found.
Title: Re: Shaders for the MediaVPs
Post by: Valathil on June 29, 2011, 06:14:42 pm
So have you noticed how the environment maps on the ships are always flat on the poly's like they reflect from a perfect mirror? Really doesn't work together well with bump mapped surfaces. This is especially noticeable in mods like WoD where you have SHINY ships. So after a little tweaking from my end here is the fragment shader for environment map displacing by bump map. This looks S W E E T in WoD, just try it (PROTIP: Ray Mark 3 in F3 Lab). Feel free to use and abuse this just thought I'd pitch in with a small idea to make those sweet shaders even better. I hope I used the newest version of the shaders as a baseline but the patch is simple enough so porting it should be easy.

Code: [Select]
#ifdef FLAG_LIGHT
uniform int n_lights;
#endif

#ifdef FLAG_DIFFUSE_MAP
uniform sampler2D sBasemap;
#endif

#ifdef FLAG_GLOW_MAP
uniform sampler2D sGlowmap;
#endif

#ifdef FLAG_SPEC_MAP
uniform sampler2D sSpecmap;
#endif

#ifdef FLAG_ENV_MAP
uniform samplerCube sEnvmap;
uniform bool alpha_spec;
varying vec3 envReflect;
#endif

#ifdef FLAG_NORMAL_MAP
uniform sampler2D sNormalmap;
varying mat3 tbnMatrix;
#endif

#ifdef FLAG_FOG
varying float fogDist;
#endif

varying vec4 position;
varying vec3 lNormal;

#if SHADER_MODEL == 2
  #define MAX_LIGHTS 2
#else
  #define MAX_LIGHTS 8
#endif

#define SPEC_INTENSITY_POINT 5.3 // Point light
#define SPEC_INTENSITY_DIRECTIONAL 3.0 // Directional light
#define SPECULAR_FACTOR 1.75
#define SPECULAR_ALPHA 0.1
#define SPEC_FACTOR_NO_SPEC_MAP 0.6
#define ENV_ALPHA_FACTOR 0.3
#define GLOW_MAP_INTENSITY 1.5
#define AMBIENT_LIGHT_BOOST 1.0

void main()
{
vec3 eyeDir = vec3(normalize(-position).xyz); // Camera is at (0,0,0) in ModelView space
vec4 lightAmbientDiffuse = vec4(0.0, 0.0, 0.0, 1.0);
vec4 lightDiffuse = vec4(0.0, 0.0, 0.0, 1.0);
vec4 lightAmbient = vec4(0.0, 0.0, 0.0, 1.0);
vec4 lightSpecular = vec4(0.0, 0.0, 0.0, 1.0);
vec2 texCoord = gl_TexCoord[0].xy;

 #ifdef FLAG_LIGHT
  #ifdef FLAG_NORMAL_MAP
// Normal map - convert from DXT5nm
vec3 normal;

normal.rg = (texture2D(sNormalmap, texCoord).ag * 2.0) - 1.0;
#ifdef FLAG_ENV_MAP
vec3 envOffset;
envOffset = normal;
        #endif
        normal.b = sqrt(1.0 - dot(normal.rg, normal.rg));
    normal = normalize(tbnMatrix * normal);
  #else
vec3 normal = lNormal;
  #endif

vec3 lightDir;
lightAmbient = gl_FrontMaterial.emission + (gl_LightModel.ambient * gl_FrontMaterial.ambient);

#pragma optionNV unroll all
for (int i = 0; i < MAX_LIGHTS; ++i) {
  #if SHADER_MODEL > 2
if (i > n_lights)
break;
  #endif
float specularIntensity = 1.0;
float attenuation = 1.0;

// Attenuation and light direction
  #if SHADER_MODEL > 2
if (gl_LightSource[i].position.w == 1.0) {
  #else
if (gl_LightSource[i].position.w == 1.0 && i != 0) {
  #endif
// Positional light source
float dist = distance(gl_LightSource[i].position.xyz, position.xyz);

float spotEffect = 1.0;

  #if SHADER_MODEL > 2
if (gl_LightSource[i].spotCutoff < 91.0) {
spotEffect = dot(normalize(gl_LightSource[i].spotDirection), normalize(-position.xyz));

if (spotEffect < gl_LightSource[i].spotCosCutoff) {
spotEffect = 0.0;
}
}
  #endif

attenuation = spotEffect / (gl_LightSource[i].constantAttenuation + (gl_LightSource[i].linearAttenuation * dist) + (gl_LightSource[i].quadraticAttenuation * dist * dist));

lightDir = normalize(gl_LightSource[i].position.xyz - position.xyz);

specularIntensity = SPEC_INTENSITY_POINT; // Point light
} else {
// Directional light source
lightDir = normalize(gl_LightSource[i].position.xyz);

specularIntensity = SPEC_INTENSITY_DIRECTIONAL; // Directional light
}

// Ambient and Diffuse
lightAmbient += (gl_FrontLightProduct[i].ambient * attenuation);
lightDiffuse += ((gl_FrontLightProduct[i].diffuse * max(dot(normal, lightDir), 0.0)) * attenuation);

// Specular
float NdotHV = clamp(dot(normal, normalize(eyeDir + lightDir)), 0.0, 1.0);
lightSpecular += ((gl_FrontLightProduct[i].specular * pow(max(0.0, NdotHV), gl_FrontMaterial.shininess)) * attenuation) * specularIntensity;
}

lightAmbientDiffuse = lightAmbient + lightDiffuse;
 #else
lightAmbientDiffuse = gl_Color;
lightSpecular = gl_SecondaryColor;
 #endif

 #ifdef FLAG_DIFFUSE_MAP
 // Base color
vec4 baseColor = texture2D(sBasemap, texCoord);
 #else
vec4 baseColor = gl_Color;
 #endif
 
vec4 fragmentColor;
fragmentColor.rgb = baseColor.rgb * max(lightAmbientDiffuse.rgb * AMBIENT_LIGHT_BOOST, gl_LightModel.ambient.rgb - 0.425);
fragmentColor.a = baseColor.a;

 #ifdef FLAG_SPEC_MAP
 // Spec color
fragmentColor.rgb += lightSpecular.rgb * (texture2D(sSpecmap, texCoord).rgb * SPECULAR_FACTOR);
fragmentColor.a += (dot(lightSpecular.a, lightSpecular.a) * SPECULAR_ALPHA);
 #else
fragmentColor.rgb += lightSpecular.rgb * (baseColor.rgb * SPEC_FACTOR_NO_SPEC_MAP);
 #endif

 #ifdef FLAG_ENV_MAP
 // Env color
  #ifdef FLAG_NORMAL_MAP
envReflect += envOffset;
  #endif
vec3 envIntensity = (alpha_spec) ? vec3(texture2D(sSpecmap, texCoord).a) : texture2D(sSpecmap, texCoord).rgb;
fragmentColor.a += (dot(textureCube(sEnvmap, envReflect).rgb, textureCube(sEnvmap, envReflect).rgb) * ENV_ALPHA_FACTOR);
fragmentColor.rgb += textureCube(sEnvmap, envReflect).rgb * envIntensity;
 #endif

 #ifdef FLAG_GLOW_MAP
 // Glow color
fragmentColor.rgb += texture2D(sGlowmap, texCoord).rgb * GLOW_MAP_INTENSITY;
 #endif

 #ifdef FLAG_FOG
fragmentColor.rgb = mix(fragmentColor.rgb, gl_Fog.color.rgb, fogDist);
 #endif

gl_FragColor = fragmentColor;
}
Title: Re: Shaders for the MediaVPs
Post by: Kolgena on June 29, 2011, 09:19:19 pm
Epic first post. Welcome to HLP! (Though clearly you've been lurking for some time :))

I assume this is a drop-in replacement for main-f.sdr?
Title: Re: Shaders for the MediaVPs
Post by: Valathil on June 29, 2011, 11:59:34 pm
Yes exactly this is main-f.sdr. BTW just throwing something out there, has anyone thought of encoding the light information in a small texture instead of the built in opengl lights to overcome the 8 lights limit? I don't know how many lights there are at average in a scene and anything over 20 or 30 will eventually overwhelm the rendering and slow everything to crawl but seeing that there are always new and better gpu's coming out wouldn't a framework to enable an arbitrary number of lights be a step into the future? Would of course require a rewrite of the lighting subsystem to encode the lightdata. Don't know if I have the time for that. Would like to hear some brainstorming about possible performance and if such a feature would be welcome.

P.S.: Lurking is my speciality  :D And then out of nowhere BOOM  :eek2: epic
Title: Re: Shaders for the MediaVPs
Post by: Sushi on June 30, 2011, 12:45:42 am
if such a feature would be welcome.

Let's just say that people would probably be naming their babies after you.

Creating light-maps is an idea that's been kicked around a bit, but nobody has taken the time to figure out how to make it work.
Title: Re: Shaders for the MediaVPs
Post by: The E on June 30, 2011, 01:31:56 am
Well, I'd love to get a better/faster light handling code. The engine keeps track of up to 256 light sources, I'd really like to see more than 8 of them.

EDIT: That shader of yours has a syntax error, causing it to fail on Radeons. It should also fail on GeForces, so what did you test it on?

To elaborate, you treated envReflect (a varying vec3) as a normal variable, which will fail according to the GLSL spec (varying variables are treated as runtime constants).

Here's a corrected version:
Code: [Select]
#ifdef FLAG_LIGHT
uniform int n_lights;
#endif

#ifdef FLAG_DIFFUSE_MAP
uniform sampler2D sBasemap;
#endif

#ifdef FLAG_GLOW_MAP
uniform sampler2D sGlowmap;
#endif

#ifdef FLAG_SPEC_MAP
uniform sampler2D sSpecmap;
#endif

#ifdef FLAG_ENV_MAP
uniform samplerCube sEnvmap;
uniform bool alpha_spec;
varying vec3 envReflect;
#endif

#ifdef FLAG_NORMAL_MAP
uniform sampler2D sNormalmap;
varying mat3 tbnMatrix;
#endif

#ifdef FLAG_FOG
varying float fogDist;
#endif

varying vec4 position;
varying vec3 lNormal;

#if SHADER_MODEL == 2
  #define MAX_LIGHTS 2
#else
  #define MAX_LIGHTS 8
#endif

#define SPEC_INTENSITY_POINT 5.3 // Point light
#define SPEC_INTENSITY_DIRECTIONAL 3.0 // Directional light
#define SPECULAR_FACTOR 1.75
#define SPECULAR_ALPHA 0.1
#define SPEC_FACTOR_NO_SPEC_MAP 0.6
#define ENV_ALPHA_FACTOR 0.3
#define GLOW_MAP_INTENSITY 1.5
#define AMBIENT_LIGHT_BOOST 1.0

void main()
{
vec3 eyeDir = vec3(normalize(-position).xyz); // Camera is at (0,0,0) in ModelView space
vec4 lightAmbientDiffuse = vec4(0.0, 0.0, 0.0, 1.0);
vec4 lightDiffuse = vec4(0.0, 0.0, 0.0, 1.0);
vec4 lightAmbient = vec4(0.0, 0.0, 0.0, 1.0);
vec4 lightSpecular = vec4(0.0, 0.0, 0.0, 1.0);
vec2 texCoord = gl_TexCoord[0].xy;

 #ifdef FLAG_LIGHT
  #ifdef FLAG_NORMAL_MAP
// Normal map - convert from DXT5nm
vec3 normal;

normal.rg = (texture2D(sNormalmap, texCoord).ag * 2.0) - 1.0;
  #ifdef FLAG_ENV_MAP
vec3 envOffset;
envOffset = normal;
  #endif
normal.b = sqrt(1.0 - dot(normal.rg, normal.rg));
normal = normalize(tbnMatrix * normal);
  #else
vec3 normal = lNormal;
  #endif

vec3 lightDir;
lightAmbient = gl_FrontMaterial.emission + (gl_LightModel.ambient * gl_FrontMaterial.ambient);

#pragma optionNV unroll all
for (int i = 0; i < MAX_LIGHTS; ++i) {
  #if SHADER_MODEL > 2
if (i > n_lights)
break;
  #endif
float specularIntensity = 1.0;
float attenuation = 1.0;

// Attenuation and light direction
  #if SHADER_MODEL > 2
if (gl_LightSource[i].position.w == 1.0) {
  #else
if (gl_LightSource[i].position.w == 1.0 && i != 0) {
  #endif
// Positional light source
float dist = distance(gl_LightSource[i].position.xyz, position.xyz);

float spotEffect = 1.0;

  #if SHADER_MODEL > 2
if (gl_LightSource[i].spotCutoff < 91.0) {
spotEffect = dot(normalize(gl_LightSource[i].spotDirection), normalize(-position.xyz));

if (spotEffect < gl_LightSource[i].spotCosCutoff) {
spotEffect = 0.0;
}
}
  #endif

attenuation = spotEffect / (gl_LightSource[i].constantAttenuation + (gl_LightSource[i].linearAttenuation * dist) + (gl_LightSource[i].quadraticAttenuation * dist * dist));

lightDir = normalize(gl_LightSource[i].position.xyz - position.xyz);

specularIntensity = SPEC_INTENSITY_POINT; // Point light
} else {
// Directional light source
lightDir = normalize(gl_LightSource[i].position.xyz);

specularIntensity = SPEC_INTENSITY_DIRECTIONAL; // Directional light
}

// Ambient and Diffuse
lightAmbient += (gl_FrontLightProduct[i].ambient * attenuation);
lightDiffuse += ((gl_FrontLightProduct[i].diffuse * max(dot(normal, lightDir), 0.0)) * attenuation);

// Specular
float NdotHV = clamp(dot(normal, normalize(eyeDir + lightDir)), 0.0, 1.0);
lightSpecular += ((gl_FrontLightProduct[i].specular * pow(max(0.0, NdotHV), gl_FrontMaterial.shininess)) * attenuation) * specularIntensity;
}

lightAmbientDiffuse = lightAmbient + lightDiffuse;
 #else
lightAmbientDiffuse = gl_Color;
lightSpecular = gl_SecondaryColor;
 #endif

 #ifdef FLAG_DIFFUSE_MAP
 // Base color
vec4 baseColor = texture2D(sBasemap, texCoord);
 #else
vec4 baseColor = gl_Color;
 #endif
 
vec4 fragmentColor;
fragmentColor.rgb = baseColor.rgb * max(lightAmbientDiffuse.rgb * AMBIENT_LIGHT_BOOST, gl_LightModel.ambient.rgb - 0.425);
fragmentColor.a = baseColor.a;

 #ifdef FLAG_SPEC_MAP
 // Spec color
fragmentColor.rgb += lightSpecular.rgb * (texture2D(sSpecmap, texCoord).rgb * SPECULAR_FACTOR);
fragmentColor.a += (dot(lightSpecular.a, lightSpecular.a) * SPECULAR_ALPHA);
 #else
fragmentColor.rgb += lightSpecular.rgb * (baseColor.rgb * SPEC_FACTOR_NO_SPEC_MAP);
 #endif

 #ifdef FLAG_ENV_MAP
 // Env color
  #ifdef FLAG_NORMAL_MAP
vec3 envReflectNM = envReflect + envOffset;
vec3 envIntensity = (alpha_spec) ? vec3(texture2D(sSpecmap, texCoord).a) : texture2D(sSpecmap, texCoord).rgb;
fragmentColor.a += (dot(textureCube(sEnvmap, envReflectNM).rgb, textureCube(sEnvmap, envReflectNM).rgb) * ENV_ALPHA_FACTOR);
fragmentColor.rgb += textureCube(sEnvmap, envReflectNM).rgb * envIntensity;
  #else
vec3 envIntensity = (alpha_spec) ? vec3(texture2D(sSpecmap, texCoord).a) : texture2D(sSpecmap, texCoord).rgb;
fragmentColor.a += (dot(textureCube(sEnvmap, envReflect).rgb, textureCube(sEnvmap, envReflect).rgb) * ENV_ALPHA_FACTOR);
fragmentColor.rgb += textureCube(sEnvmap, envReflect).rgb * envIntensity;
  #endif
 #endif

 #ifdef FLAG_GLOW_MAP
 // Glow color
fragmentColor.rgb += texture2D(sGlowmap, texCoord).rgb * GLOW_MAP_INTENSITY;
 #endif

 #ifdef FLAG_FOG
fragmentColor.rgb = mix(fragmentColor.rgb, gl_Fog.color.rgb, fogDist);
 #endif

gl_FragColor = fragmentColor;
}
Title: Re: Shaders for the MediaVPs
Post by: Valathil on June 30, 2011, 04:51:04 am
Yeah well the last time I programmed shaders was like 10 years ago or so  :lol:. Tested it on a Geforce 260 with the 275.50 beta drivers. Dont know why it runs while it shouldn't  :rolleyes:. Thanks for the fix!
Quote
Creating light-maps is an idea that's been kicked around a bit, but nobody has taken the time to figure out how to make it work.

Can you elaborate on the light-maps I think you mean something different than me. A lightmap as is understand it would be additional rendering passes that generate the lit texture by accumulating the many ligths in a off screen framebuffer and then the final rendering pass puts the ship on the screen with the precalculated texture applied. I on the other hand would propose to send the parameters of the lights encoded in the rgba channels of a non filtered texture and then iterating over the lights in the shader. However i dont know how feasible such a technique would be and if there would be any performance issues e.g. the gpu cant calculate all lights parallel in the stream processors or other problems i cant imagine, its just an idea that popped into my head. As I said before the last time I did anything in OpenGL and shaders was a long time ago.
Title: Re: Shaders for the MediaVPs
Post by: The E on June 30, 2011, 05:12:21 am
Well, lightmaps as canonically defined are a rather obsolete technique, and one I don't think is very applicable to FSO, given that we do not have any static geometry whatsoever.

The only way I know of to realistically render more lights is to switch FSO to a deferred rendering setup, but that would mean a complete revamp of the render architecture, something that I for one am not knowledgable enough to do.

I do have trouble understanding your proposed way of doing it though. It sounds like a deferred rendering setup in which you have a render pass dedicated to rendering only lights, another to rendering textures, and a final one to composite it all together.
Title: Re: Shaders for the MediaVPs
Post by: Zacam on June 30, 2011, 05:28:50 am
P.S.: Lurking is my speciality  :D And then out of nowhere BOOM  :eek2: epic

Epic, indeed. This has brought a HUGE ass grin to my face and my profuse thanks! You ever have another idea like this, don't be shy about speaking up on it.

Just...wow. I didn't even really think about that as being a "problem" or something that I even noticed, but now I just can't not see it anymore, and this makes a HUGE amount of difference, for being so small a change.

Though, here is one that has been plaguing me for a while. On SM2.0 cards, because we use n_lights in the engine (and they don't get that so well, apparently) we get weapons effects "sticking around" long after they should and they end up "painting" the POV on to other objects that have reflected the weapons effect "light". Now, I'm pretty sure there is a way around that, but I'm afraid it means manually unrolling our loops to handle. If you can estimate that at all and chime in some feedback, that would be awesome.

If not, then no worries, this is definitely a "made my day" first post if ever there was one.
Title: Re: Shaders for the MediaVPs
Post by: The E on June 30, 2011, 05:53:57 am
And yeah, this little fix will be in the next MediaVPs.
Title: Re: Shaders for the MediaVPs
Post by: Valathil on June 30, 2011, 07:24:36 am
Well, lightmaps as canonically defined are a rather obsolete technique, and one I don't think is very applicable to FSO, given that we do not have any static geometry whatsoever.

The only way I know of to realistically render more lights is to switch FSO to a deferred rendering setup, but that would mean a complete revamp of the render architecture, something that I for one am not knowledgable enough to do.

I do have trouble understanding your proposed way of doing it though. It sounds like a deferred rendering setup in which you have a render pass dedicated to rendering only lights, another to rendering textures, and a final one to composite it all together.

Let me try to explain differently: When you pass the 8 lights to the shader file they are an array right? Well an array is nothing more than a consecutive stream of certain data types e.g. floats or integer. And what is a texture? A consecutive stream of color information bytes so its like an array in a way. So what if we can put the data that we normally send via array gets sent via a texture instead. That would result in an array that is a size of our choosing not limited to 8 entries. And while you address an array with its index you adress a texture with texture coordinates. So you can take a loop that iterates over 0 to MAX_LIGHTS(whatever that may be then e.g. 256 per engine limitations) and generate texture coordinates to lookup the light parameters inside the texture that stores the lights. This texture is of course generated every frame to update the changing lights in the scene. But I wouldn't call this "rendering" per se, it's more of a memory copy operation (optimizable by directly storing the lights as the shader required format in the first place inside a byte array that gets sent as the texture). However as said before there are many issues that are not fully explored with that setup. I dont know if floating point textures are even possible given that the light coordinates and so on are probably floats so there would be a problem of accuracy when converting to fixed point if its just 8 bits per channel ( that would look craptastic  :D imagine the whole space in a mission with just 256 possible positions in all 3 dimensions). I really haven't kept up with the times in rendering API capabilities. So again no guarantees or anything just a brainfart that shot through me as I read the 8 lights limitation thing.

Quote
Though, here is one that has been plaguing me for a while. On SM2.0 cards, because we use n_lights in the engine (and they don't get that so well, apparently) we get weapons effects "sticking around" long after they should and they end up "painting" the POV on to other objects that have reflected the weapons effect "light". Now, I'm pretty sure there is a way around that, but I'm afraid it means manually unrolling our loops to handle. If you can estimate that at all and chime in some feedback, that would be awesome.

This should be fixable in C by setting the color of "expired" lights to 0.0.0 (black).
Title: Re: Shaders for the MediaVPs
Post by: The E on June 30, 2011, 07:40:48 am
Problem is, a light needs more than the 4 pieces of information a texture can hold. Let's see, just off the top of my head, you need:

--Light coordinates (for positional lights)/Light direction (for directional lights)
--Colour value (rgb + intensity)
--Attenuation information

It's a lot of data to cram into a texture. While you can do it by using adjacent fields to store all that info, you need to keep in mind that in order to look up the info required you'd need at least <Number of lights in scene>*3 texture lookups, which are expensive as ****.

Not to mention that you'd lock up one precious TMU for that light texture. Given that on a full, all-bells-and-whistles render pass you already need at least 5, (6 if someone were to finish a height map implementation), you'll get awfully close to the 8 you can safely use.
Title: Re: Shaders for the MediaVPs
Post by: Valathil on June 30, 2011, 08:05:06 am
See thats what I was "hoping" for. Information about TMU limitations and the required lightsource data. Yeah right I remember, lookups ARE expensive  :mad:. Ok so i realize im the newbie here and this will probably be something you thought of already but I'll just throw it out there. What about passing the lights as uniforms checking with the vertex shader if this light source is worth rendering and then process them in the fragment shader or is there a limitation of how many uniforms can be passed as well?  :shaking:.
Title: Re: Shaders for the MediaVPs
Post by: The E on June 30, 2011, 08:16:06 am
Well, we already do sort lights as best we can. Given that the engine renders each object seprately, we can adjust the number of lights dynamically to use the 8 "most significant" lights for that object.

Regarding limits for uniforms, yes they exist. They are largely implementation-dependant (That is, you have to consult your GPU manufacturer for the data). On my Radeon Mobile 5470, the maximum amount of uniforms to be passed is 4096. Note that a single float/int/bool/whatever takes one slot, a vec2 takes 2, a vec3 3, a mat4 16, and so on.

OpenGL Caps Viewer and OpenGL Extensions Viewer are invaluable tools to figure this stuff out.

Ultimately, defining your own light structs is one step that you'd have to do when doing a deferred renderer.
Title: Re: Shaders for the MediaVPs
Post by: Valathil on June 30, 2011, 08:40:10 am
Well, we already do sort lights as best we can. Given that the engine renders each object seprately, we can adjust the number of lights dynamically to use the 8 "most significant" lights for that object.

Yes I looked at that on the SVN. You sort by intensity and attenuation I cant come up with anything better than that. But if we assume for a moment that we are allowed more than 8 lights by passing them to the shader by uniforms ( sort of like lets try 32 lights  4 pos + 4 dir + 3 color + 3 attenuation * 32 = 448 well within limits) sorting isn't going to cut it performance wise. I think we need to think about eliminating lights that are not contributing to the lighting on a per polygon basis. The models are based on BSP trees so there aren't any back face polygons present as I understand it. This means that by calculating based on light position, direction and vertex position and normal it should be possible to figure out on which side the light is on on a per vertex basis. We can then eliminate the light from rendering simply because the polygon faces the wrong way which is now handled as I saw it in the fragment shader on a per pixel basis. On average half of the polygons of a model are facing away from the light anyway which should eliminate on average 16 lights so were down to double the fragement shader load. this of course can be done with 16 so were back to 8 to conserve performance for now. However more lights are even considered for inclusion because there is not a 8 limit upfront which should reduce lights flickering on and off. What would be great to know would be an average number of active lights in a normal combat situation ( not a BoE).

EDIT: I consider the texture idea dead this is a whole other idea 
Title: Re: Shaders for the MediaVPs
Post by: The E on June 30, 2011, 08:57:15 am
Well, I think you could do most of that in the vertex shader, given that all the data you need to do it is present there. I think you could fill up a bool array the size of MAX_LIGHTS, go through the current vertex' normal, check that against the light data, then write a true or false. In the frag shader, if bool_array[number of light you're processing] is false, skip to next light.

Should work, I think.

At any rate, I think you can't do it without defining your own light structure, which means a few changes to the rendering architecture.
Title: Re: Shaders for the MediaVPs
Post by: Valathil on June 30, 2011, 09:09:37 am
Yes a rewrite is all but inevitable but looking at the code itself it looks pretty simple and well structured. I could do some little experiments in my cave with a box of scraps and look what I can hack together. Then everybody will name their babies after me.

Let's just say that people would probably be naming their babies after you.

Even though Valathil isn't such a great name for a baby if you think about it  :pimp: and my real name is even worse.
Title: Re: Shaders for the MediaVPs
Post by: chief1983 on June 30, 2011, 09:33:02 am
When I read it, it sounds a lot like 'falafel', so yeah, bad baby name ;)

I'm interested in seeing the results of your experiment.
Title: Re: Shaders for the MediaVPs
Post by: Valathil on June 30, 2011, 09:38:09 am
Its more waalathil  (th as in theory) not wallafil  :wtf:
Title: Re: Shaders for the MediaVPs
Post by: chief1983 on June 30, 2011, 09:56:56 am
I mean not exactly like it, just kinda rhymes with it too much.
Title: Re: Shaders for the MediaVPs
Post by: Valathil on June 30, 2011, 10:07:57 am
Anyway dont name your Baby Valathil...

... or falafel

Title: Re: Shaders for the MediaVPs
Post by: chief1983 on June 30, 2011, 10:12:50 am
I actually planned on naming my baby falafel.
Title: Re: Shaders for the MediaVPs
Post by: Trivial Psychic on June 30, 2011, 08:26:07 pm
Its more waalathil  (th as in theory) not wallafil  :wtf:
Is that elvish (Token)?  How does it translate?
Title: Re: Shaders for the MediaVPs
Post by: Spoon on July 01, 2011, 06:02:10 am
So have you noticed how the environment maps on the ships are always flat on the poly's like they reflect from a perfect mirror? Really doesn't work together well with bump mapped surfaces. This is especially noticeable in mods like WoD where you have SHINY ships. So after a little tweaking from my end here is the fragment shader for environment map displacing by bump map. This looks S W E E T in WoD, just try it (PROTIP: Ray Mark 3 in F3 Lab). Feel free to use and abuse this just thought I'd pitch in with a small idea to make those sweet shaders even better. I hope I used the newest version of the shaders as a baseline but the patch is simple enough so porting it should be easy.
WoD mentioned
Could someone post a screenshot of this? I wanna see  :D

Oh and welcome to the forums, may your stay be long and productive (:
Title: Re: Shaders for the MediaVPs
Post by: Valathil on July 01, 2011, 07:24:41 am
A screenshot doesnt do it justice you have to see it animated
Title: Re: Shaders for the MediaVPs
Post by: pecenipicek on July 01, 2011, 08:09:59 am
A screenshot doesnt do it justice you have to see it animated
Quoted for great justice!
Title: Re: Shaders for the MediaVPs
Post by: Zacam on July 01, 2011, 02:37:07 pm

Anybody interested in toying around with the shaders (externally) can go ahead and grab the file from below. Most all of the recent changes will be going into a build soon anyway, but tinkering can't be denied.


3613-Shaders_07-01-11.7z (http://www.mediafire.com/file/zjs57lont71eos9/3613-Shaders_07-01-11.7z)
Title: Re: Shaders for the MediaVPs
Post by: Master_of_the_blade on November 30, 2012, 11:04:31 pm
Invalid or deleted file.
Title: Re: Shaders for the MediaVPs
Post by: Fineus on December 01, 2012, 03:39:12 am
This thread is over a year old and therefore likely invalid, please check the last post date in future :)
Title: Re: Shaders for the MediaVPs
Post by: The E on December 01, 2012, 04:50:16 am
To be more precise, the sharers this topic sought to promote are part of the engine now (at least in 3.6.15 builds). Downloading external packages such a the ones discussed here is neither recommended nor necessary.