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

0 Members and 1 Guest are viewing this topic.

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
I'm having a few issues getting $Selection Effect: FS1 to work.

For weapons, I found that I had to have the flag in a TBM rather than in the TBL.

For ships, I tried the same thing, but it's just not working out.

EDIT: Also, is there a way we could define sounds for that? The FS1 effect is completely silent.

[attachment deleted by ninja]
« Last Edit: August 01, 2011, 12:39:12 pm by mjn.mixael »
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
It's also not working for me.
I've got ship selection set to FS1 in the ai_profiles but its simply not happening
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 mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Just did some testing. AI_Profiles successfully forces it. Here's my table.

Code: [Select]
#AI Profiles

$Profile Name: SelectionEffect

$Default weapon select effect: FS1
$Default ship select effect: FS1

#END

Now, I mentioned the sound effect earlier. During my testing I realized that the FS1 effect has a sound for ship selection but not weapon selection. So.. I dunno about that, but I figured I'd let you know.

EDIT: The sound effect seems to just be with my own mod.. so I'm trying to figure out how the effect actually gets the sound file.
« Last Edit: August 01, 2011, 03:22:23 pm by mjn.mixael »
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Valathil, Being the boss that he is, once again resolved my problems.
It works for me now (even with proper lighting and all that).

Stuff looks so neat  :D
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 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!
I added some refraction to the cloaking shader: http://www.youtube.com/watch?v=8l3i4CTzplM&hd=1, and decloak http://www.youtube.com/watch?v=8-c27wikh5U&hd=1
Does this look better than the old version?
┏┓╋┏┓╋╋╋╋╋╋╋╋╋┏┓
┃┃╋┃┃╋╋╋╋╋╋╋╋╋┃┃
┃┃┏┫┃┏┳━━┓┏━━┓┃┗━┳━━┳━━┳━━┓
┃┃┣┫┗┛┫┃━┫┃┏┓┃┃┏┓┃┏┓┃━━┫━━┫
┃┗┫┃┏┓┫┃━┫┃┏┓┃┃┗┛┃┗┛┣━━┣━━┃
┗━┻┻┛┗┻━━┛┗┛┗┛┗━━┻━━┻━━┻━━┛

 
 

Offline Kolgena

  • 211
Yes. Although it's subtle and mostly lost in the 2D distortion/swirling from the previous version.

Maybe I'm just not sure what I'm looking for in lolyoutube quality.

 

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!
Yes its subtle, and it should be, you cant go distorting the background any more then you just have colors and cant see anything; even before the swirling starts

here if anyone wants to see it ingame
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);
}
 #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
  #ifdef FLAG_ANIMATED
vec4 baseColor;
if(effect_num == 2)
{
baseColor = texture2D(sBasemap, texCoord+(1.0-anim_timer)*0.5*vec2(sin(screenPos.y*50.0)));
}
else
{
baseColor = texture2D(sBasemap, texCoord);
}
  #else
vec4 baseColor = texture2D(sBasemap, texCoord);
  #endif
 #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);
 #ifdef FLAG_LIGHT
gl_FragColor.a = fragmentColor.a;
 #else
gl_FragColor.a = (position.y-anim_timer) * 10000.0;
 #endif
}
if(effect_num == 2)
{
gl_FragColor.a = 1.0;
 #ifdef FLAG_LIGHT
gl_FragColor.rgb = mix(texture2D(sFramebuffer, screenPos + anim_timer*0.1*normal.xy + anim_timer*0.1*vec2(sin(screenPos.y*50.0))).rgb,fragmentColor.rgb,(max(anim_timer,0.2)-0.2)*1.25);
 #else
gl_FragColor.rgb = mix(texture2D(sFramebuffer, screenPos + anim_timer*0.1*lNormal.xy + anim_timer*0.1*vec2(sin(screenPos.y*50.0))).rgb,fragmentColor.rgb,(max(anim_timer,0.2)-0.2)*1.25);
 #endif
}
 #else
gl_FragColor = fragmentColor;
 #endif
}
« Last Edit: August 01, 2011, 05:26:54 pm by Valathil »
┏┓╋┏┓╋╋╋╋╋╋╋╋╋┏┓
┃┃╋┃┃╋╋╋╋╋╋╋╋╋┃┃
┃┃┏┫┃┏┳━━┓┏━━┓┃┗━┳━━┳━━┳━━┓
┃┃┣┫┗┛┫┃━┫┃┏┓┃┃┏┓┃┏┓┃━━┫━━┫
┃┗┫┃┏┓┫┃━┫┃┏┓┃┃┗┛┃┗┛┣━━┣━━┃
┗━┻┻┛┗┻━━┛┗┛┗┛┗━━┻━━┻━━┻━━┛

 

Offline Nighteyes

  • 211
I added some refraction to the cloaking shader: http://www.youtube.com/watch?v=8l3i4CTzplM&hd=1, and decloak http://www.youtube.com/watch?v=8-c27wikh5U&hd=1
Does this look better than the old version?

it looks better, and subtle is indeed the way to go, only thing I can suggest is to change the "pattern" of the swirl distortion... make it more like a fractal noise and if possible some parts of the ship appearing before/after other parts... randomizing the spread of the effect over the hull of the ship.

 

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!
it looks better, and subtle is indeed the way to go, only thing I can suggest is to change the "pattern" of the swirl distortion... make it more like a fractal noise and if possible some parts of the ship appearing before/after other parts... randomizing the spread of the effect over the hull of the ship.

