Author Topic: Valathil's Awesome Graphical Advancements  (Read 41423 times)

0 Members and 1 Guest are viewing this topic.

Offline Valathil

  • ...And I would have had a custom title if it wasn't for you meddling kids!
  • 29
  • Custom Title? Wizards need no Custom Title!
of course it could also be my graphics card.

probably your graphics card yes
┏┓╋┏┓╋╋╋╋╋╋╋╋╋┏┓
┃┃╋┃┃╋╋╋╋╋╋╋╋╋┃┃
┃┃┏┫┃┏┳━━┓┏━━┓┃┗━┳━━┳━━┳━━┓
┃┃┣┫┗┛┫┃━┫┃┏┓┃┃┏┓┃┏┓┃━━┫━━┫
┃┗┫┃┏┓┫┃━┫┃┏┓┃┃┗┛┃┗┛┣━━┣━━┃
┗━┻┻┛┗┻━━┛┗┛┗┛┗━━┻━━┻━━┻━━┛

 

Offline KyadCK

  • 29
  • Getting better with every game
    • Minecraft
    • Steam
First, I'd like to say that the new effects are very, very cool. Secondly, I've noticed a minor problem with a couple ships and the FS2 effect. When selecting the ship, it begins the top-down scan, but due to the length of the Apollo and Valkyrie (and possibly more), the bar only goes down to about halfway on the cockpit (the ship goes beyond the underlying grid), and when staring to go back up the nose suddenly appears. (see youtube link)

http://www.youtube.com/watch?v=fLaO6Wbj1xI

I understand that FS1 ships will eventually use the FS1 effect, but this could be a problem for other ships as well.
Freespace Wallpapers     BluePlanet Multi     Minecraft Deimos Build Log
Need help setting up Multi? Then join us on the Multi-Setup IRC channel!
Computers only fear those who know how to use them

 

Offline Kolgena

  • 211
I literally squeed just now. Now I'll say it.

Who's going to revive the Star Trek mods?

[EDIT] I don't know if the newest version of the effect is in the nightlies, but when viewing the ship draw effect the wireframe of the model is completely visible before the effect is complete. of course it could also be my graphics card.

This is me too :(

 

Offline Valathil

  • ...And I would have had a custom title if it wasn't for you meddling kids!
  • 29
  • Custom Title? Wizards need no Custom Title!
First, I'd like to say that the new effects are very, very cool. Secondly, I've noticed a minor problem with a couple ships and the FS2 effect. When selecting the ship, it begins the top-down scan, but due to the length of the Apollo and Valkyrie (and possibly more), the bar only goes down to about halfway on the cockpit (the ship goes beyond the underlying grid), and when staring to go back up the nose suddenly appears. (see youtube link)

http://www.youtube.com/watch?v=fLaO6Wbj1xI

I understand that FS1 ships will eventually use the FS1 effect, but this could be a problem for other ships as well.

This is a problem with a wrongly set ship radius. im not going to start handling some special cases for some some ships that have wrong parameters specified. The effect works great on 80 to 90% of ships and where theres a little bit wrong i think it can be overlooked its not that the game blows up just because the nose of a ship reaches beyond the grid
┏┓╋┏┓╋╋╋╋╋╋╋╋╋┏┓
┃┃╋┃┃╋╋╋╋╋╋╋╋╋┃┃
┃┃┏┫┃┏┳━━┓┏━━┓┃┗━┳━━┳━━┳━━┓
┃┃┣┫┗┛┫┃━┫┃┏┓┃┃┏┓┃┏┓┃━━┫━━┫
┃┗┫┃┏┓┫┃━┫┃┏┓┃┃┗┛┃┗┛┣━━┣━━┃
┗━┻┻┛┗┻━━┛┗┛┗┛┗━━┻━━┻━━┻━━┛

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Well, fixing the radius is easy with the latest PCS2 builds, so I guess if that issue will cause a problem to somebody, he'll be able to fix it himself.

 

Offline Kolgena

  • 211
In that video, KyadCK also has the problem where the entire wireframe is drawn before the line "scrolls" down completely. Are you sure it's a gfx card thing? (Also, using the latest nightly, I don't get that white "light" effect from the scrolling green line)

(As a final tweak, it'd be nice if the animation synched with the sound a bit better. The ship rotates up a bit too slowly at the end)


Edit: Durrrrrrr I didn't update my shader file. I brb to say what happens.
Edit2: K, so the white light effect is there, but the entire wireframe still draws before the line scrolls down.
« Last Edit: July 30, 2011, 01:27:48 pm by Kolgena »

 

Offline Valathil

  • ...And I would have had a custom title if it wasn't for you meddling kids!
  • 29
  • Custom Title? Wizards need no Custom Title!
hmm complete wireframe drawing must be something with the custom clipping plane combined with the way the wireframe drawn it would be great to know what command line flags you have active to see if i can replicate
┏┓╋┏┓╋╋╋╋╋╋╋╋╋┏┓
┃┃╋┃┃╋╋╋╋╋╋╋╋╋┃┃
┃┃┏┫┃┏┳━━┓┏━━┓┃┗━┳━━┳━━┳━━┓
┃┃┣┫┗┛┫┃━┫┃┏┓┃┃┏┓┃┏┓┃━━┫━━┫
┃┗┫┃┏┓┫┃━┫┃┏┓┃┃┗┛┃┗┛┣━━┣━━┃
┗━┻┻┛┗┻━━┛┗┛┗┛┗━━┻━━┻━━┻━━┛

 

Offline Kolgena

  • 211
Code: [Select]
C:\Program Files (x86)\Freespace\fs2_open_3_6_13r_INF_SSE2-20110730_r7388.exe -mod mediavps_3612 -spec -glow -env -nomotiondebris -missile_lighting -normal -post_process -fxaa -no_vsync -cache_bitmaps -orbradar -ship_choice_3d -3dwarp -warp_flash -snd_preload  -fov .6 -spec_exp 4 -spec_tube 1.2 -spec_point 0.85 -spec_static 2.3 -ambient_factor 80 -ogl_spec 90 -bloom_intensity 80 -fxaa_preset 0
Forcing 8xAF thru CCC. If you need to know anything else, let me know.

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Quote
(As a final tweak, it'd be nice if the animation synched with the sound a bit better. The ship rotates up a bit too slowly at the end)

The cables are too thick.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline Kolgena

  • 211
Quote
(As a final tweak, it'd be nice if the animation synched with the sound a bit better. The ship rotates up a bit too slowly at the end)

The cables are too thick.

wat no

I think it's a valid non-OCD suggestion that the sounds should be synched to the animation. Just to be clear, I'm not saying the ship spins too slowly. I'm saying the step when the view changes from top down to sideways transitions too slowly and isn't synced with the audio.

 

Offline Valathil

  • ...And I would have had a custom title if it wasn't for you meddling kids!
  • 29
  • Custom Title? Wizards need no Custom Title!
Code: [Select]
C:\Program Files (x86)\Freespace\fs2_open_3_6_13r_INF_SSE2-20110730_r7388.exe -mod mediavps_3612 -spec -glow -env -nomotiondebris -missile_lighting -normal -post_process -fxaa -no_vsync -cache_bitmaps -orbradar -ship_choice_3d -3dwarp -warp_flash -snd_preload  -fov .6 -spec_exp 4 -spec_tube 1.2 -spec_point 0.85 -spec_static 2.3 -ambient_factor 80 -ogl_spec 90 -bloom_intensity 80 -fxaa_preset 0
Forcing 8xAF thru CCC. If you need to know anything else, let me know.

try turning off the AF, i cant replicate.

Maybe ATI issue?? Who else has full wireframes?

EDIT: Newest trunk should have fixed audio syncing
« Last Edit: July 30, 2011, 03:21:18 pm by Valathil »
┏┓╋┏┓╋╋╋╋╋╋╋╋╋┏┓
┃┃╋┃┃╋╋╋╋╋╋╋╋╋┃┃
┃┃┏┫┃┏┳━━┓┏━━┓┃┗━┳━━┳━━┳━━┓
┃┃┣┫┗┛┫┃━┫┃┏┓┃┃┏┓┃┏┓┃━━┫━━┫
┃┗┫┃┏┓┫┃━┫┃┏┓┃┃┗┛┃┗┛┣━━┣━━┃
┗━┻┻┛┗┻━━┛┗┛┗┛┗━━┻━━┻━━┻━━┛

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Nightly builds post 7391 will have the "cloak" code in them.

To enable its use, you need to modify your post_processing.tbl, by adding the following after the post processing effect definitions and before the #End:
Code: [Select]
#Ship Effects

$Name: Cloak
$Shader Effect: 2
$Disables Rendering: YES
$Invert timer: YES

$Name: Decloak
$Shader Effect: 2
$Disables Rendering: NO
$Invert timer: NO

You will also need this 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

#ifdef FLAG_ANIMATED
uniform sampler2D sFramebuffer;
uniform int effect_num;
uniform float anim_timer;
uniform float vpwidth;
uniform float vpheight;
#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_ANIMATED
vec2 screenPos;
if(effect_num == 2)
{
screenPos = gl_FragCoord.xy * vec2(vpwidth,vpheight);
texCoord += (1.0-anim_timer)*0.3*vec2(sin(screenPos.y*50.0));
}
 #endif
 #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 = vec3(0.0);
envOffset.xy = normal.xy;
  #endif
normal.b = sqrt(1.0 - dot(normal.rg, normal.rg));
normal = tbnMatrix * normal;
float norm = length(normal);
if( length(normal) > 0.0)  // fix broken normal maps
normal /= norm ;
else
normal = tbnMatrix * vec3(0.0, 0.0, 1.0);
  #else
vec3 normal = lNormal;
  #endif

vec3 lightDir;
lightAmbient = gl_FrontMaterial.emission + (gl_LightModel.ambient * gl_FrontMaterial.ambient);
float dist;
#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);

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

  #if SHADER_MODEL > 2
if (gl_LightSource[i].spotCutoff < 91.0) {  // Tube light
float beamlength = length(gl_LightSource[i].spotDirection);
vec3 beamDir = normalize(gl_LightSource[i].spotDirection);
float neardist = dot(position.xyz - gl_LightSource[i].position.xyz , beamDir); // Get nearest point on line
vec3 nearest = gl_LightSource[i].position.xyz - beamDir * abs(neardist); // Move back from the endpoint of the beam along the beam by the distance we calculated
lightDir = nearest - position.xyz;
dist = length(lightDir);
}
  #endif

lightDir = normalize(lightDir);

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

specularIntensity = SPEC_INTENSITY_POINT;
} 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(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

 #ifdef FLAG_ANIMATED
if(effect_num == 0)
{
float shinefactor = 1.0/(1.0 + pow((fract(abs(gl_TexCoord[0].x))-anim_timer) * 1000.0, 2.0)) * 1000.0;
gl_FragColor.rgb = fragmentColor.rgb + vec3(shinefactor);
gl_FragColor.a = fragmentColor.a * shinefactor * (fract(abs(gl_TexCoord[0].x))-anim_timer) * -10000.0;
}
if(effect_num == 1)
{
float shinefactor = 1.0/(1.0 + pow((position.y-anim_timer), 2.0));
gl_FragColor.rgb = fragmentColor.rgb + vec3(shinefactor);
gl_FragColor.a = fragmentColor.a;
}
if(effect_num == 2)
{
gl_FragColor.a = 1.0;
gl_FragColor.rgb = texture2D(sFramebuffer, screenPos + anim_timer*0.1*vec2(sin(screenPos.y*50.0))).rgb*(1.0-anim_timer)+anim_timer*fragmentColor.rgb;
}
 #else
gl_FragColor = fragmentColor;
 #endif
}

This will also add a new sexp, ship-effect (To be found under Change->Ship Status).
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
3 and 7 are done, 5 and 6 may not be a good idea (DoF looks good in a movie and motion blur was in and didn't looked good), 4 is being worked on.
From these, only 1 and 2 look truly interesting. 2 might be doable via shaders (though I don't know for sure) and 1 has been partially done via scripting (of course, it'd be great to see volumetric effects implemented into the engine).

DoF and motion blur for in-game cutscenes then?  (The ones that use the cutscene code, not actual cutscene movie files).

All of those are pretty nice additions, but the problem as I apparently see it, is that there aren't graphical coders at work around here. Some time ago, a Descent modder came here with big hopes to get shadows working in FS2, but I haven't heard of him since.

If you are so inclined to make these changes yourself, I don't think anyone here would not put you in a pedestal.

You mean karx11erx ?  Posted this thread?
« Last Edit: July 30, 2011, 04:53:31 pm by jr2 »

 

Offline Mongoose

  • Rikki-Tikki-Tavi
  • Global Moderator
  • 212
  • This brain for rent.
    • Minecraft
    • Steam
    • Something
I dunno where the point about motion blur as a whole looking bad comes from, since I've seen it look absolutely fantastic in games that use it properly.

 

Offline Lucika

  • Victim of trolling-related humor
  • 211
  • Modding is l'art pour l'art
    • Syrk: The Unification Wars
I am not a moderator but doesn't someone feel like splitting this? The title is completely unrelated to the discussion and it would be a shame if some people would miss the awesome cloaking stuff because of it ;)
HLP member 2008-2012 and Syrk:TUW project leader ~2010-2012

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
I've tested the cloaking effect and it's great except from one thing.
Since the animated shader is only applied to ship model, when a craft such as Iz'rail (or any Steve-O's fighter for that matter) cloaks, it's external weapons can be seen conspiciously floating in space.  :)
So, I have a small request to apply the cloaking effect to whatever weapons the cloaking craft happens to be carrying on it's external hardpoints.

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Does the cloaking effect require post processing to be enabled?
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline KyadCK

  • 29
  • Getting better with every game
    • Minecraft
    • Steam
Quote
This is a problem with a wrongly set ship radius. im not going to start handling some special cases for some some ships that have wrong parameters specified. The effect works great on 80 to 90% of ships and where theres a little bit wrong i think it can be overlooked its not that the game blows up just because the nose of a ship reaches beyond the grid

I figured it was something simple. It certainly isn't game breaking, nor a huge priority.

Quote
In that video, KyadCK also has the problem where the entire wireframe is drawn before the line "scrolls" down completely. Are you sure it's a gfx card thing?

I use a ATI Radeon HD 5570 if that helps debug anything.

Quote
hmm complete wireframe drawing must be something with the custom clipping plane combined with the way the wireframe drawn it would be great to know what command line flags you have active to see if i can replicate

Code: [Select]
-mod fsport
-spec
-glow
-env
-noscalevid
-missile_lighting
-normal
-3dshockwave
-post_process
-cache_bitmaps
-dualscanlines
-targetinfo
-rearm_timer
-ballistic_gauge
-ship_choice_3d
-weapon_choice_3d
-3dwarp -warp_flash
-snd_preload
-fps
Freespace Wallpapers     BluePlanet Multi     Minecraft Deimos Build Log
Need help setting up Multi? Then join us on the Multi-Setup IRC channel!
Computers only fear those who know how to use them

 

Offline Valathil

  • ...And I would have had a custom title if it wasn't for you meddling kids!
  • 29
  • Custom Title? Wizards need no Custom Title!
Does the cloaking effect require post processing to be enabled?

yes i probably should have mentioned that, maybe ill add fs1 effect as the cloak if post is disabled as a fallback have to look into that.

I've tested the cloaking effect and it's great except from one thing.
Since the animated shader is only applied to ship model, when a craft such as Iz'rail (or any Steve-O's fighter for that matter) cloaks, it's external weapons can be seen conspiciously floating in space.  :)
So, I have a small request to apply the cloaking effect to whatever weapons the cloaking craft happens to be carrying on it's external hardpoints.

interesting could you point me towards a mod that has such fighters so i can look at the problem
« Last Edit: July 31, 2011, 03:59:25 am by Valathil »
┏┓╋┏┓╋╋╋╋╋╋╋╋╋┏┓
┃┃╋┃┃╋╋╋╋╋╋╋╋╋┃┃
┃┃┏┫┃┏┳━━┓┏━━┓┃┗━┳━━┳━━┳━━┓
┃┃┣┫┗┛┫┃━┫┃┏┓┃┃┏┓┃┏┓┃━━┫━━┫
┃┗┫┃┏┓┫┃━┫┃┏┓┃┃┗┛┃┗┛┣━━┣━━┃
┗━┻┻┛┗┻━━┛┗┛┗┛┗━━┻━━┻━━┻━━┛

 

Offline MatthTheGeek

  • Captain Obvious
  • 212
  • Frenchie McFrenchface
WiH. Any UEF fighter.
People are stupid, therefore anything popular is at best suspicious.

Mod management tools     -     Wiki stuff!     -     Help us help you

666maslo666: Releasing a finished product is not a good thing! It is a modern fad.

SpardaSon21: it seems like you exist in a permanent state of half-joking misanthropy

Axem: when you put it like that, i sound like an insane person

bigchunk1: it's not retarded it's american!
bigchunk1: ...

batwota: steele's maneuvering for the coup de gras
MatthTheGeek: you mispelled grâce
Awaesaar: grace
batwota: oh right :P
Darius: ah!
Darius: yes, i like that
MatthTheGeek: the way you just spelled it it means fat
Awaesaar: +accent I forgot how to keyboard
MatthTheGeek: or grease
Darius: the killing fat!
Axem: jabba does the coup de gras
MatthTheGeek: XD
Axem: bring me solo and a cookie