yes but thats not as easy as it sounds.
┏┓╋┏┓╋╋╋╋╋╋╋╋╋┏┓
┃┃╋┃┃╋╋╋╋╋╋╋╋╋┃┃
┃┃┏┫┃┏┳━━┓┏━━┓┃┗━┳━━┳━━┳━━┓
┃┃┣┫┗┛┫┃━┫┃┏┓┃┃┏┓┃┏┓┃━━┫━━┫
┃┗┫┃┏┓┫┃━┫┃┏┓┃┃┗┛┃┗┛┣━━┣━━┃
┗━┻┻┛┗┻━━┛┗┛┗┛┗━━┻━━┻━━┻━━┛

 

Offline Nighteyes

  • 211
it looks better, and subtle is indeed the way to go, only thing I can suggest is to change the "pattern" of the swirl distortion... make it more like a fractal noise and if possible some parts of the ship appearing before/after other parts... randomizing the spread of the effect over the hull of the ship.

yes but thats not as easy as it sounds.

its a suggestion, take it or leave it, its awesome as it is anyway, I would be happy either way as if you consider this effect "finished" it would just mean a new cool thing will be next in line ;) (ahem*shadows*ahem)

 

Offline Kolgena

  • 211
What if it was pure refraction and fade without the swirliness? Not saying the current effect doesn't look fantastic, it's just that I'm curious what would happen.

Also, is it possible to keep the refraction after cloaking for a Halo-style active cammo?

Sort of like this:



with or without the ghosting of the armor.
« Last Edit: August 01, 2011, 06:30:47 pm by Kolgena »

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
The visual effect is awesome, though it looks somewhat odd to have the thruster effects suddenly appear and disappear at full illumination as the ship completes cloaking or begins to de-cloak.  You may want to have something that scales the thruster effects size or transparency based on the present degree of visual cloak.
The Trivial Psychic Strikes Again!

 

Offline Mongoose

  • Rikki-Tikki-Tavi
  • Global Moderator
  • 212
  • This brain for rent.
    • Steam
    • Something
Re: Valathil's awesome cloaking effect (formerly Cinematics vs. Game)
Edited the thread title to something much more appropriate. :)

 

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!
Re: Valathil's awesome cloaking effect (formerly Cinematics vs. Game)
Edited the thread title to something much more appropriate. :)
:lol: :lol: :lol:
The visual effect is awesome, though it looks somewhat odd to have the thruster effects suddenly appear and disappear at full illumination as the ship completes cloaking or begins to de-cloak.  You may want to have something that scales the thruster effects size or transparency based on the present degree of visual cloak.

Thruster scaling is something ive looked into but just isnt possible at the moment without upheaving the model rendering pipeline for a quick and dirty fix. This should however be trivial once we get shader support on sprites with swifty's soft particles, im sure i can sneak something in there and then its much cleaner and neater code.
What if it was pure refraction and fade without the swirliness? Not saying the current effect doesn't look fantastic, it's just that I'm curious what would happen.

Also, is it possible to keep the refraction after cloaking for a Halo-style active cammo?

firstly letting the cloak stay on with refraction was something i discussed at length in irc today and will definitely be implemented in a short timeframe just have to add a parameter to the table.

secondly THIS: http://www.youtube.com/watch?v=ZH7uMFQBIw4&hd=1
« Last Edit: August 01, 2011, 09:53:07 pm by Valathil »
┏┓╋┏┓╋╋╋╋╋╋╋╋╋┏┓
┃┃╋┃┃╋╋╋╋╋╋╋╋╋┃┃
┃┃┏┫┃┏┳━━┓┏━━┓┃┗━┳━━┳━━┳━━┓
┃┃┣┫┗┛┫┃━┫┃┏┓┃┃┏┓┃┏┓┃━━┫━━┫
┃┗┫┃┏┓┫┃━┫┃┏┓┃┃┗┛┃┗┛┣━━┣━━┃
┗━┻┻┛┗┻━━┛┗┛┗┛┗━━┻━━┻━━┻━━┛

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Re: Valathil's awesome cloaking effect (formerly Cinematics vs. Game)
That is SO Cool!  :yes:
The Trivial Psychic Strikes Again!

 

Offline Commander Zane

  • 212
  • Spoot Knight of Anvils
Re: Valathil's awesome cloaking effect (formerly Cinematics vs. Game)
Oh GOD YES. :eek:
It looks less Klingon, which I had thought of the other effects, but many times better.

 

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!
Re: Valathil's awesome cloaking effect (formerly Cinematics vs. Game)
Oh GOD YES. :eek:
It looks less Klingon, which I had thought of the other effects, but many times better.

Its more romulan now in my book
« Last Edit: August 01, 2011, 10:16:22 pm by Valathil »
┏┓╋┏┓╋╋╋╋╋╋╋╋╋┏┓
┃┃╋┃┃╋╋╋╋╋╋╋╋╋┃┃
┃┃┏┫┃┏┳━━┓┏━━┓┃┗━┳━━┳━━┳━━┓
┃┃┣┫┗┛┫┃━┫┃┏┓┃┃┏┓┃┏┓┃━━┫━━┫
┃┗┫┃┏┓┫┃━┫┃┏┓┃┃┗┛┃┗┛┣━━┣━━┃
┗━┻┻┛┗┻━━┛┗┛┗┛┗━━┻━━┻━━┻━━┛

 

Offline Sonzai

  • 23
  • 137th Quantum Physicists
Re: Valathil's awesome cloaking effect (formerly Cinematics vs. Game)
That is an unbelievably awesome effect! :yes:

 

Offline Kolgena

  • 211
Re: Valathil's awesome cloaking effect (formerly Cinematics vs. Game)
k wow. Huge improvement over the previous effect, which tbh, now seems cheesy in comparison.