Simviation Forum
/yabb
Current Flight Simulator Series >> Flight Simulator X >> FSWC's back in progress!
/yabb?num=1197128602

Message started by Str1ker on Dec 8th, 2007 at 10:43am

Title: FSWC's back in progress!
Post by Str1ker on Dec 8th, 2007 at 10:43am
Hey guys,

For those of you following my progress on FSWC, I'm sad to say that it isn't going to be ready for a long time, and I mean quite long.

Basically, my PC's mobo seems to hate me more than anything, and it's been sent to Bangkok to be checked, and I won't get it back for two weeks, which means no developement, therefore no program.

However, the slightly better news is that, since I now know what's needed for the program to work, and I have the basic structure down, I'm going to reprogram it in C# (not a musical note), and recreate it completely so that it works with all FSX-supported operating systems, XP SP2 and Vista, 32-bit and 64-bit, and also support all versions of FSX, including all or no service packs, so that anyone can use the program.

I've also decided on adding extra features, which should allow me, or you, as the case may be, to edit these settings:
General Reflection Amount
Low-Angle Reflections (SP1 and lower)
High-Angle Reflections (SP1 and lower)
Specular Reflections
Wave Intensity
and hopefully a few more, which I have yet to experiment with.

Anyway, if all goes well there will be a single installer, that installs everything you need, system specific stuff and all, so it should be as easy as installing FSX itself (just without the long long waiting time and updates).

So, you won't be hearing from me in a while, not until my PC is back up and running.

See ya guys,

Str!ker

Title: Re: FSWC's on halt
Post by NickN on Dec 20th, 2007 at 10:19am

I just saw this

I was wondering what happened to you.


I assumed you may be busy with school. Bummer about your system

Anyway, I have been busy and have not looked that this for some time. I thought perhaps you may still be reworking the code for the SP2 file but I see now you are down.

The original edited code used in SP1


};

#define fresnMin x.x
#define fresnMax x.x

half fresnel2( half3 vEyeDir, half3 vSurfaceNorm )
{
 half frdot = min( 1 - dot(vEyeDir, vSurfaceNorm), 1 );
 return lerp( fresnMin, fresnMax, frdot * frdot );



should still work although your other tweaks for specular will have to be refined. I never did fool around with it because I thought you were still working on it.



Title: Re: FSWC's on halt
Post by NickN on Dec 20th, 2007 at 11:23am


Ok Str!ker I just looked this over and the original code does work to make water more reflective, however, unlike SP1 the frame hit is exactly the same. In SP1 the code allowed raising the water reflection slider to 2xMid with no hit and 2xHigh with a minor hit. With SP2 the frame hit is no different between the default and the code that allows higher reflections.


So there you have it. And to tell you the truth, the water was too reflective and even adjusting the min and max the results were not what I consider accurate for water. It was either a mirror or a pixelated mirror.


There is no performance gain by applying this to the SP2 shader file. All it will do in increase reflection but only if you raise the slider to 2xMed or 2xHigh in order to get cloud and land in the water.



Title: Re: FSWC's on halt
Post by NickN on Dec 20th, 2007 at 12:40pm

I have completely confirmed all this now


It will give you high reflections but without the shimmer we got in SP1 so there is no need to fool with specular



But unfortunately it will not provide the high reflections without the same excact hit to performance in DX9 the default shader file produces and you must raise the slider to get the higher reflections.








Title: Re: FSWC's on halt
Post by NickN on Dec 20th, 2007 at 1:52pm



If anyone wishes to try this, please note: I see no reason to do this edit other than increasing reflection because there is NO PERFORMACE benefit to making this change like there was in SP1



NOTE: THIS IS FOR SP2 or SP2 with Accleration ONLY. DO NOT USE THE FOLLOWING CODE FOR SP1

Back up your original Microsoft Games/Microsoft Flight Simulator X/ShadersHLSL/Terrain\Water20.fxh <-------- copy this to somewhere safe

Open the original file in notepad and COMPLETELY overwrite it with the following code:



Code:
//---------------------------------------------------------------------------
// Flight Simulator X - Shader Effect Files
// Copyright (c) 2006, Microsoft Corporation
//---------------------------------------------------------------------------
#include <Common.fxh>
#include <MaterialDecl.fxh>
#include <D3D9Texture.fxh>
#include <FuncLibrary.fxh>

#define vLightDir vSunVectorWorld

// Potential textures
texture Water_BaseTexture               : MATERIAL_BASE_TEXTURE;
texture Water_EnvTexture                : MATERIAL_ENVIRONMENT_TEXTURE;
texture Water_BumpTexture               : MATERIAL_BUMP_TEXTURE;

// Global variables
float3 vCamEyePoint : VIEWPOSITION;

float fTimeScale        : WATER_BUMP_TIME_SCALE;            
float fBumpScale        : WATER_BUMP_SCALE;          
float fBumpUVScale      : WATER_BUMP_UV_SCALE;      
float fBumpU            : WATER_BUMP_DISTANCE_SCALE;
float fBumpV            : WATER_BUMP_LIGHT_SCALE;    
float fFresnelFactorMin : WATER_FRESNEL_FACTOR_MIN;  
float fFresnelFactorMax : WATER_FRESNEL_FACTOR_MAX;  
float fSpecularPower    : SPECULAR_POWER;            
float fSpecularBoost    : SPECULAR_BOOST;            
float fSpecularBlend    : SPECULAR_BLEND;            
float fBumpRotation     : WATER_BUMP_ROTATION;      
float fBumpTimeX1       : WATER_BUMP_TIME_X1;        
float fBumpTimeY1       : WATER_BUMP_TIME_Y1;        
float fBumpTimeX2       : WATER_BUMP_TIME_X2;        
float fBumpTimeY2       : WATER_BUMP_TIME_Y2;        
float fBumpTimeScale2   : WATER_BUMP_TIME_SCALE_2;  

// Samples used by this shader
sampler Water_BaseSampler = sampler_state
{
   Texture       = (Water_BaseTexture);
   AddressU      = Clamp;      // terrain textures must be clamped
   AddressV      = Clamp;
   MinFilter     = (State_MinFilter);
   MagFilter     = (State_MagFilter);
   MipFilter     = (State_MipFilter);
   MipMapLodBias = (State_MipMapLodBias);
};

sampler Water_BumpSampler = sampler_state
{
   Texture       = (Water_BumpTexture);
   AddressU      = Wrap;
   AddressV      = Wrap;
   AddressW      = Wrap;
   MinFilter     = D3DTEXF_LINEAR;
   MagFilter     = D3DTEXF_LINEAR;
   MipFilter     = D3DTEXF_LINEAR;
   MipMapLodBias = (State_MipMapLodBias);
};

sampler Water_EnvMapSampler = sampler_state
{
   Texture       = (Water_EnvTexture);
   AddressU      = Clamp;
   AddressV      = Clamp;
   MinFilter     = (State_MinFilter);
   MagFilter     = (State_MagFilter);
   MipFilter     = (State_MipFilter);
   MipMapLodBias = (State_MipMapLodBias);
};

struct VSWATER20_INPUT
{
   float4 vPos       : POSITION;
   float4 vColor     : COLOR0;
   float3 vNormal    : NORMAL;
   float2 vTex       : TEXCOORD0;
};

struct VSWATER20_OUTPUT
{
   float4  vPos                : POSITION;
   float   fFog                : FOG;
   half4   vColor              : COLOR0;

   float4 TexBump        : TEXCOORD0;
   float4 TexEnvMap      : TEXCOORD1;
   float4 TexBase        : TEXCOORD2;
   float4 MiscData               : TEXCOORD3;
   float3 vNormalWS      : TEXCOORD4;
   float3 vPosWS                 : TEXCOORD5;
   float3 vEyePosWS      : TEXCOORD6;
   float4 TexScreen      : TEXCOORD7;
};

#define fresnMin 0.1
#define fresnMax 0.7

half fresnel2( half3 vEyeDir, half3 vSurfaceNorm )
{
 half frdot = min( 1 - dot(vEyeDir, vSurfaceNorm), 1 );
 return lerp( fresnMin, fresnMax, frdot * frdot );
}

VSWATER20_OUTPUT Water20VS(const VSWATER20_INPUT v,const bool b30Shader)
{
   VSWATER20_OUTPUT o = (VSWATER20_OUTPUT)0;

   // Transform to clip space
   o.vPos = mul(v.vPos, mFullProj);

   // Compute fog
   o.fFog = ComputeFog(o.vPos.w, FOG_END, FOG_RECIP, FOG_SELECT_VERTEX, FOG_SELECT_TABLE);

       // Transform to world space
       float3 vWorldPos = mul(v.vPos, mWorld);

   // Compute eye vector
       float3 vEye = normalize(vCamEyePoint - vWorldPos);
       
       // Scale normal based bump based on dist
       //float fNormalScale = max(1.0,length(vEye)-fBumpDistScale);

   // Scale bumpmap texture coordinates by detail coordinates
       //float2 bmp = fmod(v.vPos.xz * (fBumpUVScale * 0.0001f),1024.0f);      
       float2 bmp = fmod((vWorldPos.xz + float2(fBumpU, fBumpV) - mWorld[3].xz) * (fBumpUVScale * 0.0001f),256.0f);    
       float2 sc = float2(sin(fBumpRotation),cos(fBumpRotation));
       if (b30Shader)
       {
               o.TexBump.xy = bmp + (fSimTime * fBumpTimeScale2)*float2(fBumpTimeX1,fBumpTimeY1);
               o.TexBump.zw = (bmp*fBumpScale) + ((fSimTime * fBumpTimeScale2)*float2(fBumpTimeX2,fBumpTimeY2))/2.0f;
               o.TexBump.zw = float2(o.TexBump.z * sc.y - o.TexBump.w * sc.x, o.TexBump.z * sc.x + o.TexBump.w * sc.y);
       }
       else
       {
               o.TexBump.xy = bmp + (fSimTime * fTimeScale)*float2(0.4,-0.4);
               o.TexBump.zw = (bmp*fBumpScale) + ((fSimTime * fTimeScale)*float2(-1.0,1.0))/2.0f;
               o.TexBump.zw = float2(o.TexBump.z * sc.y - o.TexBump.w * sc.x, o.TexBump.z * sc.x + o.TexBump.w * sc.y);
       }    

       // Send out interpolated normal for lighting
   o.vNormalWS = normalize(TransformVectorToSpace(v.vNormal, mWorld));

       // Send out eye pos
       o.vPosWS    = vWorldPos;
       o.vEyePosWS = vCamEyePoint;

       // Output vertex color straight to PS
       // The alpha component is used to represent the relative
       // depth of the water, used in computing water translucenty
       // The color component is simply the color scaled by the
       // diffuse sun lighting component
   o.vColor.a = v.vColor.a;
   o.vColor.rgb = 0.5/*( 1 - fresnel2(vSunVectorWorld_Sun.xyz, o.vNormalWS.xyz) ) * 0.5*/;

   // Environment mapping is determined from the screen-space coordinates
   // of our geometry. This implies that we need to divide them by W, and then
   // offset/scale into a 0-1 range. Because of interpolation issues due to front
   // clipped geometry, the info is pre-processed and passed to the PS where the 1/W
   // is applied. We also apply the normal to the data to emulate reflections caused
   // by the animating geometry
   o.TexEnvMap.xyz = o.vPos.xyz+o.vPos.www;
//    o.TexEnvMap.xyz = o.vPos.xyz+o.vPos.www*(1.0+0.25*o.vNormalWS.xzy/fNormalScale);
   o.TexEnvMap.w = 2.0*o.vPos.w;
   o.TexScreen.xyz = float3(1,-1,1)*o.vPos.xyz+o.vPos.www;
   o.TexScreen.w = 2.0*o.vPos.w;

   // Diffuse texture coordinates
   o.TexBase.xy = v.vTex;

   // Compute per-poly fresnel
       o.MiscData.x = 1.0 - lerp(fFresnelFactorMin, fFresnelFactorMax, pow(smoothstep(0,1,saturate(-normalize(vWorldPos).y)),0.5));
       o.MiscData.y = 0;
       o.MiscData.z = 0;
       o.MiscData.w = 0;

   return o;
}

float4 Water20PS(VSWATER20_OUTPUT Input, const bool b30Shader) : COLOR
{
   float4 Bump;
   float2 BumpEnv;
   float4 Color;
       float2 specularFactor;

   // Renomalize the input vectors and determine the
   // eye vector for lighting and reflection
   float3 vEyeDirWS;
   vEyeDirWS = normalize(Input.vEyePosWS - Input.vPosWS);
       
   
   // Sample the base color and bumpmaps
   // Since this is essentially a texbem style operation, we
   // manually apply the matrix to the bumpmap values, we then
   // scale our envmap texcoords by 1/W before factoring in the
   // bumpmap
       float3 vSurfaceNorm;
   if (b30Shader)
   {
           Bump = tex2Dbias(Water_BumpSampler, float4(Input.TexBump.xy,0,-2.0f))
                    + tex2Dbias(Water_BumpSampler, float4(Input.TexBump.zw,0,-3.0f));
           Bump = normalize(Bump-1.0f);
           vSurfaceNorm = Bump.xzy;
           BumpEnv = (Input.TexEnvMap.xy/Input.TexEnvMap.w)+ (0.2f*Bump.xy);
   }
   else
   {
           Bump = tex2Dbias(Water_BumpSampler, float4(Input.TexBump.xy,0,-2.0f))
                    + tex2Dbias(Water_BumpSampler, float4(Input.TexBump.zw,0,-3.0f));
           Bump = normalize(Bump-1.0f);
           vSurfaceNorm = Bump.xzy;
           BumpEnv = (Input.TexEnvMap.xy/Input.TexEnvMap.w)+ (0.2f*Bump.xy);
   }

       // Compute the diffuse lighting component of the water.
       float3 vHN;
       float3 vHN2;

   vHN = normalize(vEyeDirWS.xyz + vSunVectorWorld_Sun.xyz);
   vHN2 = normalize(vEyeDirWS.xyz + vSunVectorWorld_Moon.xyz);

   specularFactor = fSpecularBlend*(pow(fSpecularBoost*saturate(float2(dot(vSurfaceNorm, vHN),fSunMoonInterpolant * dot(vSurfaceNorm, vHN2))), fSpecularPower));
   
       // Sample the water textures and determine the final color
       float4 baseColor = tex2D(Water_BaseSampler, Input.TexBase);
       float4 envColor = tex2Dbias(Water_EnvMapSampler, float4(BumpEnv.xy,0,1 * (Input.TexScreen.z/Input.TexScreen.w)));
       
       
       float4 terrainColor = baseColor;
   float fAlpha = baseColor.a;
       float4 fLand = { baseColor.a, baseColor.a, baseColor.a, baseColor.a };
       
   half fr = fresnel2( vEyeDirWS.xyz, vSurfaceNorm.xyz);

   Color = half4( lerp( baseColor.rgb * Input.vColor.rgb, envColor.rgb, fr ), 1);
//    return Color;

   return float4(lerp(Color.xyz + (vSunDirectional * specularFactor.x) + (0.3 * (specularFactor.y + saturate(dot(vSunVectorWorld_Moon,vSurfaceNorm)))).xxx, terrainColor.xyz, fLand),fAlpha);
}

// ------- 3.0 ----------
float4 Water30PS(VSWATER20_OUTPUT Input) : COLOR
{
       return Water20PS(Input,true);
}

// ------- 2.0 ----------


float4 Water20PS(VSWATER20_OUTPUT Input) : COLOR
{
       return Water20PS(Input,false);
}

// ------ VS ------
VSWATER20_OUTPUT Water20VS(VSWATER20_INPUT Input)
{
       return Water20VS(Input,false);
}



Save the file. You now have a newly edited Water20.fxh file with the original backed up for restore


Browse to the following folder:


FOR XP users,
Go to C:/Documents and Settings/YOUR NAME/Local Settings/Application Data/Microsoft/FSX/Shaders/Terrain <----- this folder

FOR VISTA users,
Go to C:/Users/YOUR NAME/AppData/Local/Microsoft/FSX/Shaders/Terrain <------- this folder


BACK UP that entire folder somewhere safe. Then, open the original and DELETE ALL THE CONTENTS OF THE TERRAIN FOLDER




Boot the sim and set water to either 2xMed or 2xHigh


RESTORE DEFAULT

To uninstall, overwrite the edited Water20.fxh with the one you backed up

Browse to the TERRAIN folder as listed above and DELETE the entire folder

Replace the deleted folder with your original you backed up



NOTE: You can experiment with the following lines in the file:


#define fresnMin 0.X   <------- this is sensitive! A value of 0.01 to 0.5 and the default of 0.1 seems to do fine
#define fresnMax 0.X<------- value between 0.1 and 0.9 (or higher such as 1.2, etc)  a value of 0.4 to 0.7 does quite well. Try reducing it to 0.5 or 0.6 to get a balance of high and low reflections


NOTE: WHEN EVER YOU EDIT THE FILE WITH NEW VALUES YOU MUST DELETE THE ENTIRE -CONTENTS- OF THE SHADERS\TERRAIN FOLDER AS YOU DID ABOVE, and BEFORE FSX IS BOOTED IN ORDER FOR THE CHANGES TO TAKE EFFECT

Title: Re: FSWC's on halt
Post by Barnes on Dec 20th, 2007 at 8:37pm
Nick,

Thanks for reworking the shader file!

Looks great.

Dave

Title: Re: FSWC's on halt
Post by NickN on Dec 20th, 2007 at 9:25pm

I did not rework anything. Originally I was sent a file by str!ker to test and I was out of the country so I asked someone to test it for me. It would not work in SP2 which is what I suspected because ithe one he edited was from SP1. When I got back I did not have time to look further into it and I assumed str!ker was still working on it. When I checked to see if he had posted anything on the subject I found this post so I did a quick edit into the SP2 shader file and checked it myself.


it works but not like it does in SP1. The amount of control is not there and the water appears too reflective. Mountain lakes have that type of reflection but not large bodies of water.

On top of that, the benefit we had with this in SP1 was 2 fold because the slider could be raised without a performance hit. In SP2 that is not the case.

Further, in looking at it I see that specular seems to have been broken down differently and there are other shader files which control that now.

In any case, its something to timker with but other than shallow reef and mountain lake water, it does not look right to me.

The ENV files need to be reworked which will also allow greater reflective quality, and, allow better dynamic color and brightness change to water as cloud cover increases.



Title: Re: FSWC's on halt
Post by Alrot on Dec 20th, 2007 at 9:53pm
You will say ,Alex is exagerating once again so I will just say.. Thanks Nick

trust me ,I did have to compress to much to reduce to 100k ,if you would see what I see :o


Title: Re: FSWC's on halt
Post by NickN on Dec 20th, 2007 at 10:35pm


You guys running slower cards, this may help make it look better. I can not say for sure.  And, since you do not have full support like the 8000 series increasing the water slider may not apply the same hit as it would on a better video adapter.



Title: Re: FSWC's on halt
Post by Alrot on Dec 20th, 2007 at 10:52pm
Nick I can asure you this water moves and reflect much better, the last time I remember seing this water like this was before Sp1 , I took some shots too ..

It may be a slowest card , but 15 frps with a medium high sliders , man I feel very confortable ,or maybe I'm the lukiest man on earth 8-)

Title: Re: FSWC's on halt
Post by NickN on Dec 20th, 2007 at 11:04pm

alrot wrote on Dec 20th, 2007 at 10:52pm:
Nick I can asure you this water moves and reflect much better, the last time I remember seing this water like this was before Sp1 , I took some shots too ..

It may be a slowest card , but 15 frps with a medium high sliders , man I feel very confortable ,or maybe I'm the lukiest man on earth 8-)



Glad it is working for you my friend

enjoy   ;)

Title: Re: FSWC's on halt
Post by NickN on Dec 23rd, 2007 at 1:51pm





UPDATE   2nd GENERATION TWEAK

Apparently Pwheeler over at AVSIM has taken this a step further and added code to address specular sun reflections, and, remove the moon glow from water which was annoying. It also reduces the reflective surface at higher altitudes but still allows them at lower, as water should display. Its not perfect but you can try the new code here:


NOTE: MAKE SURE TO FOLLOW THE DIRECTIONS ABOVE WHEN CHANGING THE CODE IN THE FILE


This updates the specular but removes the moon water glow:


Code:
//---------------------------------------------------------------------------
// Flight Simulator X - Shader Effect Files
// Copyright (c) 2006, Microsoft Corporation
//---------------------------------------------------------------------------
#include <Common.fxh>
#include <MaterialDecl.fxh>
#include <D3D9Texture.fxh>
#include <FuncLibrary.fxh>

#define vLightDir vSunVectorWorld

// Potential textures
texture Water_BaseTexture               : MATERIAL_BASE_TEXTURE;
texture Water_EnvTexture                : MATERIAL_ENVIRONMENT_TEXTURE;
texture Water_BumpTexture               : MATERIAL_BUMP_TEXTURE;

// Global variables
float3 vCamEyePoint : VIEWPOSITION;

float fTimeScale        : WATER_BUMP_TIME_SCALE;            
float fBumpScale        : WATER_BUMP_SCALE;          
float fBumpUVScale      : WATER_BUMP_UV_SCALE;      
float fBumpU            : WATER_BUMP_DISTANCE_SCALE;
float fBumpV            : WATER_BUMP_LIGHT_SCALE;    
float fFresnelFactorMin : WATER_FRESNEL_FACTOR_MIN;  
float fFresnelFactorMax : WATER_FRESNEL_FACTOR_MAX;  
float fSpecularPower    : SPECULAR_POWER;            
float fSpecularBoost    : SPECULAR_BOOST;            
float fSpecularBlend    : SPECULAR_BLEND;            
float fBumpRotation     : WATER_BUMP_ROTATION;      
float fBumpTimeX1       : WATER_BUMP_TIME_X1;        
float fBumpTimeY1       : WATER_BUMP_TIME_Y1;        
float fBumpTimeX2       : WATER_BUMP_TIME_X2;        
float fBumpTimeY2       : WATER_BUMP_TIME_Y2;        
float fBumpTimeScale2   : WATER_BUMP_TIME_SCALE_2;  

// Samples used by this shader
sampler Water_BaseSampler = sampler_state
{
   Texture       = (Water_BaseTexture);
   AddressU      = Clamp;      // terrain textures must be clamped
   AddressV      = Clamp;
   MinFilter     = (State_MinFilter);
   MagFilter     = (State_MagFilter);
   MipFilter     = (State_MipFilter);
   MipMapLodBias = (State_MipMapLodBias);
};

sampler Water_BumpSampler = sampler_state
{
   Texture       = (Water_BumpTexture);
   AddressU      = Wrap;
   AddressV      = Wrap;
   AddressW      = Wrap;
   MinFilter     = D3DTEXF_LINEAR;
   MagFilter     = D3DTEXF_LINEAR;
   MipFilter     = D3DTEXF_LINEAR;
   MipMapLodBias = (State_MipMapLodBias);
};

sampler Water_EnvMapSampler = sampler_state
{
   Texture       = (Water_EnvTexture);
   AddressU      = Clamp;
   AddressV      = Clamp;
   MinFilter     = (State_MinFilter);
   MagFilter     = (State_MagFilter);
   MipFilter     = (State_MipFilter);
   MipMapLodBias = (State_MipMapLodBias);
};

struct VSWATER20_INPUT
{
   float4 vPos       : POSITION;
   float4 vColor     : COLOR0;
   float3 vNormal    : NORMAL;
   float2 vTex       : TEXCOORD0;
};

struct VSWATER20_OUTPUT
{
   float4  vPos                : POSITION;
   float   fFog                : FOG;
   half4   vColor              : COLOR0;

   float4 TexBump        : TEXCOORD0;
   float4 TexEnvMap      : TEXCOORD1;
   float4 TexBase        : TEXCOORD2;
   float4 MiscData               : TEXCOORD3;
   float3 vNormalWS      : TEXCOORD4;
   float3 vPosWS                 : TEXCOORD5;
   float3 vEyePosWS      : TEXCOORD6;
   float4 TexScreen      : TEXCOORD7;
};

#define fresnMin 0.05
#define fresnMax 0.5

half fresnel2( half3 vEyeDir, half3 vSurfaceNorm )
{
 half frdot = min( 1 - dot(vEyeDir, vSurfaceNorm), 1 );
 return lerp( fresnMin, fresnMax, frdot * frdot );
}

VSWATER20_OUTPUT Water20VS(const VSWATER20_INPUT v,const bool b30Shader)
{
   VSWATER20_OUTPUT o = (VSWATER20_OUTPUT)0;

   // Transform to clip space
   o.vPos = mul(v.vPos, mFullProj);

   // Compute fog
   o.fFog = ComputeFog(o.vPos.w, FOG_END, FOG_RECIP, FOG_SELECT_VERTEX, FOG_SELECT_TABLE);

       // Transform to world space
       float3 vWorldPos = mul(v.vPos, mWorld);

   // Compute eye vector
       float3 vEye = normalize(vCamEyePoint - vWorldPos);
       
       // Scale normal based bump based on dist
       //float fNormalScale = max(1.0,length(vEye)-fBumpDistScale);

   // Scale bumpmap texture coordinates by detail coordinates
       //float2 bmp = fmod(v.vPos.xz * (fBumpUVScale * 0.0001f),1024.0f);      
       float2 bmp = fmod((vWorldPos.xz + float2(fBumpU, fBumpV) - mWorld[3].xz) * (fBumpUVScale * 0.0001f),256.0f);    
       float2 sc = float2(sin(fBumpRotation),cos(fBumpRotation));
       if (b30Shader)
       {
               o.TexBump.xy = bmp + (fSimTime * fBumpTimeScale2)*float2(fBumpTimeX1,fBumpTimeY1);
               o.TexBump.zw = (bmp*fBumpScale) + ((fSimTime * fBumpTimeScale2)*float2(fBumpTimeX2,fBumpTimeY2))/2.0f;
               o.TexBump.zw = float2(o.TexBump.z * sc.y - o.TexBump.w * sc.x, o.TexBump.z * sc.x + o.TexBump.w * sc.y);
       }
       else
       {
               o.TexBump.xy = bmp + (fSimTime * fTimeScale)*float2(0.4,-0.4);
               o.TexBump.zw = (bmp*fBumpScale) + ((fSimTime * fTimeScale)*float2(-1.0,1.0))/2.0f;
               o.TexBump.zw = float2(o.TexBump.z * sc.y - o.TexBump.w * sc.x, o.TexBump.z * sc.x + o.TexBump.w * sc.y);
       }    

       // Send out interpolated normal for lighting
   o.vNormalWS = normalize(TransformVectorToSpace(v.vNormal, mWorld));

       // Send out eye pos
       o.vPosWS    = vWorldPos;
       o.vEyePosWS = vCamEyePoint;

       // Output vertex color straight to PS
       // The alpha component is used to represent the relative
       // depth of the water, used in computing water translucenty
       // The color component is simply the color scaled by the
       // diffuse sun lighting component
   o.vColor.a = v.vColor.a;
   o.vColor.rgb = 0.5/*( 1 - fresnel2(vSunVectorWorld_Sun.xyz, o.vNormalWS.xyz) ) * 0.5*/;

   // Environment mapping is determined from the screen-space coordinates
   // of our geometry. This implies that we need to divide them by W, and then
   // offset/scale into a 0-1 range. Because of interpolation issues due to front
   // clipped geometry, the info is pre-processed and passed to the PS where the 1/W
   // is applied. We also apply the normal to the data to emulate reflections caused
   // by the animating geometry
   o.TexEnvMap.xyz = o.vPos.xyz+o.vPos.www;
//    o.TexEnvMap.xyz = o.vPos.xyz+o.vPos.www*(1.0+0.25*o.vNormalWS.xzy/fNormalScale);
   o.TexEnvMap.w = 2.0*o.vPos.w;
   o.TexScreen.xyz = float3(1,-1,1)*o.vPos.xyz+o.vPos.www;
   o.TexScreen.w = 2.0*o.vPos.w;

   // Diffuse texture coordinates
   o.TexBase.xy = v.vTex;

   // Compute per-poly fresnel
       o.MiscData.x = 1.0 - lerp(fFresnelFactorMin, fFresnelFactorMax, pow(smoothstep(0,1,saturate(-normalize(vWorldPos).y)),0.5));
       o.MiscData.y = 0;
       o.MiscData.z = 0;
       o.MiscData.w = 0;

   return o;
}

float4 Water20PS(VSWATER20_OUTPUT Input, const bool b30Shader) : COLOR
{
   float4 Bump;
   float2 BumpEnv;
   float4 Color;
       float2 specularFactor;

   // Renomalize the input vectors and determine the
   // eye vector for lighting and reflection
   float3 vEyeDirWS;
   vEyeDirWS = normalize(Input.vEyePosWS - Input.vPosWS);
       
   
   // Sample the base color and bumpmaps
   // Since this is essentially a texbem style operation, we
   // manually apply the matrix to the bumpmap values, we then
   // scale our envmap texcoords by 1/W before factoring in the
   // bumpmap
       float3 vSurfaceNorm;
   if (b30Shader)
   {
           Bump = tex2Dbias(Water_BumpSampler, float4(Input.TexBump.xy,0,-2.0f))
                    + tex2Dbias(Water_BumpSampler, float4(Input.TexBump.zw,0,-3.0f));
           Bump = normalize(Bump-1.0f);
           vSurfaceNorm = Bump.xzy;
           BumpEnv = (Input.TexEnvMap.xy/Input.TexEnvMap.w)+ (0.2f*Bump.xy);
   }
   else
   {
           Bump = tex2Dbias(Water_BumpSampler, float4(Input.TexBump.xy,0,-2.0f))
                    + tex2Dbias(Water_BumpSampler, float4(Input.TexBump.zw,0,-3.0f));
           Bump = normalize(Bump-1.0f);
           vSurfaceNorm = Bump.xzy;
           BumpEnv = (Input.TexEnvMap.xy/Input.TexEnvMap.w)+ (0.2f*Bump.xy);
   }

       // Compute the diffuse lighting component of the water.
       float3 vHN;
       float3 vHN2;

   vHN = normalize(vEyeDirWS.xyz + vSunVectorWorld_Sun.xyz);
   vHN2 = normalize(vEyeDirWS.xyz + vSunVectorWorld_Moon.xyz);

   specularFactor = fSpecularBlend*(pow(fSpecularBoost*saturate(float2(dot(vSurfaceNorm, vHN),fSunMoonInterpolant * dot(vSurfaceNorm, vHN2))), fSpecularPower));
   
       // Sample the water textures and determine the final color
       float4 baseColor = tex2D(Water_BaseSampler, Input.TexBase);
       float4 envColor = tex2Dbias(Water_EnvMapSampler, float4(BumpEnv.xy,0,1 * (Input.TexScreen.z/Input.TexScreen.w)));
       
       
       float4 terrainColor = baseColor;
   float fAlpha = baseColor.a;
       float4 fLand = { baseColor.a, baseColor.a, baseColor.a, baseColor.a };
       
   half fr = fresnel2( vEyeDirWS.xyz, vSurfaceNorm.xyz);

   Color = half4( lerp( baseColor.rgb * 2 * Input.vColor.rgb, envColor.rgb, fr ), 1);
//    return Color;

   return float4(lerp(Color.xyz + (vSunDirectional * specularFactor.x * 0.5) + (0.3 * (specularFactor.y)).xxx, terrainColor.xyz, fLand),fAlpha);
}

// ------- 3.0 ----------
float4 Water30PS(VSWATER20_OUTPUT Input) : COLOR
{
       return Water20PS(Input,true);
}

// ------- 2.0 ----------


float4 Water20PS(VSWATER20_OUTPUT Input) : COLOR
{
       return Water20PS(Input,false);
}

// ------ VS ------
VSWATER20_OUTPUT Water20VS(VSWATER20_INPUT Input)
{
       return Water20VS(Input,false);
}



Too make water more reflective, change the following in the line close to the bottom of the list:

Color = half4( lerp( baseColor.rgb * 2 * <-------------- Change this to * 1 *

That setting tends to boost color so changing it and how it may look will depend on the water you are using (default or other)



NOTE: THIS IS ONLY FOR DX9! All these edits are for DX9. Pwheeler is working on a possible DX10 mod as well.




Title: Re: FSWC's on halt
Post by Alrot on Dec 23rd, 2007 at 2:16pm

NickN wrote on Dec 23rd, 2007 at 1:51pm:
UPDATE

Apparently Pwheeler over at AVSIM has taken this a step further and added code to address specular sun reflections, and, remove the moon glow from water which was annoying. It also reduces the reflective surface at higher altitudes but still allows them at lower, as water should display. Its not perfect but you can try the new code here:


aww Nick :-/ , what's pwheeler? well , Is this would change the nice moves and shining day of the watter like in the shot above? will be affected,  ..but I didn't check(saw) how was the reflex of the sun and the moon... :-/ Im confuse

Title: Re: FSWC's on halt
Post by NickN on Dec 23rd, 2007 at 2:41pm

alrot wrote on Dec 23rd, 2007 at 2:16pm:

NickN wrote on Dec 23rd, 2007 at 1:51pm:
UPDATE

Apparently Pwheeler over at AVSIM has taken this a step further and added code to address specular sun reflections, and, remove the moon glow from water which was annoying. It also reduces the reflective surface at higher altitudes but still allows them at lower, as water should display. Its not perfect but you can try the new code here:


aww Nick :-/ , what's pwheeler? well , Is this would change the nice moves and shining day of the watter like in the shot above? will be affected,  ..but I didn't check(saw) how was the reflex of the sun and the moon... :-/ Im confuse



All I can say is try it Alrot. Follow the same directions I posted for the first edit.. You can always go back to the one you like..  :)

I like the second one for several reasons. It is the one I am using for the recent water shots I posted. There are some things about it I do not like but I do not have time right now to go through the code and play with it.


When ever str!ker gets back on the ball he may be able to work with it and his interface

Title: Re: FSWC's on halt
Post by NickN on Dec 23rd, 2007 at 2:52pm


Also, what it removes is the "glow' the moon makes on the entire water surface. I did not check it for the reflection on the moon itself





If you want the code which keeps all the moon glow but updates the rest, you can use this which I just edited special for you:




Code:
//---------------------------------------------------------------------------
// Flight Simulator X - Shader Effect Files
// Copyright (c) 2006, Microsoft Corporation
//---------------------------------------------------------------------------
#include <Common.fxh>
#include <MaterialDecl.fxh>
#include <D3D9Texture.fxh>
#include <FuncLibrary.fxh>

#define vLightDir vSunVectorWorld

// Potential textures
texture Water_BaseTexture               : MATERIAL_BASE_TEXTURE;
texture Water_EnvTexture                : MATERIAL_ENVIRONMENT_TEXTURE;
texture Water_BumpTexture               : MATERIAL_BUMP_TEXTURE;

// Global variables
float3 vCamEyePoint : VIEWPOSITION;

float fTimeScale        : WATER_BUMP_TIME_SCALE;            
float fBumpScale        : WATER_BUMP_SCALE;          
float fBumpUVScale      : WATER_BUMP_UV_SCALE;      
float fBumpU            : WATER_BUMP_DISTANCE_SCALE;
float fBumpV            : WATER_BUMP_LIGHT_SCALE;    
float fFresnelFactorMin : WATER_FRESNEL_FACTOR_MIN;  
float fFresnelFactorMax : WATER_FRESNEL_FACTOR_MAX;  
float fSpecularPower    : SPECULAR_POWER;            
float fSpecularBoost    : SPECULAR_BOOST;            
float fSpecularBlend    : SPECULAR_BLEND;            
float fBumpRotation     : WATER_BUMP_ROTATION;      
float fBumpTimeX1       : WATER_BUMP_TIME_X1;        
float fBumpTimeY1       : WATER_BUMP_TIME_Y1;        
float fBumpTimeX2       : WATER_BUMP_TIME_X2;        
float fBumpTimeY2       : WATER_BUMP_TIME_Y2;        
float fBumpTimeScale2   : WATER_BUMP_TIME_SCALE_2;  

// Samples used by this shader
sampler Water_BaseSampler = sampler_state
{
   Texture       = (Water_BaseTexture);
   AddressU      = Clamp;      // terrain textures must be clamped
   AddressV      = Clamp;
   MinFilter     = (State_MinFilter);
   MagFilter     = (State_MagFilter);
   MipFilter     = (State_MipFilter);
   MipMapLodBias = (State_MipMapLodBias);
};

sampler Water_BumpSampler = sampler_state
{
   Texture       = (Water_BumpTexture);
   AddressU      = Wrap;
   AddressV      = Wrap;
   AddressW      = Wrap;
   MinFilter     = D3DTEXF_LINEAR;
   MagFilter     = D3DTEXF_LINEAR;
   MipFilter     = D3DTEXF_LINEAR;
   MipMapLodBias = (State_MipMapLodBias);
};

sampler Water_EnvMapSampler = sampler_state
{
   Texture       = (Water_EnvTexture);
   AddressU      = Clamp;
   AddressV      = Clamp;
   MinFilter     = (State_MinFilter);
   MagFilter     = (State_MagFilter);
   MipFilter     = (State_MipFilter);
   MipMapLodBias = (State_MipMapLodBias);
};

struct VSWATER20_INPUT
{
   float4 vPos       : POSITION;
   float4 vColor     : COLOR0;
   float3 vNormal    : NORMAL;
   float2 vTex       : TEXCOORD0;
};

struct VSWATER20_OUTPUT
{
   float4  vPos                : POSITION;
   float   fFog                : FOG;
   half4   vColor              : COLOR0;

   float4 TexBump        : TEXCOORD0;
   float4 TexEnvMap      : TEXCOORD1;
   float4 TexBase        : TEXCOORD2;
   float4 MiscData               : TEXCOORD3;
   float3 vNormalWS      : TEXCOORD4;
   float3 vPosWS                 : TEXCOORD5;
   float3 vEyePosWS      : TEXCOORD6;
   float4 TexScreen      : TEXCOORD7;
};

#define fresnMin 0.05
#define fresnMax 0.5

half fresnel2( half3 vEyeDir, half3 vSurfaceNorm )
{
 half frdot = min( 1 - dot(vEyeDir, vSurfaceNorm), 1 );
 return lerp( fresnMin, fresnMax, frdot * frdot );
}

VSWATER20_OUTPUT Water20VS(const VSWATER20_INPUT v,const bool b30Shader)
{
   VSWATER20_OUTPUT o = (VSWATER20_OUTPUT)0;

   // Transform to clip space
   o.vPos = mul(v.vPos, mFullProj);

   // Compute fog
   o.fFog = ComputeFog(o.vPos.w, FOG_END, FOG_RECIP, FOG_SELECT_VERTEX, FOG_SELECT_TABLE);

       // Transform to world space
       float3 vWorldPos = mul(v.vPos, mWorld);

   // Compute eye vector
       float3 vEye = normalize(vCamEyePoint - vWorldPos);
       
       // Scale normal based bump based on dist
       //float fNormalScale = max(1.0,length(vEye)-fBumpDistScale);

   // Scale bumpmap texture coordinates by detail coordinates
       //float2 bmp = fmod(v.vPos.xz * (fBumpUVScale * 0.0001f),1024.0f);      
       float2 bmp = fmod((vWorldPos.xz + float2(fBumpU, fBumpV) - mWorld[3].xz) * (fBumpUVScale * 0.0001f),256.0f);    
       float2 sc = float2(sin(fBumpRotation),cos(fBumpRotation));
       if (b30Shader)
       {
               o.TexBump.xy = bmp + (fSimTime * fBumpTimeScale2)*float2(fBumpTimeX1,fBumpTimeY1);
               o.TexBump.zw = (bmp*fBumpScale) + ((fSimTime * fBumpTimeScale2)*float2(fBumpTimeX2,fBumpTimeY2))/2.0f;
               o.TexBump.zw = float2(o.TexBump.z * sc.y - o.TexBump.w * sc.x, o.TexBump.z * sc.x + o.TexBump.w * sc.y);
       }
       else
       {
               o.TexBump.xy = bmp + (fSimTime * fTimeScale)*float2(0.4,-0.4);
               o.TexBump.zw = (bmp*fBumpScale) + ((fSimTime * fTimeScale)*float2(-1.0,1.0))/2.0f;
               o.TexBump.zw = float2(o.TexBump.z * sc.y - o.TexBump.w * sc.x, o.TexBump.z * sc.x + o.TexBump.w * sc.y);
       }    

       // Send out interpolated normal for lighting
   o.vNormalWS = normalize(TransformVectorToSpace(v.vNormal, mWorld));

       // Send out eye pos
       o.vPosWS    = vWorldPos;
       o.vEyePosWS = vCamEyePoint;

       // Output vertex color straight to PS
       // The alpha component is used to represent the relative
       // depth of the water, used in computing water translucenty
       // The color component is simply the color scaled by the
       // diffuse sun lighting component
   o.vColor.a = v.vColor.a;
   o.vColor.rgb = 0.5/*( 1 - fresnel2(vSunVectorWorld_Sun.xyz, o.vNormalWS.xyz) ) * 0.5*/;

   // Environment mapping is determined from the screen-space coordinates
   // of our geometry. This implies that we need to divide them by W, and then
   // offset/scale into a 0-1 range. Because of interpolation issues due to front
   // clipped geometry, the info is pre-processed and passed to the PS where the 1/W
   // is applied. We also apply the normal to the data to emulate reflections caused
   // by the animating geometry
   o.TexEnvMap.xyz = o.vPos.xyz+o.vPos.www;
//    o.TexEnvMap.xyz = o.vPos.xyz+o.vPos.www*(1.0+0.25*o.vNormalWS.xzy/fNormalScale);
   o.TexEnvMap.w = 2.0*o.vPos.w;
   o.TexScreen.xyz = float3(1,-1,1)*o.vPos.xyz+o.vPos.www;
   o.TexScreen.w = 2.0*o.vPos.w;

   // Diffuse texture coordinates
   o.TexBase.xy = v.vTex;

   // Compute per-poly fresnel
       o.MiscData.x = 1.0 - lerp(fFresnelFactorMin, fFresnelFactorMax, pow(smoothstep(0,1,saturate(-normalize(vWorldPos).y)),0.5));
       o.MiscData.y = 0;
       o.MiscData.z = 0;
       o.MiscData.w = 0;

   return o;
}

float4 Water20PS(VSWATER20_OUTPUT Input, const bool b30Shader) : COLOR
{
   float4 Bump;
   float2 BumpEnv;
   float4 Color;
       float2 specularFactor;

   // Renomalize the input vectors and determine the
   // eye vector for lighting and reflection
   float3 vEyeDirWS;
   vEyeDirWS = normalize(Input.vEyePosWS - Input.vPosWS);
       
   
   // Sample the base color and bumpmaps
   // Since this is essentially a texbem style operation, we
   // manually apply the matrix to the bumpmap values, we then
   // scale our envmap texcoords by 1/W before factoring in the
   // bumpmap
       float3 vSurfaceNorm;
   if (b30Shader)
   {
           Bump = tex2Dbias(Water_BumpSampler, float4(Input.TexBump.xy,0,-2.0f))
                    + tex2Dbias(Water_BumpSampler, float4(Input.TexBump.zw,0,-3.0f));
           Bump = normalize(Bump-1.0f);
           vSurfaceNorm = Bump.xzy;
           BumpEnv = (Input.TexEnvMap.xy/Input.TexEnvMap.w)+ (0.2f*Bump.xy);
   }
   else
   {
           Bump = tex2Dbias(Water_BumpSampler, float4(Input.TexBump.xy,0,-2.0f))
                    + tex2Dbias(Water_BumpSampler, float4(Input.TexBump.zw,0,-3.0f));
           Bump = normalize(Bump-1.0f);
           vSurfaceNorm = Bump.xzy;
           BumpEnv = (Input.TexEnvMap.xy/Input.TexEnvMap.w)+ (0.2f*Bump.xy);
   }

       // Compute the diffuse lighting component of the water.
       float3 vHN;
       float3 vHN2;

   vHN = normalize(vEyeDirWS.xyz + vSunVectorWorld_Sun.xyz);
   vHN2 = normalize(vEyeDirWS.xyz + vSunVectorWorld_Moon.xyz);

   specularFactor = fSpecularBlend*(pow(fSpecularBoost*saturate(float2(dot(vSurfaceNorm, vHN),fSunMoonInterpolant * dot(vSurfaceNorm, vHN2))), fSpecularPower));
   
       // Sample the water textures and determine the final color
       float4 baseColor = tex2D(Water_BaseSampler, Input.TexBase);
       float4 envColor = tex2Dbias(Water_EnvMapSampler, float4(BumpEnv.xy,0,1 * (Input.TexScreen.z/Input.TexScreen.w)));
       
       
       float4 terrainColor = baseColor;
   float fAlpha = baseColor.a;
       float4 fLand = { baseColor.a, baseColor.a, baseColor.a, baseColor.a };
       
   half fr = fresnel2( vEyeDirWS.xyz, vSurfaceNorm.xyz);

   Color = half4( lerp( baseColor.rgb * 2 * Input.vColor.rgb, envColor.rgb, fr ), 1);
//    return Color;

   return float4(lerp(Color.xyz + (vSunDirectional * specularFactor.x * 0.5) + (0.3 * (specularFactor.y + saturate(dot(vSunVectorWorld_Moon,vSurfaceNorm)))).xxx, terrainColor.xyz, fLand),fAlpha);
}


// ------- 3.0 ----------
float4 Water30PS(VSWATER20_OUTPUT Input) : COLOR
{
       return Water20PS(Input,true);
}

// ------- 2.0 ----------


float4 Water20PS(VSWATER20_OUTPUT Input) : COLOR
{
       return Water20PS(Input,false);
}

// ------ VS ------
VSWATER20_OUTPUT Water20VS(VSWATER20_INPUT Input)
{
       return Water20VS(Input,false);
}






=========================================================





NOTE TO Str!ker:

The code that pwhweeler added to the original is as follows:



Color = half4( lerp( baseColor.rgb * 2 *Input.vColor.rgb, envColor.rgb, fr ), 1);
//    return Color;

   return float4(lerp(Color.xyz + (vSunDirectional * specularFactor.x * .5)+ (0.3 * (specularFactor.y)).xxx, terrainColor.xyz, fLand),fAlpha);
}


which also removes the moon glow but leaves the moon reflection at lower altitude

and he edited the main values as such:

#define fresnMin 0.05
#define fresnMax 0.5


It does require the original code edit be in the file as well:


#define fresnMin x.x
#define fresnMax x.x

half fresnel2( half3 vEyeDir, half3 vSurfaceNorm )
{
 half frdot = min( 1 - dot(vEyeDir, vSurfaceNorm), 1 );
 return lerp( fresnMin, fresnMax, frdot * frdot );
}


and toward the bottom the original code edit,


   half fr = fresnel2( vEyeDirWS.xyz, vSurfaceNorm.xyz);






Title: Re: FSWC's on halt
Post by Alrot on Dec 23rd, 2007 at 3:14pm
Ok I add ne number one as you said ,I think I see less reflective (Not sure) do you mean the reflect of the sun in the nose of the 747?




Now Eventhough everything seem fine I don't know about this ,I delete all the inside of the terrain folder,the one from shaders Take a closer look ,where are the rest of the files Compare Both Nick..

http://www.simviation.com/yabbuploads/menosfilas.JPG

are this night textures?

Title: Re: FSWC's on halt
Post by NickN on Dec 23rd, 2007 at 3:32pm


Yes, it cuts down on the FLASH the sun makes on the water until you get to lower altitude. Now you see the sun when it is overhead instead of a huge flash of white pixels.

As I saidm there are things I like about it and do not like about it. The 2nd one I posted on the last page of the thread which I edited just for you has the moon glow back in it but leaves the upgraded specular reflection as shown in your shot.


Waves depend on several factors including your video card. If you do not like what you see, simply go back to the one you like and that works for you.




As for the files in the terrain shader folder, dont worry Alex. In SP2 they are written to that folder as you fly and as they are called up so the folder will fill up the longer you fly and in different shader environment calls.




Title: Re: FSWC's on halt
Post by Alrot on Dec 23rd, 2007 at 4:03pm

NickN wrote on Dec 23rd, 2007 at 3:32pm:
Yes, it cuts down on the FLASH the sun makes on the water until you get to lower altitude. Now you see the sun when it is overhead instead of a huge flash of white pixels.

. The 2nd one I posted on the last page of the thread which I edited just for you has the moon glow back in it but leaves the upgraded specular reflection as shown in your shot.




As for the files in the terrain shader folder, dont worry Alex. In SP2 they are written to that folder as you fly and as they are called up so the folder will fill up the longer you fly and in different shader environment calls.



You Correct Nick ,  So the sistem will create a file when It requires ,Now I get it Thanks Buddy

This is a shot in the night ,see the moon , I ll think im going to run few test (specialy sunrising very early when the sun and the moon are showing in the east, reflection on the water then Ill pick one of these cfg Thanks





Title: Re: FSWC's on halt
Post by NickN on Dec 23rd, 2007 at 4:13pm


Remember, as you go lower in altitude, the sun and moon reflection should still span across the water as it does in real life. That fix corrected the fact that the sun and moon was producing the low altitude reflection at higher altitudes. As I said, its not perfect and as you increase the water slider, it does make a difference, especially with terrain reflecting off the water. Less flicker and better flow is seen.



Title: Re: FSWC's on halt
Post by Alrot on Dec 23rd, 2007 at 4:32pm

NickN wrote on Dec 23rd, 2007 at 4:13pm:
Remember, as you go lower in altitude, the sun and moon reflection should still span across the water as it does in real life. That fix corrected the fact that the sun and moon was producing the low altitude reflection at higher altitudes. As I said, its not perfect and as you increase the water slider, it does make a difference, especially with terrain reflecting off the water. Less flicker and better flow is seen.


Like this  8-) 8-) 8-)


:-/ I'm going to modified ans wipe some images in this thread(Rules), But I got to show you this  BEEEatiful Nick!!!! :D...almost 800 feet




Nah its 5 Images per thread ..I wipe just one :P

This is the one ,the new one ,I'll stay with the new one  8-)

Title: Re: FSWC's on halt
Post by NickN on Dec 23rd, 2007 at 4:36pm


Leave them Alex, they are under 500k total


Just dont post anymore   ;D  ;)

Title: Re: FSWC's on halt
Post by Str1ker on Dec 23rd, 2007 at 11:20pm
Let me try to understand, my edit did work?  As in, you actually had water, rather than a flat sky-shaded surface?

I'm really confused at the moment, but if what I sort of understand is true, then this low-angle/high-angle reflection thing could still be possible for SP2?

I think you'll have to give me a brief explanation of what's happened, and then a long explanation (brief one for general idea, then long to give me all the details).

I'll also need to know what values are changeable, in the sense that a program, like FSWC, could edit these values to change the general look of the water.

And finally, I don't suppose there are registry values which state whether or not FSX is SP2 or not?

Thanks, and sorry about my computer hating me and blowing up on me guys...

Title: Re: FSWC's on halt
Post by NickN on Dec 23rd, 2007 at 11:32pm

Ashton Lawson wrote on Dec 23rd, 2007 at 11:20pm:
Let me try to understand, my edit did work?  As in, you actually had water, rather than a flat sky-shaded surface?

I'm really confused at the moment, but if what I sort of understand is true, then this low-angle/high-angle reflection thing could still be possible for SP2?

I think you'll have to give me a brief explanation of what's happened, and then a long explanation (brief one for general idea, then long to give me all the details).

I'll also need to know what values are changeable, in the sense that a program, like FSWC, could edit these values to change the general look of the water.

And finally, I don't suppose there are registry values which state whether or not FSX is SP2 or not?

Thanks, and sorry about my computer hating me and blowing up on me guys...


There you are

Ingvarr's original code does work in the SP2 file, it just requires being placed correctly within its structure. Go back one page to the last post and you will see the original code. The additional code Pwheeler came up with adds a color boost to the RGB and it allows for control of the high/low reflections. You will see those additions noted in RED one page back. He also removed the code that allowed the 'new moon' glow on the water although that could have been corrected with the ENV files.

One thing everyone keeps focusing on is the code. The ENV files can also be altered to fix and enhance things as well which take knowledge of how they work and some Photoshop talent.

Also, the reason you first edit did not work is because I think you forgot to include the 2nd section located toward the bottom, or you may have had the wrong syntax in the code somewhere. I no longer have the test file you sent but I suspect there was an error in it somewhere.

In any case, the edits do work and the 2nd code set I posted is the full edit I currently run which I think is pretty close to excellent but it would be nice to find a way to make oceans less reflective from altitude where you can see clouds like a mirror but still maintain the better reflection at or below 500ft.

DX10 is a different shader file than the DX9. DX9 use the 20 series files, DX10 the 40 and from what I read, the test changes Pwheeler made at AVsim on the DX10 shader file did not work. In my opinion editing the DX10 version is not needed anyway because the performance hit is not there like it is in DX9.

And one other thing.. if you go back and read, this hack does not allow the better reflections with the slider bumped up without a performance hit. It’s the same hit one will get if they did not use the hack and bumped the slider up. All it does is improve the reflections and how they work but will not allow you to run 2xmed without a hit like it did in SP1.

If you want to see the visual low and high altitude results of the SP2 edits Pwheeler came up with, look here: http://www.simforums.com/forums/forum_posts.asp?TID=24248

the numbers he pre-set are very close to perfect. As you increase in altitude the reflections are no where near as smooth and distort, as they should, but its still just a too reflective from 2000ft and above, but, its 110% better than default.

Title: Re: FSWC's on halt
Post by Str1ker on Dec 27th, 2007 at 11:17pm
That's just incredible.  I'm gonna have to study this stuff intensly over the next month or so.  I need to get to know this stuff again, lol.

Thanks Nick.  Where would we be, or anyone be, without you? ;)

EDIT:
Beautiful screenies.  You still get shimmering in the distance right?  Wish we could fix that...

Title: Re: FSWC's on halt
Post by NickN on Dec 28th, 2007 at 9:26am

Ashton Lawson wrote on Dec 27th, 2007 at 11:17pm:
That's just incredible.  I'm gonna have to study this stuff intensly over the next month or so.  I need to get to know this stuff again, lol.

Thanks Nick.  Where would we be, or anyone be, without you? ;)

EDIT:
Beautiful screenies.  You still get shimmering in the distance right?  Wish we could fix that...



Very little shimmer with those edits. As I said, the edits I posted from Pwheeler are almost perfect. All that is needed is to find a way to keep ocean water from reflecting clouds like a mirror (in MED x2 + on the slider) above 1000-1500ft but keep the higher reflections below that, and it would put the icing on the cake

Title: Re: FSWC's on halt
Post by Str1ker on Dec 31st, 2007 at 12:24am

NickN wrote on Dec 28th, 2007 at 9:26am:

Ashton Lawson wrote on Dec 27th, 2007 at 11:17pm:
That's just incredible.  I'm gonna have to study this stuff intensly over the next month or so.  I need to get to know this stuff again, lol.

Thanks Nick.  Where would we be, or anyone be, without you? ;)

EDIT:
Beautiful screenies.  You still get shimmering in the distance right?  Wish we could fix that...



Very little shimmer with those edits. As I said, the edits I posted from Pwheeler are almost perfect. All that is needed is to find a way to keep ocean water from reflecting clouds like a mirror (in MED x2 + on the slider) above 1000-1500ft but keep the higher reflections below that, and it would put the icing on the cake


Cool.  Good luck with that (I can't do too much about it, I can only make teh program that edits the values).

We'll see where we end up... ;)

Title: Re: FSWC's on halt
Post by kermit on Dec 31st, 2007 at 6:50am
just tried Nick's code and the water looked much better :) good work reflections where good and the sun reflections where not pixelated at low altitude :)

great work, keep it up lads :)

kermit

Title: Re: FSWC's on halt
Post by Str1ker on Dec 31st, 2007 at 6:59am
Nick, since I don't have SP2 yet (I know it's available, but internet is a b!@tch) how modable is the water.  Are there actual values which can be finely tweaked, like with the original file, or are some of the things going to have to be on/off style controls?

Title: Re: FSWC's on halt
Post by pwheeler on Dec 31st, 2007 at 10:57am
Hi guys,

thought I'd register here as I think we're on the right course for a massive improvement in look of the water.

Firstly, I modified a version for SP2 that was done by Jase over on AVSIM. He got Ingvaars original shader mod working in SP2. I don't know if he did anything differently to you Nick to get it working in SP2.

All I did was add muliplication factors against the texture colour and the specular lighting, and also remove the entry that created that annoying moon glow. The first two are scalable so hopefully Str1ker you can add them into FSWC. Although I removed the moon glow line, it is probably scalable too by adding a multiplication factor to it rather than delete it.

There seems to be seven components to the water - base texture colour; sun diffuse lighting; moon diffuse lighting; sun specular lighting; moon specular lighting; reflections (sky (low), clouds (mid), terrain (high), autogen (max)); bump mapping.

I think these are all controlled within the shaders so theoretically they are all modifiable.

I have a few more things that I have been trying to work on. Any help would be appreciated:

1. Someone on AVSIM asked if I could remove the moon glow from DX10. This file is quite different to the DX9 file and apparently just removing the line I removed in DX9 didn't work. I havn't tried to mulitply the line instead as I don't have a DX10 GPU to test it on. Can someone with DX10 try changing this line in the water40.fx (not fxh) and add the bit in red to see if it works?:

Color = float4(lerp(Color.xyz + (g_vSunDirectional * specularFactor.x) + (0.3 * (specularFactor.y + 0.1 * saturate(dot(g_vSunVectorWorld_Moon,vSurfaceNorm)))).xxx, baseColor.xyz, fAlpha.xxxx),fAlpha);

There's alot of guess work involved as I really don't have a clue what I'm doing  ;)

2. The modification I made to the specular lighting reduces their intensity. This is not quite what I wanted to achieve. What I really wanted was to reduce the size of the specular reflections. With my mod the specular glints are not pure white, I essentially just reduced their opacity. I want them to be pure white just not such a wide area. Any ideas?

3. I've been trying to work out how to reduce the intensity of the reflections. It seems to be the envColor.rgb variable that draws the reflections. However it also seems to draw the sun diffuse lighting too and multipliying by ,say 0.3, tends to make the water too dark, although it does reduce the reflections. I'm sure that there is a line somewhere else in the shader which can be muliplied to reduce reflections without reducing the diffuse lighting.

4. What I would really like to accomplish is control over what is reflected at the different water 2x levels. i.e. have the terrain rather than the clouds reflected at water 2x mid. This should help with performance and I'd rather see the terrain reflected than the clouds. Not sure if this is controlled by the shaders. Any ideas?

5. Alot of people have noted the star reflections are way out of proportion. I imagine they are reflected in the same way as the sun, moon and sky. Any one have any ideas how we can remove them? My guess is we can't without removing the sun, moon and sky reflections too, unless they are reflected using an env map rather than what is actually in the sky.

I know the FEX guys are looking into some of these issues with regards to implimenting them in FEX, so maybe they'll come up with something.

Anyway, sorry for the long post.

Happy new year!!!

Paul

Title: Re: FSWC's on halt
Post by Str1ker on Dec 31st, 2007 at 11:50pm

pwheeler wrote on Dec 31st, 2007 at 10:57am:
Hi guys,

thought I'd register here as I think we're on the right course for a massive improvement in look of the water.

Firstly, I modified a version for SP2 that was done by Jase over on AVSIM. He got Ingvaars original shader mod working in SP2. I don't know if he did anything differently to you Nick to get it working in SP2.

All I did was add muliplication factors against the texture colour and the specular lighting, and also remove the entry that created that annoying moon glow. The first two are scalable so hopefully Str1ker you can add them into FSWC. Although I removed the moon glow line, it is probably scalable too by adding a multiplication factor to it rather than delete it.

There seems to be seven components to the water - base texture colour; sun diffuse lighting; moon diffuse lighting; sun specular lighting; moon specular lighting; reflections (sky (low), clouds (mid), terrain (high), autogen (max)); bump mapping.

I think these are all controlled within the shaders so theoretically they are all modifiable.

I have a few more things that I have been trying to work on. Any help would be appreciated:

1. Someone on AVSIM asked if I could remove the moon glow from DX10. This file is quite different to the DX9 file and apparently just removing the line I removed in DX9 didn't work. I havn't tried to mulitply the line instead as I don't have a DX10 GPU to test it on. Can someone with DX10 try changing this line in the water40.fx (not fxh) and add the bit in red to see if it works?:

Color = float4(lerp(Color.xyz + (g_vSunDirectional * specularFactor.x) + (0.3 * (specularFactor.y + 0.1 * saturate(dot(g_vSunVectorWorld_Moon,vSurfaceNorm)))).xxx, baseColor.xyz, fAlpha.xxxx),fAlpha);

There's alot of guess work involved as I really don't have a clue what I'm doing  ;)

2. The modification I made to the specular lighting reduces their intensity. This is not quite what I wanted to achieve. What I really wanted was to reduce the size of the specular reflections. With my mod the specular glints are not pure white, I essentially just reduced their opacity. I want them to be pure white just not such a wide area. Any ideas?

3. I've been trying to work out how to reduce the intensity of the reflections. It seems to be the envColor.rgb variable that draws the reflections. However it also seems to draw the sun diffuse lighting too and multipliying by ,say 0.3, tends to make the water too dark, although it does reduce the reflections. I'm sure that there is a line somewhere else in the shader which can be muliplied to reduce reflections without reducing the diffuse lighting.

4. What I would really like to accomplish is control over what is reflected at the different water 2x levels. i.e. have the terrain rather than the clouds reflected at water 2x mid. This should help with performance and I'd rather see the terrain reflected than the clouds. Not sure if this is controlled by the shaders. Any ideas?

5. Alot of people have noted the star reflections are way out of proportion. I imagine they are reflected in the same way as the sun, moon and sky. Any one have any ideas how we can remove them? My guess is we can't without removing the sun, moon and sky reflections too, unless they are reflected using an env map rather than what is actually in the sky.

I know the FEX guys are looking into some of these issues with regards to implimenting them in FEX, so maybe they'll come up with something.

Anyway, sorry for the long post.

Happy new year!!!

Paul


Hey cool, great to meet you.

I know what you mean about the specular intensity, and it's been the same with me in SP1, we can lower it's opacity, in a sense, but I'm not able to make it actually sharper, but I do have an idea.

You know how there is the bump factor right?  In SP2, I've made the assumption, by looking at the SP2 Water20.fxh, that the shader now takes into account actual changing values by the game, rather than the old shader constants used in SP1.  I thought this meant that the water would actually change it's look depending on conditions, like wind, or cloud coverage, stuff like that.

I don't know if that's true, but I reckon the value to change to get the specular reflection sharper, is the bump value.  When you increase the bump, you increase the apparent angle of the surfaces you are editing, thus making white parts whiter, and darker parts regular, and I think that can decrease the surface area that is white.  I'm not sure if it would work, but if it doesn't, then I suspect we'll have to edit the ocean height field to make it a lot sharper, which shouldn't be too hard, but then if it were that easy, X Graphics and FEX and all those other addons would've done that already.

I don't think we can selectively choose what is reflected, that's probably controlled by the sim, which is really unfortunate.  However, I have experienced some hickups, where I set my water to Max, and in the end, it only reflects clouds, autogen, scenery, and AI traffic, but no terrain, which I thought was really weird.  Perhaps there is a file somewhere which could define what is shown.

I've been looking at the orignal SP1 fxh file, and whilst it might not have much in common with the SP2 file, dod you notice that there is a fog value?  If fog is applied to reflections, then that should be able to control how the visible the reflections are, so increasing the fog value would make the reflections more water-coloured, and decreasing it would make it more like a mirror.  Perhaps you should experiment with that.

SP1 Water20.fxh:

Quote:
// Output vertex color straight to PS
     // The alpha component is used to represent the relative
     // depth of the water, used in computing water translucenty
     // The color component is simply the color scaled by the
     // diffuse sun lighting component
   o.vColor = float4(pow(o.vNormalWS.yyy,3),v.vColor.a);

^In this it mentions the sun lighting and depth of water.  To be honest, I don't know how the depth of water is achieved through shaders, I always though there was a set of textures which would be ocean deep/mid/shallow and tropical deep/mid/shallow, like in X Graphics.


Quote:
// Environment mapping is determined from the screen-space coordinates
   // of our geometry. This implies that we need to divide them by W, and then
   // offset/scale into a 0-1 range. Because of interpolation issues due to front
   // clipped geometry, the info is pre-processed and passed to the PS where the 1/W
   // is applied. We also apply the normal to the data to emulate reflections caused
   // by the animating geometry
   o.TexEnvMap.xyz = o.vPos.xyz+o.vPos.www;
//    o.TexEnvMap.xyz = o.vPos.xyz+o.vPos.www*(1.0+0.25*o.vNormalWS.xzy/fNormalScale);

^Now, note this refers to TexEnvMap, yet there is a part which is commented out.  I'd be interested to see what that does, so perhaps I'll test that soon.

Finally, there's this:

Quote:
float4 Water20PSNoFX(VSWATER20_OUTPUT Input) : COLOR
{
     return Water20PS(Input,false,false,false,false);
}

float4 Water20PSFX(VSWATER20_OUTPUT Input) : COLOR
{
     return Water20PS(Input,true,false,false,false);
}

float4 Water20PSNoFX3D(VSWATER20_OUTPUT Input) : COLOR
{
     return Water20PS(Input,false,true,false,false);
}

float4 Water20PSFX3D(VSWATER20_OUTPUT Input) : COLOR
{
     return Water20PS(Input,true,true,false,false);
}

float4 Water20PSNoFX_Detail(VSWATER20_OUTPUT Input) : COLOR
{
     return Water20PS(Input,false,false,true,false);
}

float4 Water20PSFX_Detail(VSWATER20_OUTPUT Input) : COLOR
{
     return Water20PS(Input,true,false,true,false);
}

float4 Water20PSNoFX3D_Detail(VSWATER20_OUTPUT Input) : COLOR
{
     return Water20PS(Input,false,true,true,false);
}

float4 Water20PSFX3D_Detail(VSWATER20_OUTPUT Input) : COLOR
{
     return Water20PS(Input,true,true,true,false);
}

float4 Water20BloomPS(VSWATER20_OUTPUT Input) : COLOR
{
     return _Water20BloomPS(Input,false);
}

float4 Water20BloomPS3D(VSWATER20_OUTPUT Input) : COLOR
{
     return _Water20BloomPS(Input,true);
}

// ------ VS ------
VSWATER20_OUTPUT Water20VSNoFX(VSWATER20_INPUT Input)
{
     return Water20VS(Input,false,false,false,false);
}

VSWATER20_OUTPUT Water20VSFX(VSWATER20_INPUT Input)
{
     return Water20VS(Input,true,false,false,false);
}

VSWATER20_OUTPUT Water20VSNoFX3D(VSWATER20_INPUT Input)
{
     return Water20VS(Input,false,true,false,false);
}

VSWATER20_OUTPUT Water20VSFX3D(VSWATER20_INPUT Input)
{
     return Water20VS(Input,true,true,false,false);
}

VSWATER20_OUTPUT Water20VSNoFX_Detail(VSWATER20_INPUT Input)
{
     return Water20VS(Input,false,false,true,false);
}

VSWATER20_OUTPUT Water20VSFX_Detail(VSWATER20_INPUT Input)
{
     return Water20VS(Input,true,false,true,false);
}

VSWATER20_OUTPUT Water20VSNoFX3D_Detail(VSWATER20_INPUT Input)
{
     return Water20VS(Input,false,true,true,false);
}

VSWATER20_OUTPUT Water20VSFX3D_Detail(VSWATER20_INPUT Input)
{
     return Water20VS(Input,true,true,true,false);
}

Long I know, but notice that each one uses different Boolean values.  I don't really know what the deal with it is, but I intend to find out.  I suspect it might have to do with what is shown in the reflection, but I'm not so sure, because I don't see any of them where they are all set to true.

Good luck man...

Title: Re: FSWC's on halt
Post by NickN on Jan 1st, 2008 at 12:21am

pwheeler wrote on Dec 31st, 2007 at 10:57am:
Hi guys,

thought I'd register here as I think we're on the right course for a massive improvement in look of the water.

Firstly, I modified a version for SP2 that was done by Jase over on AVSIM. He got Ingvaars original shader mod working in SP2. I don't know if he did anything differently to you Nick to get it working in SP2.

All I did was add muliplication factors against the texture colour and the specular lighting, and also remove the entry that created that annoying moon glow. The first two are scalable so hopefully Str1ker you can add them into FSWC. Although I removed the moon glow line, it is probably scalable too by adding a multiplication factor to it rather than delete it.

There seems to be seven components to the water - base texture colour; sun diffuse lighting; moon diffuse lighting; sun specular lighting; moon specular lighting; reflections (sky (low), clouds (mid), terrain (high), autogen (max)); bump mapping.

I think these are all controlled within the shaders so theoretically they are all modifiable.

I have a few more things that I have been trying to work on. Any help would be appreciated:

1. Someone on AVSIM asked if I could remove the moon glow from DX10. This file is quite different to the DX9 file and apparently just removing the line I removed in DX9 didn't work. I havn't tried to mulitply the line instead as I don't have a DX10 GPU to test it on. Can someone with DX10 try changing this line in the water40.fx (not fxh) and add the bit in red to see if it works?:

Color = float4(lerp(Color.xyz + (g_vSunDirectional * specularFactor.x) + (0.3 * (specularFactor.y + 0.1 * saturate(dot(g_vSunVectorWorld_Moon,vSurfaceNorm)))).xxx, baseColor.xyz, fAlpha.xxxx),fAlpha);

There's alot of guess work involved as I really don't have a clue what I'm doing  ;)

2. The modification I made to the specular lighting reduces their intensity. This is not quite what I wanted to achieve. What I really wanted was to reduce the size of the specular reflections. With my mod the specular glints are not pure white, I essentially just reduced their opacity. I want them to be pure white just not such a wide area. Any ideas?

3. I've been trying to work out how to reduce the intensity of the reflections. It seems to be the envColor.rgb variable that draws the reflections. However it also seems to draw the sun diffuse lighting too and multipliying by ,say 0.3, tends to make the water too dark, although it does reduce the reflections. I'm sure that there is a line somewhere else in the shader which can be muliplied to reduce reflections without reducing the diffuse lighting.

4. What I would really like to accomplish is control over what is reflected at the different water 2x levels. i.e. have the terrain rather than the clouds reflected at water 2x mid. This should help with performance and I'd rather see the terrain reflected than the clouds. Not sure if this is controlled by the shaders. Any ideas?

5. Alot of people have noted the star reflections are way out of proportion. I imagine they are reflected in the same way as the sun, moon and sky. Any one have any ideas how we can remove them? My guess is we can't without removing the sun, moon and sky reflections too, unless they are reflected using an env map rather than what is actually in the sky.

I know the FEX guys are looking into some of these issues with regards to implimenting them in FEX, so maybe they'll come up with something.

Anyway, sorry for the long post.

Happy new year!!!

Paul



Welcome aboard Paul and thank you for your work and the follow up. Our resident GUI programmer for this is Str1ker who also continued the work on the SP1 file project. All I did with SP2 was import the original code. I happened to come across your edits when googling for info about FSX shader code and posted what you had done here.

I am not a graphics code programmer but I do know my way around the textures somewhat. Thanks for sharing your knowledge.  :)

I see that the Dx10 rain issue was figured out  ;)

Hopefully between everyone who is chipping in with shader code edits, a good GUI programmer and perhaps some ENV texture edits we can come up with a wiz-bang water fix everyone can enjoy.

:) ;)

Title: Re: FSWC's on halt
Post by Str1ker on Jan 1st, 2008 at 12:31am

NickN wrote on Jan 1st, 2008 at 12:21am:

pwheeler wrote on Dec 31st, 2007 at 10:57am:
Hi guys,

thought I'd register here as I think we're on the right course for a massive improvement in look of the water.

Firstly, I modified a version for SP2 that was done by Jase over on AVSIM. He got Ingvaars original shader mod working in SP2. I don't know if he did anything differently to you Nick to get it working in SP2.

All I did was add muliplication factors against the texture colour and the specular lighting, and also remove the entry that created that annoying moon glow. The first two are scalable so hopefully Str1ker you can add them into FSWC. Although I removed the moon glow line, it is probably scalable too by adding a multiplication factor to it rather than delete it.

There seems to be seven components to the water - base texture colour; sun diffuse lighting; moon diffuse lighting; sun specular lighting; moon specular lighting; reflections (sky (low), clouds (mid), terrain (high), autogen (max)); bump mapping.

I think these are all controlled within the shaders so theoretically they are all modifiable.

I have a few more things that I have been trying to work on. Any help would be appreciated:

1. Someone on AVSIM asked if I could remove the moon glow from DX10. This file is quite different to the DX9 file and apparently just removing the line I removed in DX9 didn't work. I havn't tried to mulitply the line instead as I don't have a DX10 GPU to test it on. Can someone with DX10 try changing this line in the water40.fx (not fxh) and add the bit in red to see if it works?:

Color = float4(lerp(Color.xyz + (g_vSunDirectional * specularFactor.x) + (0.3 * (specularFactor.y + 0.1 * saturate(dot(g_vSunVectorWorld_Moon,vSurfaceNorm)))).xxx, baseColor.xyz, fAlpha.xxxx),fAlpha);

There's alot of guess work involved as I really don't have a clue what I'm doing  ;)

2. The modification I made to the specular lighting reduces their intensity. This is not quite what I wanted to achieve. What I really wanted was to reduce the size of the specular reflections. With my mod the specular glints are not pure white, I essentially just reduced their opacity. I want them to be pure white just not such a wide area. Any ideas?

3. I've been trying to work out how to reduce the intensity of the reflections. It seems to be the envColor.rgb variable that draws the reflections. However it also seems to draw the sun diffuse lighting too and multipliying by ,say 0.3, tends to make the water too dark, although it does reduce the reflections. I'm sure that there is a line somewhere else in the shader which can be muliplied to reduce reflections without reducing the diffuse lighting.

4. What I would really like to accomplish is control over what is reflected at the different water 2x levels. i.e. have the terrain rather than the clouds reflected at water 2x mid. This should help with performance and I'd rather see the terrain reflected than the clouds. Not sure if this is controlled by the shaders. Any ideas?

5. Alot of people have noted the star reflections are way out of proportion. I imagine they are reflected in the same way as the sun, moon and sky. Any one have any ideas how we can remove them? My guess is we can't without removing the sun, moon and sky reflections too, unless they are reflected using an env map rather than what is actually in the sky.

I know the FEX guys are looking into some of these issues with regards to implimenting them in FEX, so maybe they'll come up with something.

Anyway, sorry for the long post.

Happy new year!!!

Paul



Welcome aboard Paul and thank you for your work and the follow up. Our resident GUI programmer for this is str!ker1. All I did was import the original code. I happened to come across your edits when googling for info about FSX shader code and posted what you had done here.

I am not a graphics code programmer but I do know my way around the textures somewhat. Thanks for sharing your knowledge.  :)

I see that the Dx10 rain issue was figured out  ;)

Hopefully between everyone who is chipping in with shader code edits, a good GUI programmer and perhaps some ENV texture edits we can come up with a wiz-bang water fix everyone can enjoy.

:) ;)


Good thing you're optimistic.  I've always been a bit of a pessemist myself, but now that this project is really kicking off, I feel confident that I can get the program working, provided you guys can get the shader code sorted out.

I was also thinking, much earlier on, perhaps there would be a way of removing the star effect from Light Bloom, because our eyes don't get that, and it would improve performance, but that's for another time.

Also, I think I might be able to make my program's interface more like FSX's, so it actually looks more like a part of FSX.  Not sure if that would violate copyright or anything though, lol...

Title: Re: FSWC's on halt
Post by pwheeler on Jan 1st, 2008 at 10:06am
Hi guys,

thanks for the welcome.

I do think that we can achieve a great deal with these shader modifications and it should all be adjustable within a GUI front end like Str1ker's FSWC (which I think looks great, by the way).

As for the height of the waves affecting the specular lighting. If you use FEX and chose a choppy wave it does indeed change the amount of specular and also the reflections - as it does in the real world. However, the wave pattern does look really over the top and is not natural, especially for inland water. Its a shame the different water types do not use their own shader - imagine having different wave effects for inland and the ocean.

I know with the up and coming weather engine for FEX they have stated that the are able to change the wave effect in real time. Thus when a storm appears the sea wil get rougher. How effective this will be I don't know. Its supposed to be out in february though!

There should be a constant somewhere to define the reflectivity of the water. This might be something to do with fog. I'm not sure. There are lots of constants in the general shaders but I haven't found one that does this yet. This might effect the specular reflectivity too.

I guess its just a case of the special effects being too over the top. I am a musician and when you're in the studio there is a rule saying that when you are putting an effect on a sound, get it sounding good and then always back it off a bit. When your creating something sometimes your perspective of things goes a bit skew.

When I get a bit more time I'll dive back into the shaders and have another go.

Anyway, off to a new year dinner now. Hope you're all having a good one.


Paul

Title: Re: FSWC's on halt
Post by Str1ker on Jan 1st, 2008 at 10:20pm

Ashton Lawson wrote on Dec 31st, 2007 at 11:50pm:

pwheeler wrote on Dec 31st, 2007 at 10:57am:
Hi guys,

thought I'd register here as I think we're on the right course for a massive improvement in look of the water.

Firstly, I modified a version for SP2 that was done by Jase over on AVSIM. He got Ingvaars original shader mod working in SP2. I don't know if he did anything differently to you Nick to get it working in SP2.

All I did was add muliplication factors against the texture colour and the specular lighting, and also remove the entry that created that annoying moon glow. The first two are scalable so hopefully Str1ker you can add them into FSWC. Although I removed the moon glow line, it is probably scalable too by adding a multiplication factor to it rather than delete it.

There seems to be seven components to the water - base texture colour; sun diffuse lighting; moon diffuse lighting; sun specular lighting; moon specular lighting; reflections (sky (low), clouds (mid), terrain (high), autogen (max)); bump mapping.

I think these are all controlled within the shaders so theoretically they are all modifiable.

I have a few more things that I have been trying to work on. Any help would be appreciated:

1. Someone on AVSIM asked if I could remove the moon glow from DX10. This file is quite different to the DX9 file and apparently just removing the line I removed in DX9 didn't work. I havn't tried to mulitply the line instead as I don't have a DX10 GPU to test it on. Can someone with DX10 try changing this line in the water40.fx (not fxh) and add the bit in red to see if it works?:

Color = float4(lerp(Color.xyz + (g_vSunDirectional * specularFactor.x) + (0.3 * (specularFactor.y + 0.1 * saturate(dot(g_vSunVectorWorld_Moon,vSurfaceNorm)))).xxx, baseColor.xyz, fAlpha.xxxx),fAlpha);

There's alot of guess work involved as I really don't have a clue what I'm doing  ;)

2. The modification I made to the specular lighting reduces their intensity. This is not quite what I wanted to achieve. What I really wanted was to reduce the size of the specular reflections. With my mod the specular glints are not pure white, I essentially just reduced their opacity. I want them to be pure white just not such a wide area. Any ideas?

3. I've been trying to work out how to reduce the intensity of the reflections. It seems to be the envColor.rgb variable that draws the reflections. However it also seems to draw the sun diffuse lighting too and multipliying by ,say 0.3, tends to make the water too dark, although it does reduce the reflections. I'm sure that there is a line somewhere else in the shader which can be muliplied to reduce reflections without reducing the diffuse lighting.

4. What I would really like to accomplish is control over what is reflected at the different water 2x levels. i.e. have the terrain rather than the clouds reflected at water 2x mid. This should help with performance and I'd rather see the terrain reflected than the clouds. Not sure if this is controlled by the shaders. Any ideas?

5. Alot of people have noted the star reflections are way out of proportion. I imagine they are reflected in the same way as the sun, moon and sky. Any one have any ideas how we can remove them? My guess is we can't without removing the sun, moon and sky reflections too, unless they are reflected using an env map rather than what is actually in the sky.

I know the FEX guys are looking into some of these issues with regards to implimenting them in FEX, so maybe they'll come up with something.

Anyway, sorry for the long post.

Happy new year!!!

Paul


Hey cool, great to meet you.

I know what you mean about the specular intensity, and it's been the same with me in SP1, we can lower it's opacity, in a sense, but I'm not able to make it actually sharper, but I do have an idea.

You know how there is the bump factor right?  In SP2, I've made the assumption, by looking at the SP2 Water20.fxh, that the shader now takes into account actual changing values by the game, rather than the old shader constants used in SP1.  I thought this meant that the water would actually change it's look depending on conditions, like wind, or cloud coverage, stuff like that.

I don't know if that's true, but I reckon the value to change to get the specular reflection sharper, is the bump value.  When you increase the bump, you increase the apparent angle of the surfaces you are editing, thus making white parts whiter, and darker parts regular, and I think that can decrease the surface area that is white.  I'm not sure if it would work, but if it doesn't, then I suspect we'll have to edit the ocean height field to make it a lot sharper, which shouldn't be too hard, but then if it were that easy, X Graphics and FEX and all those other addons would've done that already.

I don't think we can selectively choose what is reflected, that's probably controlled by the sim, which is really unfortunate.  However, I have experienced some hickups, where I set my water to Max, and in the end, it only reflects clouds, autogen, scenery, and AI traffic, but no terrain, which I thought was really weird.  Perhaps there is a file somewhere which could define what is shown.

I've been looking at the orignal SP1 fxh file, and whilst it might not have much in common with the SP2 file, dod you notice that there is a fog value?  If fog is applied to reflections, then that should be able to control how the visible the reflections are, so increasing the fog value would make the reflections more water-coloured, and decreasing it would make it more like a mirror.  Perhaps you should experiment with that.

SP1 Water20.fxh:

Quote:
// Output vertex color straight to PS
     // The alpha component is used to represent the relative
     // depth of the water, used in computing water translucenty
     // The color component is simply the color scaled by the
     // diffuse sun lighting component
   o.vColor = float4(pow(o.vNormalWS.yyy,3),v.vColor.a);

^In this it mentions the sun lighting and depth of water.  To be honest, I don't know how the depth of water is achieved through shaders, I always though there was a set of textures which would be ocean deep/mid/shallow and tropical deep/mid/shallow, like in X Graphics.

[quote]// Environment mapping is determined from the screen-space coordinates
   // of our geometry. This implies that we need to divide them by W, and then
   // offset/scale into a 0-1 range. Because of interpolation issues due to front
   // clipped geometry, the info is pre-processed and passed to the PS where the 1/W
   // is applied. We also apply the normal to the data to emulate reflections caused
   // by the animating geometry
   o.TexEnvMap.xyz = o.vPos.xyz+o.vPos.www;
//    o.TexEnvMap.xyz = o.vPos.xyz+o.vPos.www*(1.0+0.25*o.vNormalWS.xzy/fNormalScale);

^Now, note this refers to TexEnvMap, yet there is a part which is commented out.  I'd be interested to see what that does, so perhaps I'll test that soon.

Finally, there's this:

Quote:
float4 Water20PSNoFX(VSWATER20_OUTPUT Input) : COLOR
{
     return Water20PS(Input,false,false,false,false);
}

float4 Water20PSFX(VSWATER20_OUTPUT Input) : COLOR
{
     return Water20PS(Input,true,false,false,false);
}

float4 Water20PSNoFX3D(VSWATER20_OUTPUT Input) : COLOR
{
     return Water20PS(Input,false,true,false,false);
}

float4 Water20PSFX3D(VSWATER20_OUTPUT Input) : COLOR
{
     return Water20PS(Input,true,true,false,false);
}

float4 Water20PSNoFX_Detail(VSWATER20_OUTPUT Input) : COLOR
{
     return Water20PS(Input,false,false,true,false);
}

float4 Water20PSFX_Detail(VSWATER20_OUTPUT Input) : COLOR
{
     return Water20PS(Input,true,false,true,false);
}

float4 Water20PSNoFX3D_Detail(VSWATER20_OUTPUT Input) : COLOR
{
     return Water20PS(Input,false,true,true,false);
}

float4 Water20PSFX3D_Detail(VSWATER20_OUTPUT Input) : COLOR
{
     return Water20PS(Input,true,true,true,false);
}

float4 Water20BloomPS(VSWATER20_OUTPUT Input) : COLOR
{
     return _Water20BloomPS(Input,false);
}

float4 Water20BloomPS3D(VSWATER20_OUTPUT Input) : COLOR
{
     return _Water20BloomPS(Input,true);
}

// ------ VS ------
VSWATER20_OUTPUT Water20VSNoFX(VSWATER20_INPUT Input)
{
     return Water20VS(Input,false,false,false,false);
}

VSWATER20_OUTPUT Water20VSFX(VSWATER20_INPUT Input)
{
     return Water20VS(Input,true,false,false,false);
}

VSWATER20_OUTPUT Water20VSNoFX3D(VSWATER20_INPUT Input)
{
     return Water20VS(Input,false,true,false,false);
}

VSWATER20_OUTPUT Water20VSFX3D(VSWATER20_INPUT Input)
{
     return Water20VS(Input,true,true,false,false);
}

VSWATER20_OUTPUT Water20VSNoFX_Detail(VSWATER20_INPUT Input)
{
     return Water20VS(Input,false,false,true,false);
}

VSWATER20_OUTPUT Water20VSFX_Detail(VSWATER20_INPUT Input)
{
     return Water20VS(Input,true,false,true,false);
}

VSWATER20_OUTPUT Water20VSNoFX3D_Detail(VSWATER20_INPUT Input)
{
     return Water20VS(Input,false,true,true,false);
}

VSWATER20_OUTPUT Water20VSFX3D_Detail(VSWATER20_INPUT Input)
{
     return Water20VS(Input,true,true,true,false);
}

Long I know, but notice that each one uses different Boolean values.  I don't really know what the deal with it is, but I intend to find out.  I suspect it might have to do with what is shown in the reflection, but I'm not so sure, because I don't see any where they are all set to true.

Good luck man...[/quote]

Just thought I'd post my post on the previus page, in case you missed, which can easily happen when we reach a new page.  If you wanna read it, I suggest going back to the previous page, since it's much easier. ;)

Title: Re: FSWC's on halt
Post by Str1ker on Jan 2nd, 2008 at 11:58pm
K, since this thread is slipping to the second page and all, I'll just set this up:

When you have an update on the water effects, call the thread 'FS Water Update' or something of the sort, so we know when to look at it.  That way we can easily spot any updates any of us make. ;)

Title: Re: FSWC's on halt
Post by Str1ker on Jan 6th, 2008 at 10:04am
One other thing guys, I can have my program auto-detect FSX's directories for various things, but I've been looking through the registry, and I can't find any way of detecting what Version of FSX is running, e.g. Clean, Service Pack 1, Service Pack 2, Acceleration, so it'd best be a prompt on application start right?

Also, one other thing, would you guys like me to try and make it look like FSX (graphically, the interface and all) or should I just keep it as regular Windows controls?

EDIT:
Just thought of a shortcut to the version detection:  Check if Water40.fx (or any other SP2/Acceleration-specific files exist).  However, I'll keep the prompt up, for those who know what they're doing ;).

Title: Re: FSWC's on halt
Post by NickN on Jan 6th, 2008 at 11:25am

Ashton Lawson wrote on Jan 6th, 2008 at 10:04am:
One other thing guys, I can have my program auto-detect FSX's directories for various things, but I've been looking through the registry, and I can't find any way of detecting what Version of FSX is running, e.g. Clean, Service Pack 1, Service Pack 2, Acceleration, so it'd best be a prompt on application start right?

Also, one other thing, would you guys like me to try and make it look like FSX (graphically, the interface and all) or should I just keep it as regular Windows controls?

EDIT:
Just thought of a shortcut to the version detection:  Check if Water40.fx (or any other SP2/Acceleration-specific files exist).  However, I'll keep the prompt up, for those who know what they're doing ;).



FSX version is in the exe file itself. I think you will find the key which shows the version and other parameters in the uninstall keys here:


[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\FlightSim_{A9729B90-D37B-4A69-B66A-7436AC1F7274}]

NOTE: Wow6432Node is only for Windows XP x64. I am not sure how it is set up in Vista because I am not on that system right now but it may be the same. For 32bit OS, eliminate the Wow6432Node

The code in the key may also be unique so you would probably be best served to have it search for a wild card or see if it ID's the key based simply on: Uninstall\FlightSim_

The data in that key includes:

"DisplayIcon"="D:\\Flight Simulator X\\fsx.exe"
"DisplayName"="Microsoft Flight Simulator X: Acceleration"
"Publisher"="Microsoft Game Studios"
"DisplayVersion"="10.0.61637.0" <--------------- I think this is what you are after however I am not sure of the previous values. You will need to look at RTM, SP1 and SP2, SP2/Accel to see what versions are registered


As for the interface, I think that is an artistic call


I do not have time to play with the shaders right now but I am monitoring the thread.




Title: Re: FSWC's on halt
Post by Str1ker on Jan 6th, 2008 at 7:57pm
Well, I've looked directly at the FSX.exe and I get exactly the same info.  The only issue is, it may sound easy to collect data on each version, but that's just it, each version includes multiple languages, whereas I need only know if the shaders are one, or the other, so I think the checking for SP2/Accel-only files will probably be good enough, and simple enough.

Then again, I could always check the actual Water20.fxh text...

Title: Re: FSWC's on halt
Post by Str1ker on Jan 8th, 2008 at 3:21am
Hey again, just to update, this is what FSWC2 looks like so far:


As I've already explained in the screenie, the buttons and such are still to be worked on, but they will hopefully look exactly like in FSX ;).

Title: Re: FSWC's on halt
Post by pwheeler on Jan 9th, 2008 at 2:58pm
Hi,

The interface looks very cool. Nice work  ;)

I had a little look at the shaders again yesterday but wasn't able to make any progress. I found a variable called fresnelramp which links to a texture - FresnelTest.bmp. I hoped that changing this might affect how the fresnel reflections change with viewing angle, but however I modified this texture it just made no difference.

Do you think I would have to clear the shader cache after I change this texture? I didn't think of that at the time...

Anyway, still trying. Hopefully I'll get a bit of time over the weekend.

Cheers

Paul

Title: Re: FSWC's on halt
Post by Str1ker on Jan 9th, 2008 at 7:55pm

pwheeler wrote on Jan 9th, 2008 at 2:58pm:
Hi,

The interface looks very cool. Nice work  ;)

I had a little look at the shaders again yesterday but wasn't able to make any progress. I found a variable called fresnelramp which links to a texture - FresnelTest.bmp. I hoped that changing this might affect how the fresnel reflections change with viewing angle, but however I modified this texture it just made no difference.

Do you think I would have to clear the shader cache after I change this texture? I didn't think of that at the time...

Anyway, still trying. Hopefully I'll get a bit of time over the weekend.

Cheers

Paul


Thanks.

Yeah fresnalramp's been in for quite a bit, but no one seems to know what it does, lol.  As for clearing the shader cache, I don't think it would make a difference, unless there is a texture cache, which I doubt.

Thanks for working hard on this :).

Title: Re: FSWC's on halt
Post by Str1ker on Jan 11th, 2008 at 8:13am
I've just got some interesting news regarding my program's new look.

Before, I was going to 'cheat' and use regular buttons, and then draw my own button images on top of them, a very crude way of getting my own, or in this case, FSX's visual style.

However, I've discovered that every control has what's known as an image list, and I, the programmer, have the ability to change that list, to any one I want.  This means I can use the button sprites from FSX and add image lists for every control I want, thus improving performance, and sounding very professional ;D.

Here's the other interesting bit of news.  When you go to aircraft selection, you know how the scroll bar is always the same length?  Well, that's just one point.  If you look just to the side of the scroll area, you can see the edge of the default Windows scroll bar.  What does this mean?  It means ACES have done what I was about to, simply draw their own things on top of the default Windows controls, lol...


EDIT:
Oh, another thing, I've also created my own message box, which can contain text, images, and buttons.  This'll serve as a base for error handling, user warnings, and various other tasks normally associated with messageboxes.  It's basically based off FSX's loading bar type screen, so again, it'll look familiar.

Title: Re: FSWC's on halt
Post by Str1ker on Jan 12th, 2008 at 6:38am


Another preview of how it looks.  Yes, I know the controls still look regluar.  That will be changed.  In fact, I promise I won't post another preview pic until the controls have changed. ;)

Title: Re: FSWC's on halt
Post by Str1ker on Jan 13th, 2008 at 10:32am
Okay, I know there's been a lot of double, triple, quadruple, whatever posting, but it's the only way the page updates, so people can get news everytime I make a breakthrough.

Anyway, I have news about the interface's visual style:

Basic:
I've worked out how to changet he images used for the controls, I need only work out how they are structered.

Elaborate (programmers or relatively smart people only):
For every visual control, there is an attribute called ImageList, so, for example:

Code:
closeButton.ImageList
closeButton.ImageList.Images.AddAt
closeButton.ImageList.Images.RemoveAt

Basically, it is what it is named.  A list of images.  Specifically images which are used when drawing the controls.  By changing the images in the list, I can create my own fancy-looking buttons, with alpha masks as well (not really alpha masks, just opaque/transparent flat masks).  However, I don't know what images are what at the moment, so I'll have to write another program to extract and save images from controls, so I can then restructure FSX's images to match the same format.  Once that's done, I shall conquer all controls!

Title: Re: FSWC's on halt
Post by NickN on Jan 14th, 2008 at 12:43pm

I played around with the shader code which included the edits pwheer made. I am not a graphics code expert by any means. I really could not find a better way to deal with the reflections. The original edits made by pwheeler were by far the best althoug i did trim them somewhat.

Unless some guru in shader code comes up with more I really think the rest of the answer lies in the ENV textures which evenutally I intend to dive into.

Like I said, I am not a shader code guru so not finding more on my part may strictly be my lack of knowledge in the code.



The interface looks good. You may want to reduce its size a bit. Seems a bit large but thats just an artisitic call  :)



Title: Re: FSWC's on halt
Post by pwheeler on Jan 14th, 2008 at 4:58pm
Hi guys,

like Nick I've been going over the water shader with a fine tooth comb. All you can manipulate regarding the reflections is the overall intensity. Unfortunately this includes the sky reflections and the fresnel modification that this shader is all about. By reducing it all you get is a flat water texture.

In order to actually improve the reflections I think we'll have to start looking at the terrain shaders. From what I can work out most of the reflections seem to be defined in these shaders although I too am no shader expert.

What we really want is to reduce the intesity of the cloud reflections and the terrain reflection while leaving the sky reflections (the bit that makes the fresnel mod look cool!) as they are. However I'm not sure this is going to be possible.

However, what may be possible is to modify what is actually reflected. As we know the different water shader settings reflect different parts of the terrain. I think this is controlled in the different terrain shader files. So it may be possible to turn off the cloud reflections. While not perfect  I think it will probably improve the look over the overly intense cloud reflections we currently have. It will hopefully improve the performance too!

I real life the amount of reflections is also dependant on the wave size and frequency. I have tried some more intense wave animations in FEX but they don't really improve it much. The higher frequency wave animations don't look too good due to the resolution I run FSX at. This would probably look much better at very high resolutions or very high Antialiasing settings.

Anyway, I'm still working on it.

Cheers, Paul.

Title: Re: FSWC's on halt
Post by Str1ker on Jan 15th, 2008 at 6:12am
If you work out the intensity of reflections, so terrain and clouds show up more or less depending on roughness, if there is no shader code way to tie them together, I can have my progam edit the values in conjunction with one another, provided it be static.  Dynamic would have to be the shader code tie ins.

Good work man.  I'll have a look at the terrain shaders as well, but I mentioned previous that there are values near the end of the Water20.fxh that have lists of boolean, like True,False,False,False, that kind of thing.

I'm gonna see what happens should I change those around, because I have a hunch that those might be the selective reflections deal.  I'm not sure, but hey, everything's worth a try ;).


NickN wrote on Jan 14th, 2008 at 12:43pm:
The interface looks good. You may want to reduce its size a bit. Seems a bit large but thats just an artisitic call  :)

Yeah, I realise it's a bit large, but I have two reasons, one of which makes the most sense, the other, just poetic:
1)  There are a lot of values to be set, or will be.
2)  75% of the world is water, so 75% of the average screen size shall be taken up by my program  ;D.

Another thing, I've recently contacted Tim Fuchs, one of the men behind REX, and I might be getting some pointers from him.  Also, I might find out some stuff about REX, so that I can make sure FSWC doesn't intefere in any way, since FSWC is really on the small scale compared to REX.

Final thing, don't you love all these acronyms?  ASX, XG, FEX, GEX, REX, FSX, SP1, SP2, UTX, FSWC, lol. <yeah, including lol>

EDIT:
I'm sure you've found this already, but just in case, I've found a file that's very interesting.  It's called 'TerrainWaterReflect.fx'.

I wonder what that would do? ;D

EDIT2:
There's a line:
ColorWriteEnable = Red | Green | Blue | Alpha;

Now, I'm going to try removing the Alpha part, because the terrain doesn't use any alpha values I don't think.  Well, if it did, it would be at the coastline, and since those are usually flat, and the normals are upwards, it should make no difference right?  (Famous last words)

EDIT3:
Hey, I just tested it, and I managed to squeeze out a little extra performance.  With my settings, no VSync or Framerate locking, default file, I got 58-60 FPS.

With my edit, removing the 'Alpha' part, I got around 61-64 FPS.  Hey hey hey. :)

And no artifacts.  As I suspected, the terrain's only alpha values are at coastlines or lakesides, which, as I've said, are usually flat.  Because of this, that part isn't really seen in the reflection, and even if it was, since the water would be reading the culled side, it wouldn't see anything, thus an alpha channel being read would be unneccesary.

Oh right, just replace this:
ColorWriteEnable = Red | Green | Blue | Alpha;
With:
ColorWriteEnable = Red | Green | Blue;

EDIT4 (I think it's 4):
Guys, guess what.

I removed the star effect from the bloom filter.  So, for those who don't like the star effect, because our eyes don't actually see it, I've removed it.  Just comment out these lines from the file 'Bloom.fx':

Code:
//-----------------------------------------------------------------------------
// Name: Star
// Type: Technique                                    
// Desc: Perform one of up to three passes composing the current star line
//-----------------------------------------------------------------------------
technique Star
<
   int    Performance = EffectPerfLevel_MaxShader20;
>
{
   pass P0
   {        
       PixelShader  = compile ps_2_0 Star();
   }

}

Title: Re: FSWC's on halt
Post by Str1ker on Jan 15th, 2008 at 9:03am
Okay, since I've made a few performance enhancements, and visual enhancements, I'm listing them.

Inrease performance when using water reflecting terrain:
Open the Shader Files 'TerrainWaterReflect.fx', 'TerrainLandWaterReflect.fx', and 'TerrainLandWaterLandDetailReflect.fx'.
In them, replace:

Code:
ColorWriteEnable = Red | Green | Blue | Alpha;

with:

Code:
//ColorWriteEnable = Red | Green | Blue | Alpha;
     ColorWriteEnable = Red | Green | Blue;

This tells the cubemap to forget processing the alpha map of the terrain, because the terrain either has no alpha map, or places where the terrain is alpha-blended are culled from the cubemap's render point.  This got me from default 58-60 FPS, to 61-64 FPS.

Increase performance with Light Bloom, by eliminating the star effect:
Open the file 'misc\Bloom.fx'.
In it, replace:

Code:
technique Star
<
   int    Performance = EffectPerfLevel_MaxShader20;
>
{
   pass P0
   {        
       PixelShader  = compile ps_2_0 Star();
   }

}

with:

Code:
//technique Star
//<
//    int    Performance = EffectPerfLevel_MaxShader20;
//>
//{
//    pass P0
//    {        
//        PixelShader  = compile ps_2_0 Star();
//    }
//
//}

I'm not sure, but the star effect is still processed, I think, however it does not actually render.  This got me from default 23-24 FPS to 24-26 FPS.
Update:  Okay, I tried elminating the actual processing of the star.  Surprisingly, that decreased framerate, so don't try that, just do as described above...


EDIT:
Another thing, we might have to rename the program to FSSC (Shader Configurator).

I've just looked at some of the cloud shader files.  Apparently each cloud has its own set of parameters, including high/mid/low area colours, used to make the cloud look more 3D.  Personally, the default clouds suck, because they look too overlappy, so I thought why don't we set the clouds to have a more generic colour, still keeping with the lighting variation, but making it more subtle, so the cloud looks smoother ;).

Title: Re: FSWC's on halt
Post by pwheeler on Jan 15th, 2008 at 4:41pm
Hey,

good work there Str1ker. I only had time for a quick test.

I tried removing the alpha entry in the shader files you suggested. Actually I tried removing it from all the other shader files there. It seemed to make no difference to the appearance of the sim. However, I didn't really notice a big fps increase either. This might be quite gpu dependant and also dependant on which water setting you're using.

Which water setting are you using Str1ker, and what is your gfx card?

I'm running a radeon X1950XT (need to beef this up a bit) on 2x low most of the time - although I test with the other 2x settings too.

Just a thought, but maybe the different terrainlandwaterreflect(etc.).fx files are related to the different water settings. Maybe 2x low calls terrainlandwaterreflect.fx and 2x mid calls terrainlandwaterdetailreflect.fx etc...

Anyway, don't have a lot of time to investigate. I should be able to have another look tomorrow night.

Keep working on it guys. We'll get there. ;)

Paul

Title: Re: FSWC's on halt
Post by Str1ker on Jan 15th, 2008 at 8:16pm
Well, my water is set to Max at the moment, and here's my specs:
E4500
2GB DDR2 667MHz RAM
GeForce 7600GS 256MB

Everyting is stock speeds.

Also, I know how to test if different settings use different files, as in TerrainWaterReflect, TerrainLandWaterReflect, Detail, blah blah blah.

In each one, only enable one colour, so, Red for one, Green for the other, then Blue.  With that, switch between different water settings (which'll be fast thankfully) and see if the cubmap colour changes. ;)

BTW, try the bloom hack, it's awesome.  No more star! :)

Title: Re: FSWC's on halt
Post by Str1ker on Jan 15th, 2008 at 9:16pm
We can change the clouds' intensities, so they don't look soo blocky:
Default Clouds


Tenth Intensity Clouds


Very subtle differences I know, so save Default into Paint, then copy the tenth one and paste is in paint.  Then just alternate between Ctrl+Z and Ctrl+V to see, essentially alternating pictures.

I know the difference is very subtle, and I mean very, but it makes things look just that little bit smoother, I feel.  I'm still experimenting with the shader though, so I might find some more little clues.

And I've decided, we should change from FSWc to FSSC for FS Shader Configurator.  In fact, since we're going for a name change, think of a better word to replace Configurator.  Preferably a word that actually exists...

Title: Re: FSWC's on halt
Post by NickN on Jan 15th, 2008 at 10:35pm
Low altitude clouds are not the issue, its when you get above 1500+ they really need to be diffused

As a matter of fact, I would be happy if the very high reflections only show at 500ft and under as they should and even then clould reflections should still be diffused.


Title: Re: FSWC's on halt
Post by Str1ker on Jan 16th, 2008 at 3:14am
Is there a way to decrease the size of the envmap for the water?

if we could, we could tell try telling the sim to use high res when close to the water, but low-res the higher you go, so it's more like a faded look, but there doesn't seem to be anywhere where you can do anything about envmap size.

the only possibility is making a plugin for fsx that changes the envmap size from within the sim itself.

oh, another thing, I just tried swapping the static reflection texture for aircraft, with the one used for water.  it doesn't work.

Title: Re: FSWC's on halt
Post by Str1ker on Jan 16th, 2008 at 7:55am
Right, Paul, Nick, this thing's for you, especially if you don't like to have to always open up the Shader Cache directory.

Download Shader Cache Clearer (8 KB)
(if you use a download manager, click cancel initially)

I've just written it, it works fine in XP, should work in Vista, should support all languages, and it should work fine in both 32 and 64-bit, so there you go. :)

Title: Re: FSWC's on halt
Post by pwheeler on Jan 16th, 2008 at 8:32pm
Couldn't unzip the file. It seems to be corrupt. Good idea though!!

I've thoroughly tested the removing alpha channel tweak and it doesn't seem to make any difference on my system. Maybe this fix is nvidia specific.

I'm beginning to think that what is reflected at the different water settings may be hard coded in the sim, which is a real shame. If it is then I don't think we'll be able to alter the intesity of the individual reflections either, just the whole thing.

I may be wrong and I'll keep looking anyway.

Paul

Title: Re: FSWC's on halt
Post by Str1ker on Jan 16th, 2008 at 9:12pm
Hold on, let me fix the zip, i have a rough idea of what's happened.

As for being hard coded into the sim, that's why I think we could make a plugin which can edit insim variables, like the envmap resolution, and stuff like that.  i dunno, maybe.

as for alpha removal thing, it does help my system, and it seems to matter, because I have seen various entries in other fx files that seem to indicate that alpha and stuff can be used, but isn't, so we'll just throw that into FSWC as a bonus, along with the cloud blending fix...

EDIT:
Zip seems fine, but I'll reupload anyway.  Also, as I mentioned, if you get a download prompt immediately when you click the link, click Cancel, so a page comes up.

EDIT2:
K, try now.  If it doesn't work, I'll RAR it...

Title: Re: FSWC's on halt
Post by Str1ker on Jan 17th, 2008 at 3:50am


Yeah, I know, the other buttons are still normal, I'm working on their sprites.

The final thing to do now, is actually have those images change when the mouse rolls over them and such, because having controls that stay the same all the time is rather silly.  We wouldn't even be able to tell if they worked!

EDIT:

Okay, I've just cracked the button code.  THere are events called button_mousedown, button_mouseenter, button_mouseleave, and a few others, which are basically events that are called when certain things happen, such as the mouse entering or leaving the control area, or perhaps the mouse button going down without setting off the click event.

Anyway, i've used the button flatstyles, and applied button backgrounds and images, which change when these events occur, but all I have to do now is write the code for every button, control, and everything else :P...

EDIT2:

Str!ker has good news, and you know it's good because Str!ker is referring to himself in the 3rd person.

My custom interface works.  My buttons and controls will all have custom looks, just like FSX, and all of them are ready to be customized.  Yes, they also work with mouse hovers, clicks, and various other things.

Because I now know how to do what I've just done, starting tomorrow, I'm going to redo the entire program, since I now know how to structure it so it is easier to understand, because at the moment, even putting comments in can't help :P.

Title: Re: FSWC's on halt
Post by NickN on Jan 17th, 2008 at 7:41pm
The SCC program works but it deletes the entire terrain folder

I suggest it not do that and only delete the contents

Also, always remember it is best to back up the original contents of anything that is to be cleared in case someone want to revert. Its always the best practice to restore to the original files and contents if someone decides to not use the product.

Dont assume that because something works for 500 that it will work for everyone. Always back things up for a full restore just in case the minority come across a serious problem.
:)

I still believe my original assessment that editing the ENV files is the key to finishing this puzzle. I am in the middle of GEX texture upgrades so I do not have time to go into them right now.



Title: Re: FSWC's on halt
Post by Str1ker on Jan 17th, 2008 at 8:25pm

NickN wrote on Jan 17th, 2008 at 7:41pm:
The SCC program works but it deletes the entire terrain folder

I suggest it not do that and only delete the contents

Also, always remember it is best to back up the original contents of anything that is to be cleared in case someone want to revert. Its always the best practice to restore to the original files and contents if someone decides to not use the product.

Dont assume that because something works for 500 that it will work for everyone. Always back things up for a full restore just in case the minority come across a serious problem.
:)

I still believe my original assessment that editing the ENV files is the key to finishing this puzzle. I am in the middle of GEX texture upgrades so I do not have time to go into them right now.


Uh, the SCC Program is just for us, so you know.  I'll make it delete the specific files only then.  I'll add backing up to that if you want (creating folders with dates and times as names, then storing backup stuff there).

As for the finish product, there is no question, FSWC, or FSSC, or whatever we call it in the end, will have a backup feature, as my previous one had.  Good thing you reminded me though, because now I have to find a place for that all-powerful button.  And I've just thought of a place, though, once again, it may take some time to add the neccesary things to simplify the import/export thingies.

As for ENV texture editing, good luck with that.  I still think the ENV is hard coded into the sim, but if we make a plugin that can edit ingame vars, then we might be able to even increase or decrease the ENV size, as well as apply effects to it and such.

Finally, I've just had an idea, that, when coupled with REX's coral ocean textures, will make people's jaws drop, and I mean really drop.  Provided I find the right variables and such.

Paul, for that secret thing I'm working on mentioned in the above paragraph, I need to know if there are any variables that represent the camera's location.  Well, of course there is, but it looks like a float3, and I don't know how to convert that back to a simple float value, so do you know of the values that are standalone?  Or is there a simple way to retrieve only one value from the camera variable?

Thanks guys this program's looking good.  Perhaps we should make the 'team' official.  Ashton Lawson, Paul Wheeler, Nick Needham.

There, let's push on,

Ashton

EDIT:

Okay, I know how to set a float3 variable, but I still don't know how to get only one value from it.

Code:
float3 SomeValue = float3(0, 2, 3);

^thats setting the first value to 0, the second to 2, and the third to 3.  Really easy.  But how do I retrieve only one of the values.

It seems that the float3 might turn into a regular float through being added together or something like that, so I could try creating my own variables, and retrieve only the values I want be multiplying two of the values by 0, so that which ever one I choose will be used, and all others won't interfere.  Of course it's all in theory, and I'm still testing.  So far though, all I get is sky colour...

Title: Re: FSWC's on halt
Post by Str1ker on Jan 18th, 2008 at 11:40am


Well, I lived up to my word (sort of anyway), and so I present the preview image with all the buttons looking the way they should, and yes, they all behave like regular buttons, changing with the mouse rollover, clicking, etc. etc. so that's great for me.  Tedious work though.

Also, just to prove that I do have transparency for the window, I've taken the shot with the window over the actual code for it.

There is one small hitch at the moment though:  You can't drag the window about.  Yeah, it's a bit weird, but in removing the form border, there is, technically, no title bar to click and drag, so, once again, I'll have to get my keyboard dirty and write some stuff to make title bar dragging work.

All the things you see there are basically ready, apart from the slider(s) and combobox.  I can take care of the slider stuff easily, same with the combo box, the only thing I don't wanna do, but will have to do, is write the code for it.  It is so tedious you will not believe, copy/paste paste paste change text from applyButton to cancelButton, etc. etc. stuff like that, then telling the draw event to update everytime something changes, and I hate it.

Good news is, once it's all done, which should be tomorrow, I'm going to start work on the splash screen, which will also do all the auto-detection for the FSX Registry, FSX Directories, FSX Shader Cache Directory, and of course, it's own directory.  Yes, I have to make my program find its own directory.  Weird huh?

Once the splash screen is done, I'll work on the message box, which will have a dedicated sub, which will be able to set the message box properties, like text, images, and buttons and whatnot, and hopefully I should be able to make it return values to tell the program what's been clicked here there and everywhere.

Once that's done, I'll actually start work on implementing the shader code changes, but before that, I'll work on the backup system, which is much more important, since I don't want people complaining about having to reinstall FSX and such, although, chances are, I'll get those anyway.

Hmmm, you know, I've just realised how much I have to do.  Now I'm not sure if I wanna do it.  Ah well, I suppose all programming projects'll be like this.  I shall push on.

Right, since this post is rediculously like, for my standards anyway, I'll just throw in some interesting shader-related things I'm working on.

So, I've had a brilliant idea to make the base water texture look 3D, in the sense that I give it depth, in the sense that I modify it so that when flying low, rather than it passing by instantly with the rest of the water, it instead seemingly moves slower, a bit like parallax backgroun scrolling in many cool-looking side shooters.  I just need to find out how to extract the camera's coordinates from a 'float3' variable type.

Also in shader news, which I think I've mentioned already, but I'll mention again anyway, is the fact that I've tried switching the static environment map with the dynamic one used for water, in an attempt to give the aircraft and buildings real reflections rather than the static stuff, e.g. you flying over flat snow, during a cloudy day, but seeing a reflection of a clear blue sky, and nice forests, which I think we can all agree is rather silly.

As for my optimization of the terrain reflection stuff, I'm still investigating if there is actually a performance increase, or it's just some weird glitch, since, so far, Paul has had no increase in performance, but I have, so I've got to look into that.

Staring at the bloom shader, I did remove the star effect, but now, for some reason, it's back, and my sun doesn't emit any bloom, so I have to check I haven't done anything wrong.  I hope I have though, that way I know I can fix it.

Finally, a word of advice.  In the 'Water20.fxh' file, do not try switching the base, bump, or environment map with each other.  Not only is it stupid, but it produces some really weird, and possibly headache-enducing results.

Okay then, I think I'm just about run dry on any advancements I've made, so see ya around guys,

Ashton

EDIT:

Okay, I have a new found hatred for trackbars (or sliders).  The way I've been doing all the fancy control stuff is basically through shortcuts.  Images for buttons, paint events for panels and forms, but guess what?  There are no image properties for trackbars, and there is no paint event.  How does that work?  How can there not be a paint event?  How designed the trackbar?  Seriously, OMFG!

Okay, I'm finished ranting, now, back to more important things.  Wait, that is the important thing...

Title: Re: FSWC's on halt
Post by pwheeler on Jan 20th, 2008 at 1:50pm
OK guys,

here's another new reflection tweak for you to try!

in the water20.fxh change the line:

return lerp( fresnMin, fresnMax, frdot * frdot)

(This is near the top just under the define fresnMax) To this:

return lerp( fresnMin, fresnMax, frdot * frdot * frdot * frdot * frdot)

This has the effect of changing the interpolation curve between fresnMin and fresnMax. The more frdot's you multiply by the more pronounced the curve.

This shifts the high intensity reflections more towards the horizon:

BEFORE


AFTER


I think it improves the reflections quite a bit. However, on my system it seems to come with a very slight performance hit. Can you guys confirm this?

Any mathematicians out there think of a way this can be done with out all the extra code? The value of frdot is between 0 and 1 and is directly related to eye angle. the lerp command returns x + s(y - x) which is basically an interpolation between x and y. In this case x = fresnMin, y = fresnMax and s = (frdot * frdot ...). If you square frdot the interpolation become a curve. If you cube frdot the curve is more pronounced etc. etc.

Anyway, its a bit more progress!  :)

By the way, has anyone noticed that only the cumulus cloud layer is reflected... If we could find where this is decided we could alter the cloud reflections completely.

I think one of the problems is the perfection of the reflections. If we could find a way to distort the reflections more I'm sure it would look fantastic!

Cheers,

Paul  ;)


Title: Re: FSWC's on halt
Post by pwheeler on Jan 20th, 2008 at 2:32pm
OK here's some more pics with the new interpolation mod.

This time with an extra two frdot's (seven in total!!!)
fresnMax = 0.4
fresnMin = 0
colourbase multiple = 1.8

What do you think...?










Title: Re: FSWC's on halt
Post by pwheeler on Jan 20th, 2008 at 3:49pm
Hi guys,

just a couple more shots with this new interpolation mod. Same settings as previous. I think it looks great! It seems to have distorted the reflections a bit so they are not so pure.







Title: Re: FSWC's on halt
Post by Str1ker on Jan 20th, 2008 at 9:09pm
DUDE!  Holy sheep!

OMFG! <in a good way>

uve done it!  you've made the water really sexy!

the clouds in the distance, the way they all slowly become more visible!

i might have to make a graph part of FSWC to edit just that curve.  or, i could change one of my sliders to rank up the percentage curved, like mid point no longer being 50, but 25 and such.  nah, i'll just divide up the slider percentages to however many frdots.

dude, ur awesome ;)

where's Nick?

Oh right, well, now I'd like you to do something for me.

I'm still making the base for my program, but that's near finished, but I'm still not quite sure about what variables have been changed and whatnot, so:

Can you please post your full 'Water20.fxh' file in a code box, but where you make changes, edits to it, put in '//1' or //2 and so on, listing the points which are changed.  After those, I'd like you to sort of explain how the value changes, and what it ends up doing.  e.g.

Code:
//1
//Stops the terrain from rendering the alpha channel to the environment map
color_whatever(Red | Green | Blue);


thanks ;)

EDIT:
just so u know, and i hope u dont mind, i've posted these screenies in the screenies section of FSW to see how people like it.

http://www.flightsimworld.com/forums/index.php?showtopic=136688

so far, replies have been positive.  even a reply from Tim (REX dude).

Title: Re: FSWC's on halt
Post by J. on Jan 21st, 2008 at 4:06am

Quote:
return lerp( fresnMin, fresnMax, frdot * frdot * frdot * frdot * frdot)


i was using that line, but it just made the water got a sort of realy pale blue but with no reflective properties.

im running SP2

Title: Re: FSWC's on halt
Post by J. on Jan 21st, 2008 at 4:23am
never mind sorted it out now, missed the ";" of the end

Title: Re: FSWC's on halt
Post by NickN on Jan 21st, 2008 at 2:41pm


Sorry guys I have been in transit the last day or so and just getting settled in. It will be a few days before I can get back to a normal schedule

@ Paul, the math is not going to help in that case, as least as far as i can see. You are adding operations to the passes and therefore any formula that is going to produce the same change based on the target code line will create the same result, however, its looking to me as if what are doing is increasing the opacity of the ENV or the reflection.

If that is the case it may still be attacked from the direction of texture instead of (or as well as) code

Unfortunately I am tied up with GEX right now and I just moved to my winter home in South Florida for the rest of the season so I do not have time to go over this right now but will look at it again and monitor the progress none the less.


Title: Re: FSWC's on halt
Post by pwheeler on Jan 21st, 2008 at 4:29pm
Hi Nick,

Hope you're having a fun time in your winter home!! Wish I had one, preferable in the carribean!

Anyway, the new added code doesn't alter the opacity. What it does is make the interpolation curve between fresnMax and fresnMin more pronounced. This has the effect of pushing the transition between these two reflection values further towards the horizon. The opacity of the reflections is still determined by these two values (I lowered fresnMax to 0.4 hense the slightly duller reflections in the screen shots).

It also has the added benefit of making the wave animation effect the reflections much more, thus making them more distorted. This creates a much more believable reflection over the sea.

By the way, I played with the old tweak of mipbias to see if I could reduce the shimmering effect in the reflections. putting mipbias=4 in the fsx.cfg seemed to reduce it a bit. I'd also imagine that a higher res, anisotropic filtering and antialiasing would also reduce the shimmer if your card can take it.

Paul

Title: Re: FSWC's on halt
Post by J. on Jan 21st, 2008 at 6:35pm
i spent a while playing around with stuff today and got some good and weird results :P

if anyone wants me to test some values for them im more than happy to help, my time free's up alot after Wednesday, so as i said more than happy to test a few things :)

good work chaps :)

Title: Re: FSWC's on halt
Post by NickN on Jan 21st, 2008 at 8:42pm

pwheeler wrote on Jan 21st, 2008 at 4:29pm:
Hi Nick,

Hope you're having a fun time in your winter home!! Wish I had one, preferable in the carribean!

Anyway, the new added code doesn't alter the opacity. What it does is make the interpolation curve between fresnMax and fresnMin more pronounced. This has the effect of pushing the transition between these two reflection values further towards the horizon. The opacity of the reflections is still determined by these two values (I lowered fresnMax to 0.4 hense the slightly duller reflections in the screen shots).

It also has the added benefit of making the wave animation effect the reflections much more, thus making them more distorted. This creates a much more believable reflection over the sea.

By the way, I played with the old tweak of mipbias to see if I could reduce the shimmering effect in the reflections. putting mipbias=4 in the fsx.cfg seemed to reduce it a bit. I'd also imagine that a higher res, anisotropic filtering and antialiasing would also reduce the shimmer if your card can take it.

Paul


72 degrees and light rain, I'll take it, especially when it will be back to 79 and sunshine in a day or so

My comment about reducing the opacity was rushed on my part and not well stated however I am in tune with what you are working with there. If there is a way to make the actual reflection texture rework that surface in conjunction with that code, as I briefly touched on here: http://www.simviation.com/cgi-bin/yabb2/YaBB.pl?num=1193094933/34#32

we can probably place more control in the tweak.

Have you tried Nhancer and setting the system up as I have noted here: http://www.simviation.com/cgi-bin/yabb2/YaBB.pl?num=1163028653/165#172

You may find most if not all your shimmers are gone.

Title: Re: FSWC's on halt
Post by Str1ker on Jan 21st, 2008 at 9:04pm
Nick, regarding the nHancer thing, I think I can do that too, with FSWC.

nHancer only edits an xml file under WINDOWS or system32.  If I duplicate what nHancer has done, I could try implementing an optimization feature into FSWC, that'll also change the FSX settings to the right ones.

You think that would be a good idea?

EDIT:
the file is C:\WINDOWS\system32\nvapps.xml
or whatever it may be for ur OS.

Title: Re: FSWC's on halt
Post by NickN on Jan 21st, 2008 at 9:12pm

Ashton Lawson wrote on Jan 21st, 2008 at 9:04pm:
Nick, regarding the nHancer thing, I think I can do that too, with FSWC.

nHancer only edits an xml file under WINDOWS or system32.  If I duplicate what nHancer has done, I could try implementing an optimization feature into FSWC, that'll also change the FSX settings to the right ones.

You think that would be a good idea?


Too much

let the software do what it is designed to do.

The more you overtake the plumbing, the easier it is to stop up the drain    

I see the shimmer issue now. Its not all a driver call. I like what the change does but it has added the shimmer problem back in we had with SP1 until min and max was defined correctly.

I will try some numbers and see what happens.

Title: Re: FSWC's on halt
Post by Str1ker on Jan 21st, 2008 at 9:30pm
k then

EDIT:

I've just installed the FSX Accel SDK.  it even has support for 3ds Max 9, convenient for me.

anyway, i'm gonna look through the variables list and stuff, see what i can find..

Title: Re: FSWC's on halt
Post by NickN on Jan 21st, 2008 at 10:21pm
Ok guys, here is your variable... try:

#define fresnMin 0.05
#define fresnMax 0.39

half fresnel2( half3 vEyeDir, half3 vSurfaceNorm )
{
 half frdot = min( 1 - dot(vEyeDir, vSurfaceNorm), 1 );
 return lerp( fresnMin, fresnMax, frdot * frdot * 0.25 );

values between 0.20 and 1.00 but I doubt you will want it above 0.40


Now, work RGB *X to lock your color tone in based on the textures you are using for water (default of FEX). I had mine at *2 but also played with a few others.

That should allow you to adjust to high/low reflection -vs- less shimmer. The higher that value, the higher the reflection/shimmer. The lower, the less reflection/shimmer but it darkens the water too.

What I posted almost eliminates the clouds (with the FEX textures I have installed) and if you add any weather to it, the water will haze as it should and it blends in.

Try fair weather and building storms, both high and low altitude

the trick after that is color tone. The textures I use are FEX theme Depths of Tropics2 (my own theme on the FEX server) which is now a bit dark but that can be adjusted

Title: Re: FSWC's on halt
Post by Str1ker on Jan 21st, 2008 at 10:30pm
man, that's good.

still, it would seem it would no longer be changing the curve, more like lowering it.  I suppose we could implement both, to give more control.

Title: Re: FSWC's on halt
Post by NickN on Jan 21st, 2008 at 10:32pm
I see the ENV textures at work here with all this. the reason I do is because i know what they look like when you swich themes and which one comes up based on the amount of cloud cover. there is room to work with the ENV's but i just do not have time right now.

:)

Give those numbers I posted a whirl and see if that doesnt melt your butter a bit     ;)

dont forget to flush the terrain folder

Title: Re: FSWC's on halt
Post by NickN on Jan 21st, 2008 at 11:09pm



Shimmer = almost none and its a slow and smooth shimmer so it runs naturally with the waves, meaning it gives certain views the right animation. I also changed my wave theme to Storm Rugged




























































Title: Re: FSWC's on halt
Post by NickN on Jan 22nd, 2008 at 12:23am




















































Title: Re: FSWC's on halt
Post by Str1ker on Jan 22nd, 2008 at 12:31am
Whoa, dude, now the reflections are really subtle, and the cloud reflections look hazy which is good.

I don't really have time for testing right now, because this trackBar is a real pain in the @$$.  The trackBar works, it's just not returning the right percentage, just because it won't divide integers properly.

So, not much shimmering you say?  That's sounds great, but I suppose that depends on your screen res.  Should be zero on mine, being 2560x1600.

Shall I post these on FSW as well?

Title: Re: FSWC's on halt
Post by NickN on Jan 22nd, 2008 at 12:48am
It can be a subtle or as harsh as you like, just work the variable in the line marked in red I provided. A .50+ will give you hard reflections, 0.20-0.40 give less. It allows you to choose based on where you are and if you want the high reflections for photo ops, etc however the hardwer the reflection the more shimmer you will get from land based objects.

I was looking for the balance between the two.

I would set the min and max as I outlined.

Fly the exact edit first and then work it from there.


You can post the first one and the last one from each post above if you wish. I kind of like #4 in the first post too.

and you may wish to play with RGB x too

I left mine at 2 and will rework the texture to find the right color. I know the rest is in the ENV now.


If you are flying in weather (building storms or real world with haze) you can easily bump the number up a notch because the overcast.env file will haze the water a bit and blend the reflections in, also eliminating shimmer.

Title: Re: FSWC's on halt
Post by Str1ker on Jan 22nd, 2008 at 1:05am
K Nick, I'll try stuff out.

In the mean time, I'd like to release the GUI only version of my program, so far, just to see if it works for everyone.  Anyone can download it, and it should look fine.

Take note, as real-looking as the slider is, it's actually a picture box with lots of coding behind it ;D.

Download (if your download manager kicks in right away, click cancel

So there, please, if you download it, and I will know, please tell me if the interface looks okay, like FSX.  Not so much artistically, but tell me if it looks weird, like your OS has taken over.

EDIT:
2 downloads already and no replies.  Just to reiterate, it doesn't do anything, I'm merely testing to see if the interface works properly...

EDIT2:
K, I'm really lost right now.  Don't get me wrong, I get the principles, but now to compile everything into one file, I am pretty lost, so, here's what I need.

Can you post your Water20.fxh file, and then list the parts that can be changed, and what their range can be, or not be, because following on from pages before, I can't seem to get where you guys are...

Title: Re: FSWC's on halt
Post by J. on Jan 22nd, 2008 at 3:54am
downloaded it, looks good
also recognised my FSX correctly (SP2/Acceleration)

good work

Title: Re: FSWC's on halt
Post by Str1ker on Jan 22nd, 2008 at 9:02am

J. wrote on Jan 22nd, 2008 at 3:54am:
downloaded it, looks good
also recognised my FSX correctly (SP2/Acceleration)

good work


one question, one statement.

Question:  Does a black border appear around the edges, where it should be transparent?

Statement:  It doesn't detect which FSX you're running, yet.

Title: Re: FSWC's on halt
Post by NickN on Jan 22nd, 2008 at 9:22am


It works fine








Title: Re: FSWC's on halt
Post by J. on Jan 22nd, 2008 at 9:23am
no black border all appears as it should :)


Title: Re: FSWC's on halt
Post by NickN on Jan 22nd, 2008 at 10:22am

Ashton Lawson wrote on Jan 22nd, 2008 at 1:05am:
EDIT2:
K, I'm really lost right now.  Don't get me wrong, I get the principles, but now to compile everything into one file, I am pretty lost, so, here's what I need.

Can you post your Water20.fxh file, and then list the parts that can be changed, and what their range can be, or not be, because following on from pages before, I can't seem to get where you guys are...



You may want to have Paul confirm things but this is what i am working with right now



Code:
//---------------------------------------------------------------------------
// Flight Simulator X - Shader Effect Files
// Copyright (c) 2006, Microsoft Corporation
//---------------------------------------------------------------------------
#include <Common.fxh>
#include <MaterialDecl.fxh>
#include <D3D9Texture.fxh>
#include <FuncLibrary.fxh>

#define vLightDir vSunVectorWorld

// Potential textures
texture Water_BaseTexture               : MATERIAL_BASE_TEXTURE;
texture Water_EnvTexture                : MATERIAL_ENVIRONMENT_TEXTURE;
texture Water_BumpTexture               : MATERIAL_BUMP_TEXTURE;

// Global variables
float3 vCamEyePoint : VIEWPOSITION;

float fTimeScale        : WATER_BUMP_TIME_SCALE;            
float fBumpScale        : WATER_BUMP_SCALE;          
float fBumpUVScale      : WATER_BUMP_UV_SCALE;      
float fBumpU            : WATER_BUMP_DISTANCE_SCALE;
float fBumpV            : WATER_BUMP_LIGHT_SCALE;    
float fFresnelFactorMin : WATER_FRESNEL_FACTOR_MIN;  
float fFresnelFactorMax : WATER_FRESNEL_FACTOR_MAX;  
float fSpecularPower    : SPECULAR_POWER;            
float fSpecularBoost    : SPECULAR_BOOST;            
float fSpecularBlend    : SPECULAR_BLEND;            
float fBumpRotation     : WATER_BUMP_ROTATION;      
float fBumpTimeX1       : WATER_BUMP_TIME_X1;        
float fBumpTimeY1       : WATER_BUMP_TIME_Y1;        
float fBumpTimeX2       : WATER_BUMP_TIME_X2;        
float fBumpTimeY2       : WATER_BUMP_TIME_Y2;        
float fBumpTimeScale2   : WATER_BUMP_TIME_SCALE_2;  

// Samples used by this shader
sampler Water_BaseSampler = sampler_state
{
   Texture       = (Water_BaseTexture);
   AddressU      = Clamp;      // terrain textures must be clamped
   AddressV      = Clamp;
   MinFilter     = (State_MinFilter);
   MagFilter     = (State_MagFilter);
   MipFilter     = (State_MipFilter);
   MipMapLodBias = (State_MipMapLodBias);
};

sampler Water_BumpSampler = sampler_state
{
   Texture       = (Water_BumpTexture);
   AddressU      = Wrap;
   AddressV      = Wrap;
   AddressW      = Wrap;
   MinFilter     = D3DTEXF_LINEAR;
   MagFilter     = D3DTEXF_LINEAR;
   MipFilter     = D3DTEXF_LINEAR;
   MipMapLodBias = (State_MipMapLodBias);
};

sampler Water_EnvMapSampler = sampler_state
{
   Texture       = (Water_EnvTexture);
   AddressU      = Clamp;
   AddressV      = Clamp;
   MinFilter     = (State_MinFilter);
   MagFilter     = (State_MagFilter);
   MipFilter     = (State_MipFilter);
   MipMapLodBias = (State_MipMapLodBias);
};

struct VSWATER20_INPUT
{
   float4 vPos       : POSITION;
   float4 vColor     : COLOR0;
   float3 vNormal    : NORMAL;
   float2 vTex       : TEXCOORD0;
};

struct VSWATER20_OUTPUT
{
   float4  vPos                : POSITION;
   float   fFog                : FOG;
   half4   vColor              : COLOR0;

   float4 TexBump        : TEXCOORD0;
   float4 TexEnvMap      : TEXCOORD1;
   float4 TexBase        : TEXCOORD2;
   float4 MiscData               : TEXCOORD3;
   float3 vNormalWS      : TEXCOORD4;
   float3 vPosWS                 : TEXCOORD5;
   float3 vEyePosWS      : TEXCOORD6;
   float4 TexScreen      : TEXCOORD7;
};

#define fresnMin 0.05
#define fresnMax 0.39

half fresnel2( half3 vEyeDir, half3 vSurfaceNorm )
{
 half frdot = min( 1 - dot(vEyeDir, vSurfaceNorm), 1 );
 return lerp( fresnMin, fresnMax, frdot * frdot * 0.25);
}

VSWATER20_OUTPUT Water20VS(const VSWATER20_INPUT v,const bool b30Shader)
{
   VSWATER20_OUTPUT o = (VSWATER20_OUTPUT)0;

   // Transform to clip space
   o.vPos = mul(v.vPos, mFullProj);

   // Compute fog
   o.fFog = ComputeFog(o.vPos.w, FOG_END, FOG_RECIP, FOG_SELECT_VERTEX, FOG_SELECT_TABLE);

       // Transform to world space
       float3 vWorldPos = mul(v.vPos, mWorld);

   // Compute eye vector
       float3 vEye = normalize(vCamEyePoint - vWorldPos);
       
       // Scale normal based bump based on dist
       //float fNormalScale = max(1.0,length(vEye)-fBumpDistScale);

   // Scale bumpmap texture coordinates by detail coordinates
       //float2 bmp = fmod(v.vPos.xz * (fBumpUVScale * 0.0001f),1024.0f);      
       float2 bmp = fmod((vWorldPos.xz + float2(fBumpU, fBumpV) - mWorld[3].xz) * (fBumpUVScale * 0.0001f),256.0f);    
       float2 sc = float2(sin(fBumpRotation),cos(fBumpRotation));
       if (b30Shader)
       {
               o.TexBump.xy = bmp + (fSimTime * fBumpTimeScale2)*float2(fBumpTimeX1,fBumpTimeY1);
               o.TexBump.zw = (bmp*fBumpScale) + ((fSimTime * fBumpTimeScale2)*float2(fBumpTimeX2,fBumpTimeY2))/2.0f;
               o.TexBump.zw = float2(o.TexBump.z * sc.y - o.TexBump.w * sc.x, o.TexBump.z * sc.x + o.TexBump.w * sc.y);
       }
       else
       {
               o.TexBump.xy = bmp + (fSimTime * fTimeScale)*float2(0.4,-0.4);
               o.TexBump.zw = (bmp*fBumpScale) + ((fSimTime * fTimeScale)*float2(-1.0,1.0))/2.0f;
               o.TexBump.zw = float2(o.TexBump.z * sc.y - o.TexBump.w * sc.x, o.TexBump.z * sc.x + o.TexBump.w * sc.y);
       }    

       // Send out interpolated normal for lighting
   o.vNormalWS = normalize(TransformVectorToSpace(v.vNormal, mWorld));

       // Send out eye pos
       o.vPosWS    = vWorldPos;
       o.vEyePosWS = vCamEyePoint;

       // Output vertex color straight to PS
       // The alpha component is used to represent the relative
       // depth of the water, used in computing water translucenty
       // The color component is simply the color scaled by the
       // diffuse sun lighting component
   o.vColor.a = v.vColor.a;
   o.vColor.rgb = 0.5/*( 1 - fresnel2(vSunVectorWorld_Sun.xyz, o.vNormalWS.xyz) ) * 0.5*/;

   // Environment mapping is determined from the screen-space coordinates
   // of our geometry. This implies that we need to divide them by W, and then
   // offset/scale into a 0-1 range. Because of interpolation issues due to front
   // clipped geometry, the info is pre-processed and passed to the PS where the 1/W
   // is applied. We also apply the normal to the data to emulate reflections caused
   // by the animating geometry
   o.TexEnvMap.xyz = o.vPos.xyz+o.vPos.www;
//    o.TexEnvMap.xyz = o.vPos.xyz+o.vPos.www*(1.0+0.25*o.vNormalWS.xzy/fNormalScale);
   o.TexEnvMap.w = 2.0*o.vPos.w;
   o.TexScreen.xyz = float3(1,-1,1)*o.vPos.xyz+o.vPos.www;
   o.TexScreen.w = 2.0*o.vPos.w;

   // Diffuse texture coordinates
   o.TexBase.xy = v.vTex;

   // Compute per-poly fresnel
       o.MiscData.x = 1.0 - lerp(fFresnelFactorMin, fFresnelFactorMax, pow(smoothstep(0,1,saturate(-normalize(vWorldPos).y)),0.5));
       o.MiscData.y = 0;
       o.MiscData.z = 0;
       o.MiscData.w = 0;

   return o;
}

float4 Water20PS(VSWATER20_OUTPUT Input, const bool b30Shader) : COLOR
{
   float4 Bump;
   float2 BumpEnv;
   float4 Color;
       float2 specularFactor;

   // Renomalize the input vectors and determine the
   // eye vector for lighting and reflection
   float3 vEyeDirWS;
   vEyeDirWS = normalize(Input.vEyePosWS - Input.vPosWS);
       
   
   // Sample the base color and bumpmaps
   // Since this is essentially a texbem style operation, we
   // manually apply the matrix to the bumpmap values, we then
   // scale our envmap texcoords by 1/W before factoring in the
   // bumpmap
       float3 vSurfaceNorm;
   if (b30Shader)
   {
           Bump = tex2Dbias(Water_BumpSampler, float4(Input.TexBump.xy,0,-2.0f))
                    + tex2Dbias(Water_BumpSampler, float4(Input.TexBump.zw,0,-3.0f));
           Bump = normalize(Bump-1.0f);
           vSurfaceNorm = Bump.xzy;
           BumpEnv = (Input.TexEnvMap.xy/Input.TexEnvMap.w)+ (0.2f*Bump.xy);
   }
   else
   {
           Bump = tex2Dbias(Water_BumpSampler, float4(Input.TexBump.xy,0,-2.0f))
                    + tex2Dbias(Water_BumpSampler, float4(Input.TexBump.zw,0,-3.0f));
           Bump = normalize(Bump-1.0f);
           vSurfaceNorm = Bump.xzy;
           BumpEnv = (Input.TexEnvMap.xy/Input.TexEnvMap.w)+ (0.2f*Bump.xy);
   }

       // Compute the diffuse lighting component of the water.
       float3 vHN;
       float3 vHN2;

   vHN = normalize(vEyeDirWS.xyz + vSunVectorWorld_Sun.xyz);
   vHN2 = normalize(vEyeDirWS.xyz + vSunVectorWorld_Moon.xyz);

   specularFactor = fSpecularBlend*(pow(fSpecularBoost*saturate(float2(dot(vSurfaceNorm, vHN),fSunMoonInterpolant * dot(vSurfaceNorm, vHN2))), fSpecularPower));
   
       // Sample the water textures and determine the final color
       float4 baseColor = tex2D(Water_BaseSampler, Input.TexBase);
       float4 envColor = tex2Dbias(Water_EnvMapSampler, float4(BumpEnv.xy,0,1 * (Input.TexScreen.z/Input.TexScreen.w)));
       
       
       float4 terrainColor = baseColor;
   float fAlpha = baseColor.a;
       float4 fLand = { baseColor.a, baseColor.a, baseColor.a, baseColor.a };
       
   half fr = fresnel2( vEyeDirWS.xyz, vSurfaceNorm.xyz);

   Color = half4( lerp( baseColor.rgb * 2 * Input.vColor.rgb, envColor.rgb, fr ), 1);
//    return Color;

   return float4(lerp(Color.xyz + (vSunDirectional * specularFactor.x * 0.5) + (0.3 * (specularFactor.y)).xxx, terrainColor.xyz, fLand),fAlpha);
}

// ------- 3.0 ----------
float4 Water30PS(VSWATER20_OUTPUT Input) : COLOR
{
       return Water20PS(Input,true);
}

// ------- 2.0 ----------


float4 Water20PS(VSWATER20_OUTPUT Input) : COLOR
{
       return Water20PS(Input,false);
}

// ------ VS ------
VSWATER20_OUTPUT Water20VS(VSWATER20_INPUT Input)
{
       return Water20VS(Input,false);
}


Items in RED are variables

#define fresnMin 0.05 Increase this and you get more land reflection but more shimmer too
#define fresnMax 0.39

These two work together somewhat I dont have a lot of time to play but the values I posted here seem to be the best overall to get rid of the clouds and control shimmers

half fresnel2( half3 vEyeDir, half3 vSurfaceNorm )
{
 half frdot = min( 1 - dot(vEyeDir, vSurfaceNorm), 1 );
 return lerp( fresnMin, fresnMax, frdot * frdot * 0.25);
}

Increase that value and you get more reflection from the sky and land, and, the water becomes brighter/more responsive to light


------

   Color = half4( lerp( baseColor.rgb * 2 * Input.vColor.rgb, envColor.rgb, fr ), 1);
//    return Color;

Decrease that value to darken the water based on the installed water textures, increase it to boost its colors

   return float4(lerp(Color.xyz + (vSunDirectional * specularFactor.x * 0.5) + (0.3 * (specularFactor.y)).xxx, terrainColor.xyz, fLand),fAlpha);
}

Deals with sun reflections. I have found .05 is pretty much dead on but there may be need to change it with other variables.

Paul can comment further since he has been playing with this much more than I and he developed the first runs so he’s more in tune with everything than I am.


The real trick after all of the above is the Water texture colors and waves installed. I raised my waves to get a much better response since I reduced the reflections. Also the color of my original water theme is now off. Lowering RGBx makes it too dark and raising it makes it to turquoise. Since I am not using the FSX default I can work the FEX colors manually but I need to find a theme that works with the above. Its close but now ocean water is too blue and inland is too emerald green.

Title: Re: FSWC's on halt
Post by Str1ker on Jan 22nd, 2008 at 10:56am
okay, thanks Nick.  I better write up a word doc outlining everything for when i start the actual modifying code.

Better start saving files and working out directories and file names as well.  dang that's a lot of work.

Again, thanks.

BTW, with those of you who have the black border problem, this might be due to visual styles being disabled (maybe, I'd have to check).

EDIT:
Nick, it may be a question of textures that you use (like FEX/REX or X Graphics) but I don't get reduced reflection shimmer or anything of the sort.  It's still same old same old.

Well, it definately looks nicer in general though.

I do have X Graphics, but I purposely reverted to FSX defaults because I wanted to see how this affected those who would only be getting FSWC, and no other payware things.  Admittedly, most people would probably get FEX or REX or the like, but still, we should work with default FSX here, not fancy addon enriched FSX.

That's my opinion anyway.  See ya tomorrow.

Title: Re: FSWC's on halt
Post by NickN on Jan 22nd, 2008 at 11:06am


@Paul... could you please look into chaning the code for RGBx

What I think this lacks and will put the icing on the cake is if we can have a Rx Bx and Gx adjustment. By doing so it will allow us to fine tune the contrast and color tone which means theme color manipulation and purchase of a payware to correct it may not be needed





Title: Re: FSWC's on halt
Post by Str1ker on Jan 22nd, 2008 at 11:18am
Nick, I've read about these float3 and float<replace with interger> variables, and it seems they're quite simple.

I can't read from them, but I can write them, e.g.

float3 RGB = float3(128,128,255);

RGB = float3(255,128,255);

I think that's how you define it's elements.  The first line I wrote would be the definition (hence float3 preceding RGB).

when you want to define the variable, you can't just input regular numbers as usual, you need to define it by using the variable type, then placing brackets around the data you want to place.
i'm not testing tonight, i'll try tomorrow, but by then you might have got it work.

guess I'll work on a triple-trackBar for color, lol...

Title: Re: FSWC's on halt
Post by J. on Jan 22nd, 2008 at 11:19am
just took a quick revision break and tested nicks file as he posted above

reverted back to default FSX water, although it looked good with XGraphics water

and i did see a noticeable difference in shimmering :)

Image 1

image 2

#1 was taken just of the welsh coast and #2 is near PAKT in Alaska

Title: Re: FSWC's on halt
Post by Str1ker on Jan 22nd, 2008 at 11:26am
ah, so I'm right, 3rd party water tends to be better in regards to shimmering.

I guess then these tweaks reduce the shimmering, and 3rd party dudes try doing that too, except they do it in textures, so the two techniques combined produces the best effect.

hmm, interesting.

Nice shots J., and thanks for the sort-of test (for shimmering)

EDIT:
Just to see what you guys think, personally I like it quite a lot, these are icons designed by Hypofx over at FSW.  Just to see what you guys think.

They are two images, one brighter, more contrasted, the other closer to the icon base colour:

Title: Re: FSWC's on halt
Post by NickN on Jan 22nd, 2008 at 11:35am

Ashton Lawson wrote on Jan 22nd, 2008 at 11:26am:
ah, so I'm right, 3rd party water tends to be better in regards to shimmering.

I guess then these tweaks reduce the shimmering, and 3rd party dudes try doing that too, except they do it in textures, so the two techniques combined produces the best effect.

hmm, interesting.

Nice shots J., and thanks for the sort-of test (for shimmering)



No

3rd party water allows better color match and if you have FEX you can also change the waves too. FEX also has a texture edit section that allows you to rework your own themes

I dont have time to play with the suggestions you made right now. If that will work for this shader file it would be nice. I was not asking for the actual RGB color numbers, I was asking for a separate RGB multiplier, meaning, the color spectrum itself is left alone and it allows each component of the spectrum to be multiplied instead of all at once


but, playing with numbers for color itself may present some added use too

Title: Re: FSWC's on halt
Post by pwheeler on Jan 22nd, 2008 at 5:16pm
Hi guys,

sorry I've been out of it. Cant' get to simviation from work and don't have alot of time in the evenings at the mo.

Anyway, good work everyone.

Nick I have tried multiplying frdot by a fraction in the past.

lerp uses the equation x + s(y - x). So when s = 0 it returns x and when s = 1 it returns y. The 'frdot * frdot' entry is 's' so by multiplying it by a fraction all you're doing is stopping it from reaching 1. Hense you are just stopping it from reaching fresnMax. It should look the same if you just reduced fresnMax.

Also while your mod looks great for the ocean it might not look so great for inland water where you want more reflections.

think of the original interpolation curve as a y = x^2 curve. (assume ^ means 'to the power of')

y = 0.5 * x^2 is a curve that only reaches 0.5 when x =1

y = x^7 is a exaggerated curve.

I think we're getting into personal taste territory here. Probably a mix of the two is whats required.

So what I suggestis that maybe Ashton can include all of these mods into FSWC with a unique name and slider for each.

Maybe 'overall reflection intesity' for your last mod Nick.

err... 'Interpolation curve' for my last one???

'Colour Intesity' for my RGB multiplyer.

Don't know how you can do a preview for each one though to see its effect. Theres' still alot of work ahead.

Nick where are the ENV textures you refer to? I have looked in the past but couldn't find anything relevant.

I will look into the RGB mulitplyer again. Shouldn't be too difficult to extract the separate RGB values and add a mulitplyer for each - although is this getting into FEX and REX territory...?

I also think that the moon glow which I removed should be scalable by  adding a multiplyer rather than removing the line.

Anyway, its starting to look really promising. Far better than the default.

I won't be around for a couple of days. I'm off to hospital for an eye operation tomorrow.  :-/ I won't be able to see much before friday.

Anyway, I'll check back as soon as I can.

Paul

Title: Re: FSWC's on halt
Post by NickN on Jan 22nd, 2008 at 6:25pm

That's strange Paul because I have never been able to get the same result I am seeing by reducing fresnMax. I always ended up chasing either the reflections or the shimmer in one place or another.

At the same time I did think it was strange you had not worked that fraction given your apparent knowledge of the code.

I will look at it further as soon as I get more time but I am almost positive I have been down the fresnMax/min road and was never able to get both/all under control with the same variable which is why when you threw out the multiple frdot, I thought perhaps a defined value may yeild a controlled return, and, I do see what you are saying about the result but I am not in tune with shader code and how one code line affects the entire return.

I do not like shimmers, at all, and although I can deal with the reflections from land (without shimmers) I do not like the clouds in the water at all.

And unless there is a way to work this based on the variable of altitude, I do not think there is a defined answer for everyone and every situation.

And if you are out over an ocean there is no reason to run high reflections anyway because there is nothing to sea  ::)  ;D

The ENV textures are in Scenery\world\texture

env_lowmoon.bmp
env_highnoon.bmp
env_overcast.bmp <--- this one is used in any weather other than clear skies, fair weather and in some cases cold fronts unless there is a layer of haze called, then, depending on how thick the layer overcast.bmp is called.

etc, etc


As for FEX, no, they only provide textures. What I am after is a way to fine tune the color boost from the shader.


ouch, sorry about the eye surgery and good luck with that!

Title: Re: FSWC's on halt
Post by Str1ker on Jan 22nd, 2008 at 7:49pm
In case you missed from the preview page, I think I know how to set the RGB thingy.

With a float3 variable, the variable has three parts to it.  In this case, with RGB that would be Red Green and Blue.  To define such a variable, you do this:


Code:
float3 RGB = float3(255,245,255);


In that case, you'd get white as the colour.  Now, to simply alter the values (not definition):


Code:
RGB = float3(255,245,255);


Okay, if you wanted to multiply it, by what you want, you can do this:


Code:
// Define RGB Multiplyer
float3 RGBMult = float3(1,1.01,1);

//Multiply RGB
RGB = RGB * RGBMult;


When two float3s are added/subtracted/multiplied/divided against each other, the values within in them will do what they need to do, but not mixed.  So in this case, it would be 255 * 1, 245 * 1.01, and 255 * 1.

Now, RGB would equal 255, 247, and 255.

EDIT:
Finally, Nick, one line of code can change everything, believe me, but if the thing that is changed is only within the subroutine, basically a definition and a set of curly brackets {}, then chances are only some things will change, unless that subroutine returns values for another subroutine, which is the most likely in this case because we're talking about shader, where it is one file controlling an entire surface, whether it be reflection the sky, or bump mapping the ground, anything.

Again, good luck with the eye, as said in the email ;).  (Difference is, I didn't put a wink smilie in the email).

Title: Re: FSWC's on halt
Post by Str1ker on Jan 22nd, 2008 at 10:30pm
Hey guys,

I've just done a Seattle shot, full settings, 8FPS, lol, of Default, and then Paul's water.  It's quite interesting, and it proves how real, or artistic you can make the water ;).

Default:


FSWC - Paul's Config:

Title: Re: FSWC's on halt
Post by pwheeler on Jan 23rd, 2008 at 4:21am
Hi guys,

just a quick one before I go under the knife!!

Looking at those pictures, our mods do seem to emphasise the wave animation. Maybe a more subtle animation would calm things down a bit.

Nick, all the lerp/frdot line does is interpolate between fresnMax and fresnMin. In the original its a curve (frdot * frdot). Frdot is related to the angle relative to the normal - a number between 0 and 1. I think 0 is vertical (fresnMin is displayed) and 1 is horizontal (fresnMax is displayed). By mulitplying it by a fraction all that happens is the shader thinks you are slightly higher than you actually are, thus showing a different mix of fresnMin and Max and never actually reaching fresnMax if you are horizontal.

Of course I'm no expert in shaders (although I'm not too bad at maths!) so I could be talking total b******t. I just researched the lerp command on the internet and worked out the rest.

Anyway, I agree about the shimmering. Its annoying. I think though that a higher antialiasing and/or anisotropic combination ahould reduce this. Of course a higher res would too.

Ashton, I saw your ideas for the RGB thing. The only thing I'm worried about is I remember during the original mod being made Ingvaar complaining that he could only add a few extra line to the shader code. I think the shader limits how many commands you can use and this shader code is already very near maximum. Again I could be quite wrong with that!

Anyway, I think the best thing would be to add all the variables we've come up with into FSWC and let the user decide whats right for them. I'm certain that different gfx card/settings will show them all differently anyway!

Right I'm off to have my eye prodded and poked! I'll try and drop by in a day or two.

Paul

Title: Re: FSWC's on halt
Post by Str1ker on Jan 23rd, 2008 at 4:59am
Good luck with teh surgery again, and don't be freaked out.  I assume you won't feel a thing, or, you won't feel pain at least.

K, i wrote something long and elaborate before, but IE closed for some reason, so I'll keep this a bit shorter.

the reason why the waves look more emphasized is because by changing the curve, it basically makes the blending more violent, thus making waves look bigger.  i could easily tie in an auto adjustment feature, however, that'd only work for FSX defaults, as opposed to many who have payware stuff like X Graphics, or FEX, or the soon to be REX.

so, it'd be best I only provide all the variables.

Also, I've been experimenting by mixing and matching Nick's * 0.25 thing with your curve adjustments.  the effects produced by different settings are quite different, and interesting, so i can including both, but we'll have to make it so that the powers are done in brackets, then nick's final multiplyer, or honestly more like divider is then performed last, to tone down the curve, dropping it in a sense.

also, my next test for  FSWC, i'll add all the sliders i can possibly think of, and i'll also add a set of water tint RGB sliders.  they can be removed if we are unable to change any multiplyers.

finally, did we ever find a way of toning down the specular reflections and stuff?  i can't remember, i had a way in my origianl FSWC, but that's SP1, so i'm not sure about now with SP2.

right, back to work, and good luck again with teh surgery ;) :o 8-).

Title: Re: FSWC's on halt
Post by J. on Jan 23rd, 2008 at 6:21am
Str1ker what did you change the variables to in your test?
im curous to what the middle of the default and your settings would look like on the RGB color line

good luck with the surgery paul

Title: Re: FSWC's on halt
Post by Str1ker on Jan 23rd, 2008 at 7:16am

J. wrote on Jan 23rd, 2008 at 6:21am:
Str1ker what did you change the variables to in your test?
im curous to what the middle of the default and your settings would look like on the RGB color line

good luck with the surgery paul


The test was simply Default config, to Paul's Config, but I didn't change any colour, only the fresnMin/Max and place seven frdot s.

Okay, another preview, I hope you like the interface now, because it took me a long time to do it, and it was really tedious as well:



Like it?  Again, they don't do nothing, but now that this is done, I can start work on the splash screen 8-).

BTW, that isn't the final text, I have to rephrase some parts, but that's basically how the end product will look.  Also, about the tint adjustment sliders, the colours were done, to try and keep the FSX theme, I merely changed the hue from 0, to 85, to 170 as the default RGB hue levels, but blue looks more purple to me.  Let me know if I should change that...

Title: Re: FSWC's on halt
Post by J. on Jan 23rd, 2008 at 7:32am
thanks striker, i was just having a play around with the variables, got it looking pretty good atm on default water however im interesting in this bit


Code:
// Define RGB Multiplyer
float3 RGBMult = float3(1,1.01,1);

//Multiply RGB
RGB = RGB * RGBMult;


just had a quick scan through the file and couldnt find any of those entires? do i add them in? if so where?

cheers
J.

Title: Re: FSWC's on halt
Post by Str1ker on Jan 23rd, 2008 at 7:49am

J. wrote on Jan 23rd, 2008 at 7:32am:
thanks striker, i was just having a play around with the variables, got it looking pretty good atm on default water however im interesting in this bit


Code:
// Define RGB Multiplyer
float3 RGBMult = float3(1,1.01,1);

//Multiply RGB
RGB = RGB * RGBMult;


just had a quick scan through the file and couldnt find any of those entires? do i add them in? if so where?

cheers
J.


Oh, no no, those are just examples of how the float3 kind of value works.  It is, in fact, how most variables work, when they require special definitions.  All I changed was the frdot curve thing, so frdot^7, and fresnMin/Max to wat Paul had it as.

also, Paul was using FEX water, I was demonstrating default water...

Title: Re: FSWC's on halt
Post by J. on Jan 23rd, 2008 at 8:00am
ah kk

Title: Re: FSWC's on halt
Post by NickN on Jan 23rd, 2008 at 8:57am

Quote:
Nick, all the lerp/frdot line does is interpolate between fresnMax and fresnMin. In the original its a curve (frdot * frdot). Frdot is related to the angle relative to the normal - a number between 0 and 1. I think 0 is vertical (fresnMin is displayed) and 1 is horizontal (fresnMax is displayed). By mulitplying it by a fraction all that happens is the shader thinks you are slightly higher than you actually are, thus showing a different mix of fresnMin and Max and never actually reaching fresnMax if you are horizontal.

Of course I'm no expert in shaders (although I'm not too bad at maths!) so I could be talking total b******t. I just researched the lerp command on the internet and worked out the rest.

Anyway, I agree about the shimmering. Its annoying. I think though that a higher antialiasing and/or anisotropic combination ahould reduce this. Of course a higher res would too.


I have jacked it up pretty high Paul, 16-32x @ 1920x1200 and the shimmer remains. Perhaps a resolution above 2000x is needed because AA @ 16-32x is not efficient at 1900.

Thanks for the rundown on the code and I see where you are saying the fraction places the output the same as fresnMax being reduced, but, I am still not seeing the exact same result on the screen by reducing it and increasing the curve.

I got the math down, I just dont get the entire relationship to the shader code and how it plays through. Looking at my screen the results I am seeing are not simply in line with a different mix of fresnMin and Max and I think there is more to it than that, however, I did see that changing the wave theme does also play into it and therefore what I am seeing here may be a result of differences in water theme(s)because I do not run default. I am also thinking color balance is playing into the mix too which is why I inquired about having the ability to tweak those values.

It is possible what the math/code suggests is exactly as it is but since there are a large list of variables in color/wave patters, drivers/settings and video adapters, the results may not appear the same.

If I could get rid of the clouds from the water I would not care about the shorelines other than the shimmers. At that point the shoreline reflections dictate the settings instead of trying to fight 2 issues at once in which one affects the other greatly.

I am slammed with GEX right now so I dont have a lot of time to tinker. We are trying to get the next GEX update out within the next 2 weeks.


You take care and I sincerely hope all goes well with your surgery.




Title: Re: FSWC's on halt
Post by Str1ker on Jan 24th, 2008 at 12:25am
Violent Waves:


Lighter Water:


Hazy Ain't It:


No Reflections:

Title: Re: FSWC's on halt
Post by Flying Mouse on Jan 24th, 2008 at 2:13am
I tested the file you posted, works fine on my system  ;)

Title: Re: FSWC's on halt
Post by Str1ker on Jan 24th, 2008 at 7:28am
Hey guys,

Okay, these'll be my last comparison shots for a month, since I'll be working hard on the main program code.  Anyway, these are some Mission moments you guys will probably remember:

Amazon Trek - Default:


Amazon Trek - FSWC:



Flour Power - Default:


Flour Power - FSWC:



Hawaiian Checkout - Default:


Hawaiian Checkout - FSWC:



Oil Rig Transport - Default:


Oil Rig Transport - FSWC:



Rocket Launch Air Cover - Default:


Rocket Launch Air Cover - FSWC:



Sugarloaf Repair - Default:


Sugarloaf Repair - FSWC:



Finally, just to clear up any confusions, FSWC will not fix problems like this:

Title: Re: FSWC's on halt
Post by Str1ker on Jan 24th, 2008 at 10:14pm
Hey guys, this is gonna sound silly, but I just found out we can change shaders during runtime.

Don't kill me...

Title: Re: FSWC's on halt
Post by J. on Jan 25th, 2008 at 8:21am
love the rig shot, water fits in really well with the situation!

so if you can change shader while in game, would it be possible to make the water stormy if a storm started?

Title: Re: FSWC's on halt
Post by pwheeler on Jan 25th, 2008 at 8:57am
Hi guys,

just to let you know the eye op went well. Still having a bit of trouble looking at a monitor and its still a bit sore.

I'll probably be able to get back into things in a day or two.

Speak soon,

Paul

P.S. interface is looking great!!!

Title: Re: FSWC's on halt
Post by NickN on Jan 25th, 2008 at 10:07am

pwheeler wrote on Jan 25th, 2008 at 8:57am:
Hi guys,

just to let you know the eye op went well. Still having a bit of trouble looking at a monitor and its still a bit sore.

I'll probably be able to get back into things in a day or two.

Speak soon,

Paul

P.S. interface is looking great!!!


1. you are alive
2. you can see
3. you are healing

Thats great to hear!

:)



Title: Re: FSWC's on halt
Post by Str1ker on Jan 25th, 2008 at 10:58am

J. wrote on Jan 25th, 2008 at 8:21am:
love the rig shot, water fits in really well with the situation!

so if you can change shader while in game, would it be possible to make the water stormy if a storm started?

if u mean seamlessly, like the program detects it the slowly blends into stormy-type water, no.

the only advantage is, u can pause, switch to another profile, or preset, apply, then when u go back to the game, the setttings have changed.  that's the best we can do at the moment.

having that done automatically would take a plugin for FSX, and I dunno how to do that.  yet...


NickN wrote on Jan 25th, 2008 at 10:07am:

pwheeler wrote on Jan 25th, 2008 at 8:57am:
Hi guys,

just to let you know the eye op went well. Still having a bit of trouble looking at a monitor and its still a bit sore.

I'll probably be able to get back into things in a day or two.

Speak soon,

Paul

P.S. interface is looking great!!!


1. you are alive
2. you can see
3. you are healing

Thats great to hear!

:)

lol, that was funny.

get well soon paul, we'll be glad to have you back ;).

ive got some kinks to work out of the interface, but otherwise all is fine.  in fact, the only kink i can think of is the combo box button not changing the status label at the bottom.

but still, im' working on registry key detection and stuff, so this program should be able to work standalone.

i'm also going to add a tree view type folder explorer, in case the program can't find the fsx registry key, or the registry key being wrong or something.

instead of plus and minus signs, or arrows on the tree view, i'll replace the vista-styled arrows with airplanes, lol.

but first things first, registry stuff.  annoying, but essential..

Title: Re: FSWC's on halt
Post by pwheeler on Jan 25th, 2008 at 6:07pm
Hi guys,

In my half blind state I've done a few comparison shots with FSWC and default. These are around Seattle to tie in with Ashtons'.

Shader settings in use - fresnMin 0.03 - FresnMax 0.4 - frdot to the power of seven - colorbase * 1.8 - no moonglow - sun specular * 0.5

FSX with Acceleration, FEX, GEX, UTX

Hope you like...

NOON:


DAWN:


SUNSET:








NIGHT:


HIGH ALTITUDE:


Paul

Title: Re: FSWC's on halt
Post by pwheeler on Jan 25th, 2008 at 6:13pm
...and some more general shots:

















Paul

Title: Re: FSWC's on halt
Post by Str1ker on Jan 25th, 2008 at 11:56pm
already replied to the screenie thread in FSW, but still, great shots.

Another thing, I'm curious about this colour multiple thing, is it what you've added or something?  I can't find mine (copied pasted from Nick's latest config after a request).

And your eyes can take the scenery, that's great.  Soon, (or maybe even already) you'll be back up to speed.

Title: Re: FSWC's on halt
Post by J. on Jan 26th, 2008 at 1:29am
good stuff, could you post your entire .fxh file please paul in a code box, beacuse those looks ace!

loved the way on sunrise/sunset shots, the suns reflections isnt a solid block, you can see the water riplling through it :)

good stuff

Title: Re: FSWC's on halt
Post by Str1ker on Jan 26th, 2008 at 2:17am
yeah, sun reflections are good.

It's just a shame that the terrain doesn't cast any real shadows.  if it did, then we wouldnt see specular reflections in shadows.

too bad we cant fix that.  if only we could apply a bloom filter, then highpass to the envmap, then we'd be able to drop the specular, as the envmap would now have all that was needed for it.

ah well, next FS maybe...

EDIT:

hey, i just thought, couldn't we manipulate the specular reflection level, depending on the sun's angle relative to the water?  we'd be a ble to ramp it up during dawn/dusk times, then fade it off during noon times.  that'd be great...

EDIT2:

Let the record show, registry editing is a pain in the @$$...

Title: Re: FSWC's on halt
Post by pwheeler on Jan 26th, 2008 at 5:19am
Hi guys,

glad you like the shots.

Here's my water20.fxh file


Code:
//---------------------------------------------------------------------------
// Flight Simulator X - Shader Effect Files
// Copyright (c) 2006, Microsoft Corporation
//---------------------------------------------------------------------------
#include <Common.fxh>
#include <MaterialDecl.fxh>
#include <D3D9Texture.fxh>
#include <FuncLibrary.fxh>

#define vLightDir vSunVectorWorld

// Potential textures
texture Water_BaseTexture               : MATERIAL_BASE_TEXTURE;
texture Water_EnvTexture                : MATERIAL_ENVIRONMENT_TEXTURE;
texture Water_BumpTexture               : MATERIAL_BUMP_TEXTURE;

// Global variables
float3 vCamEyePoint : VIEWPOSITION;

float fTimeScale        : WATER_BUMP_TIME_SCALE;            
float fBumpScale        : WATER_BUMP_SCALE;          
float fBumpUVScale      : WATER_BUMP_UV_SCALE;      
float fBumpU            : WATER_BUMP_DISTANCE_SCALE;
float fBumpV            : WATER_BUMP_LIGHT_SCALE;    
float fFresnelFactorMin : WATER_FRESNEL_FACTOR_MIN;  
float fFresnelFactorMax : WATER_FRESNEL_FACTOR_MAX;  
float fSpecularPower    : SPECULAR_POWER;            
float fSpecularBoost    : SPECULAR_BOOST;            
float fSpecularBlend    : SPECULAR_BLEND;            
float fBumpRotation     : WATER_BUMP_ROTATION;      
float fBumpTimeX1       : WATER_BUMP_TIME_X1;        
float fBumpTimeY1       : WATER_BUMP_TIME_Y1;        
float fBumpTimeX2       : WATER_BUMP_TIME_X2;        
float fBumpTimeY2       : WATER_BUMP_TIME_Y2;        
float fBumpTimeScale2   : WATER_BUMP_TIME_SCALE_2;  

// Samples used by this shader
sampler Water_BaseSampler = sampler_state
{
   Texture       = (Water_BaseTexture);
   AddressU      = Clamp;      // terrain textures must be clamped
   AddressV      = Clamp;
   MinFilter     = (State_MinFilter);
   MagFilter     = (State_MagFilter);
   MipFilter     = (State_MipFilter);
   MipMapLodBias = (State_MipMapLodBias);
};

sampler Water_BumpSampler = sampler_state
{
   Texture       = (Water_BumpTexture);
   AddressU      = Wrap;
   AddressV      = Wrap;
   AddressW      = Wrap;
   MinFilter     = D3DTEXF_LINEAR;
   MagFilter     = D3DTEXF_LINEAR;
   MipFilter     = D3DTEXF_LINEAR;
   MipMapLodBias = (State_MipMapLodBias);
};

sampler Water_EnvMapSampler = sampler_state
{
   Texture       = (Water_EnvTexture);
   AddressU      = Clamp;
   AddressV      = Clamp;
   MinFilter     = (State_MinFilter);
   MagFilter     = (State_MagFilter);
   MipFilter     = (State_MipFilter);
   MipMapLodBias = (State_MipMapLodBias);
};

struct VSWATER20_INPUT
{
   float4 vPos       : POSITION;
   float4 vColor     : COLOR0;
   float3 vNormal    : NORMAL;
   float2 vTex       : TEXCOORD0;
};

struct VSWATER20_OUTPUT
{
   float4  vPos                : POSITION;
   float   fFog                : FOG;
   half4   vColor              : COLOR0;

   float4 TexBump        : TEXCOORD0;
   float4 TexEnvMap      : TEXCOORD1;
   float4 TexBase        : TEXCOORD2;
   float4 MiscData               : TEXCOORD3;
   float3 vNormalWS      : TEXCOORD4;
   float3 vPosWS                 : TEXCOORD5;
   float3 vEyePosWS      : TEXCOORD6;
   float4 TexScreen      : TEXCOORD7;
};

#define fresnMin 0.03
#define fresnMax 0.4

half fresnel2( half3 vEyeDir, half3 vSurfaceNorm )
{
 half frdot = min( 1 - dot(vEyeDir, vSurfaceNorm), 1 );
 return lerp( fresnMin, fresnMax, frdot * frdot * frdot * frdot * frdot * frdot * frdot);
}

VSWATER20_OUTPUT Water20VS(const VSWATER20_INPUT v,const bool b30Shader)
{
   VSWATER20_OUTPUT o = (VSWATER20_OUTPUT)0;

   // Transform to clip space
   o.vPos = mul(v.vPos, mFullProj);

   // Compute fog
   o.fFog = ComputeFog(o.vPos.w, FOG_END, FOG_RECIP, FOG_SELECT_VERTEX, FOG_SELECT_TABLE);

       // Transform to world space
       float3 vWorldPos = mul(v.vPos, mWorld);

   // Compute eye vector
       float3 vEye = normalize(vCamEyePoint - vWorldPos);
       
       // Scale normal based bump based on dist
       //float fNormalScale = max(1.0,length(vEye)-fBumpDistScale);

   // Scale bumpmap texture coordinates by detail coordinates
       //float2 bmp = fmod(v.vPos.xz * (fBumpUVScale * 0.0001f),1024.0f);      
       float2 bmp = fmod((vWorldPos.xz + float2(fBumpU, fBumpV) - mWorld[3].xz) * (fBumpUVScale * 0.0001f),256.0f);    
       float2 sc = float2(sin(fBumpRotation),cos(fBumpRotation));
       if (b30Shader)
       {
               o.TexBump.xy = bmp + (fSimTime * fBumpTimeScale2)*float2(fBumpTimeX1,fBumpTimeY1);
               o.TexBump.zw = (bmp*fBumpScale) + ((fSimTime * fBumpTimeScale2)*float2(fBumpTimeX2,fBumpTimeY2))/2.0f;
               o.TexBump.zw = float2(o.TexBump.z * sc.y - o.TexBump.w * sc.x, o.TexBump.z * sc.x + o.TexBump.w * sc.y);
       }
       else
       {
               o.TexBump.xy = bmp + (fSimTime * fTimeScale)*float2(0.4,-0.4);
               o.TexBump.zw = (bmp*fBumpScale) + ((fSimTime * fTimeScale)*float2(-1.0,1.0))/2.0f;
               o.TexBump.zw = float2(o.TexBump.z * sc.y - o.TexBump.w * sc.x, o.TexBump.z * sc.x + o.TexBump.w * sc.y);
       }    

       // Send out interpolated normal for lighting
   o.vNormalWS = normalize(TransformVectorToSpace(v.vNormal, mWorld));

       // Send out eye pos
       o.vPosWS    = vWorldPos;
       o.vEyePosWS = vCamEyePoint;

       // Output vertex color straight to PS
       // The alpha component is used to represent the relative
       // depth of the water, used in computing water translucenty
       // The color component is simply the color scaled by the
       // diffuse sun lighting component
   o.vColor.a = v.vColor.a;
   o.vColor.rgb = 0.5/*( 1 - fresnel2(vSunVectorWorld_Sun.xyz, o.vNormalWS.xyz) ) * 0.5*/;

   // Environment mapping is determined from the screen-space coordinates
   // of our geometry. This implies that we need to divide them by W, and then
   // offset/scale into a 0-1 range. Because of interpolation issues due to front
   // clipped geometry, the info is pre-processed and passed to the PS where the 1/W
   // is applied. We also apply the normal to the data to emulate reflections caused
   // by the animating geometry
   o.TexEnvMap.xyz = o.vPos.xyz+o.vPos.www;
//    o.TexEnvMap.xyz = o.vPos.xyz+o.vPos.www*(1.0+0.25*o.vNormalWS.xzy/fNormalScale);
   o.TexEnvMap.w = 2.0*o.vPos.w;
   o.TexScreen.xyz = float3(1,-1,1)*o.vPos.xyz+o.vPos.www;
   o.TexScreen.w = 2.0*o.vPos.w;

   // Diffuse texture coordinates
   o.TexBase.xy = v.vTex;

   // Compute per-poly fresnel
       o.MiscData.x = 1.0 - lerp(fFresnelFactorMin, fFresnelFactorMax, pow(smoothstep(0,1,saturate(-normalize(vWorldPos).y)),0.5));
       o.MiscData.y = 0;
       o.MiscData.z = 0;
       o.MiscData.w = 0;

   return o;
}

float4 Water20PS(VSWATER20_OUTPUT Input, const bool b30Shader) : COLOR
{
   float4 Bump;
   float2 BumpEnv;
   float4 Color;
       float2 specularFactor;

   // Renomalize the input vectors and determine the
   // eye vector for lighting and reflection
   float3 vEyeDirWS;
   vEyeDirWS = normalize(Input.vEyePosWS - Input.vPosWS);
       
   
   // Sample the base color and bumpmaps
   // Since this is essentially a texbem style operation, we
   // manually apply the matrix to the bumpmap values, we then
   // scale our envmap texcoords by 1/W before factoring in the
   // bumpmap
       float3 vSurfaceNorm;
   if (b30Shader)
   {
           Bump = tex2Dbias(Water_BumpSampler, float4(Input.TexBump.xy,0,-2.0f))
                    + tex2Dbias(Water_BumpSampler, float4(Input.TexBump.zw,0,-3.0f));
           Bump = normalize(Bump-1.0f);
           vSurfaceNorm = Bump.xzy;
           BumpEnv = (Input.TexEnvMap.xy/Input.TexEnvMap.w)+ (0.2f*Bump.xy);
   }
   else
   {
           Bump = tex2Dbias(Water_BumpSampler, float4(Input.TexBump.xy,0,-2.0f))
                    + tex2Dbias(Water_BumpSampler, float4(Input.TexBump.zw,0,-3.0f));
           Bump = normalize(Bump-1.0f);
           vSurfaceNorm = Bump.xzy;
           BumpEnv = (Input.TexEnvMap.xy/Input.TexEnvMap.w)+ (0.2f*Bump.xy);
   }

       // Compute the diffuse lighting component of the water.
       float3 vHN;
       float3 vHN2;

   vHN = normalize(vEyeDirWS.xyz + vSunVectorWorld_Sun.xyz);
   vHN2 = normalize(vEyeDirWS.xyz + vSunVectorWorld_Moon.xyz);

   specularFactor = fSpecularBlend*(pow(fSpecularBoost*saturate(float2(dot(vSurfaceNorm, vHN),fSunMoonInterpolant * dot(vSurfaceNorm, vHN2))), fSpecularPower));
   
       // Sample the water textures and determine the final color
       float4 baseColor = tex2D(Water_BaseSampler, Input.TexBase);
       float4 envColor = tex2Dbias(Water_EnvMapSampler, float4(BumpEnv.xy,0,1 * (Input.TexScreen.z/Input.TexScreen.w)));
       
       
       float4 terrainColor = baseColor;
   float fAlpha = baseColor.a;
       float4 fLand = { baseColor.a, baseColor.a, baseColor.a, baseColor.a };
       
   half fr = fresnel2( vEyeDirWS.xyz, vSurfaceNorm.xyz);

   Color = half4( lerp( baseColor.rgb * 1.8 * Input.vColor.rgb, envColor.rgb, fr ), 1);
//    return Color;

   return float4(lerp(Color.xyz + (vSunDirectional * specularFactor.x * 0.5) + (0.3 * (specularFactor.y)).xxx, terrainColor.xyz, fLand),fAlpha);
}

// ------- 3.0 ----------
float4 Water30PS(VSWATER20_OUTPUT Input) : COLOR
{
       return Water20PS(Input,true);
}

// ------- 2.0 ----------


float4 Water20PS(VSWATER20_OUTPUT Input) : COLOR
{
       return Water20PS(Input,false);
}

// ------ VS ------
VSWATER20_OUTPUT Water20VS(VSWATER20_INPUT Input)
{
       return Water20VS(Input,false);
}


The changed lines are:

#define fresnMin 0.03

#define fresnMax 0.4

return lerp( fresnMin, fresnMax, frdot * frdot * frdot * frdot * frdot * frdot * frdot);
}

   Color = half4( lerp( baseColor.rgb * 1.8 * Input.vColor.rgb, envColor.rgb, fr ), 1);

   return float4(lerp(Color.xyz + (vSunDirectional * specularFactor.x * 0.5) + (0.3 * (specularFactor.y)).xxx, terrainColor.xyz, fLand),fAlpha);
}

I use the 'medium mediterrainian' wave animation in FEX with my own custom water and sky textures.

It is a shame about the terrain not casting shadows onto the water. It does cast shadows onto itself though. I wonder why this is...


Paul

Title: Re: FSWC's on halt
Post by pwheeler on Jan 26th, 2008 at 5:24am
By thw way, how do you get FSX to change the shader while its running Ashton? I tried but couldn't figure it out.

Do you realise that this may mean that the settings could be tied in with a weather engine... e.g. reduce reflections when its windy...

Paul

Title: Re: FSWC's on halt
Post by Str1ker on Jan 26th, 2008 at 6:47am

pwheeler wrote on Jan 26th, 2008 at 5:19am:
It is a shame about the terrain not casting shadows onto the water. It does cast shadows onto itself though. I wonder why this is...


Paul


Well, if you normally have terrain texture res set to 60cm, it'll be regular.  if you set it to the maximum, you'll notive the terrain won't look much better, however roads and rivers and such will.  why?  well, the terrain is basically prerendered.  the sim loads all the textures, applies masks, places roads and stuff, and hey presto, it saves that part of the terrain to memory, and begins the flight.

essentially, the terrain has no shading applied to it, it's all prerendered, like in Half-Life games, except it prerenders in real-time.  So, the shadows are done in this fashion too, it checks the normals, then checks occlusions, then darkens the parts that should be in the shadow.

though, i think that's done through teh vertex colours, not through teh textures.  still, it's prerendered, so all shadows casted by terrain are fake.


pwheeler wrote on Jan 26th, 2008 at 5:24am:
By thw way, how do you get FSX to change the shader while its running Ashton? I tried but couldn't figure it out.

Do you realise that this may mean that the settings could be tied in with a weather engine... e.g. reduce reflections when its windy...

Paul


Tee hee, my little secret... ;D ;D :-X :-X :-/ :-/ :-? :-? :D :D ;) ;)

Ah, okay, I'll tell.  K, start a Flight, like a mission.  In fact, do that, start a mission, my fav is one of the helicopter tutorial ones, the one where you must land on the carrier afterwards.  Your choice anyway.

Well, half way through, when you have a nice view of the water, reflecting something, pause the game.  Now, Alt-Tab your way to Notepad and open up the Water20.fxh file, and make any changes, then save the file.

Now, clear the shader cache.  Easiest way is to download my program for it, and I use it frequently, and have had no issues whatever.

Now, go back into FSX and you'll notice the water has changed accordingly.

The easiest way to check this is to start the flight with full reflections on the water, then when you change it, take away the reflections.  That'll prove to you that it's happened.

But remember, edit the file, then clear the cache.

Everytime you clear the cache, and then return to the sim, it automatically compiles the shader code again.  So, best change the source file first, then clear the cache, not the other way around, although it shouldn't matter too much.

Thanks for the water20.fxh file btw.

One other thing pwheeler, it could be possible to tie it in with a weather engine, but that's the thing, I pause, alt tab, then return to the sim, which is what seems to be enducing the shader reload.  I think if you have a plugin, like a weather engine doing it without closing the sim, it'll have to induce a scenery reload, which would reload the entire flight, which isn't something people like to do often...

EDIT:

Paul, let me just say, that config is incredible.  I'm using default FSX (although I do have X Graphics) and the waves really roll as I fly above them, even close to the water, it's amazing.

We might have to make that the Default settings for FSWC ;).

Title: Re: FSWC's on halt
Post by J. on Jan 27th, 2008 at 5:11am
thanks for posting that paul :) hows the eye?


Title: Re: FSWC's on halt
Post by Str1ker on Jan 27th, 2008 at 8:12am
Funny little thread, yet encouraging:
http://www.flightsimworld.com/forums/index.php?showtopic=137156

I ROFLed, but still, it's nice to know that people are eager to get their hands on it :).

EDIT:

Okay, I've got registry editing down.  Easy now, since I've written functions to be called whenever I want.  Very Convenient.

However, let me just say, retrieving environment variables is a pain.  It was easy in Visual BASIC, but now, in C#, I think they make things more complicated just for fun :P...

EDIT2:

Right, environment variables reading properly, now for file and folder checking  :P...

EDIT3:

w00t!

K, I've got all the functions I need to make my program function properly.  All I need to do now is add some error handling functions...

EDIT4:

Hey guys, I just thought, we should add multple language support.

It's easy enough to do, I simply make a languages folder, with files in them, each file named whatever language they are.

In those files, you place text, like OK, Cancel, Help, New, stuff like that, and to make a new language file, you simply replace the regular english text with foreign language text.

Good idea or no?

Title: Re: FSWC's on halt
Post by Flying Mouse on Jan 28th, 2008 at 7:41am
I cant help been a lil nosy but when will this master-piece hit the shelfs :-X

Title: Re: FSWC's on halt
Post by pwheeler on Jan 28th, 2008 at 8:57am
Hi,

I know Ashton is working really hard on the interface so hopefully it won't be too much longer. Everything is starting to come together. Its hard to be specific though. Basically as soon as humanly possible!  ;)

Paul

Title: Re: FSWC's on halt
Post by Str1ker on Jan 28th, 2008 at 9:51am
Hehe, well, my sig will basically update as I finish certain components.

But if you want a rough estimate, you ain't getting one.  I'm working hard, but this is programming, and it's hard to predict programming.

And for that reason, is why many games, these days, seem to be worse at release.  They set a deadline, then they struggle to meet it, and wind up giving the people something slightly less than wat was expected.

Anyway, these are the components:

Splash Screen
Main Form and Interface
Message Box (for error handling and stuff)
Browsing Form, incase files aren't found
Help Documentation (HTML style)

Main form is finished, everything but the help is pending ;)

Title: Re: FSWC's on halt
Post by Str1ker on Jan 28th, 2008 at 9:29pm
Okay, nothing in the list has changed, but his brief announcement you'll like to hear.

Nothing fancy, just the fact that I've begun building the program in its own directory, as if it were installed by an installer.

This is usually an indication that I'm half-way there, because the application has begun rely on other components of this project, thus meaning the program is progressing.

This is awesome news for me, because I can actually start creating folders and setting up how things work early on, and then build the program around those things ;).

Anyway, that's all I have to say really.

Happy flying :)

EDIT:
This is a rough idea of how the language file looks.  Of course, there'll much, much more stuff, but like I said, it's just a rough idea.  For different languages, you simply resave the file under the language name, e.g. 'Deutch.lng' then change the various words to their German equivalent.

Code:
Apply
Cancel
Help
<No Profile Selected>
New
Delete
Rename
Import
Export
Restore
Version:
Flight Simulator X - Clean Install/Service Pack 1
Flight Simulator X - Service Pack 2/Acceleration


Now, the profile system'll be much the same, and will look like this:

Code:
90
80
70
5
5
8
10
true


You're probably wondering what that means.  At the moment, I don't either, since that's only rough idea of what the 'Default.pfl' will contain.

I'm saying all this now, because this is kinda it.  I've begun making it's own directory and such, so if ever there were a better time to start the file formatting, this would be that time.

Oh, one last thing...

Dam, forgot the one last thing.  I'll edit if I manage to think of it.

EDIT 2:
Okay, I remember now.  I made the icon into the *.ico format.  Yay.  Anyway, I know this icon should work for all who use FSX, because what I did, was take the FSX icon, and replace all its images with my own, then resaved it, so if you have problems with your FSX icon, you'll get problems with ours too ;D.

Of course, you shouldn't have issues with the FSX icon, therefore our icon should be fine.

Title: Re: FSWC's on halt
Post by Fly2e on Jan 29th, 2008 at 9:04am
Great work guys!
Very interesting and exciting to watch this project come together!

Keep it up and thanks!

Dave

Title: Re: FSWC's on halt
Post by Str1ker on Jan 29th, 2008 at 12:11pm
Thanks man, and coming from an admin :D.

Um, not that other users' thanks aren't appreciated, hehe :).

lol, joking ;D.

Uh, sadly, no work has been done today.  I've had school, then tennis, then shear tiredness.

I'll try doing stuff tomorrow, since my entire afternoon's free.  I think I'll leave the file browser for now, and just skip to the main application's functions, regarding language, profiles, and actually modifying the shader files and backing up the already existing shader....

I'll do the file browser later on, since it probably won't be needed much, although I should still include it.  I could simply have my program say it couldn't find the right files, and leave it at that, but that'd be wrong, wouldn't it?

Title: Re: FSWC's on halt
Post by pwheeler on Jan 29th, 2008 at 4:44pm
Hi guys,

A new variable mod for you!

In water20.fxh change the line:
return float4(lerp(Color.xyz + (vSunDirectional * specularFactor.x * 0.5) + (0.3 * (specularFactor.y)).xxx, terrainColor.xyz, fLand),fAlpha);

TO:

return float4(lerp(Color.xyz + (vSunDirectional * specularFactor.x * 0.5) + (0.1 * (specularFactor.y + 0.1 * saturate(dot(vSunVectorWorld_Moon,vSurfaceNorm)))).xxx, terrainColor.xyz, fLand),fAlpha);

This puts the moon glow back in BUT -

RED = moon specular intensity

BLUE = moonglow intensity

Looks like this: (I know they are dark but it is night time!)





Also did you realise that the frdot mod also has the added bonus of reducing the annoying star reflections!

Paul

Title: Re: FSWC's on halt
Post by pwheeler on Jan 29th, 2008 at 4:46pm
Ashton,

I've tried everything but I can't get the shader cache to rebuild while the sim is running. I've tried deleting the folders (even the main shader folder) with no effect. How do you manage it?!

Paul

Title: Re: FSWC's on halt
Post by Str1ker on Jan 29th, 2008 at 8:09pm

pwheeler wrote on Jan 29th, 2008 at 4:46pm:
Ashton,

I've tried everything but I can't get the shader cache to rebuild while the sim is running. I've tried deleting the folders (even the main shader folder) with no effect. How do you manage it?!

Paul


Still?

Okay, do exactly as I say:

1)  Download my Shader Cache Clearer (from pages way back)
2)  Start FSX, and go into a mission
3)  Pause FSX, and get back to the desktop
4)  Edit the Water20.fxh file, perhaps eliminate all reflections (just so you can tell if it's changed)
5)  Start my Shader Cache Clearer, hit the magic button, and a message at the bottom should say the cache is cleared.  Click the button a second time to confirm the cache now doesn't exist.
6)  Start Flight Simulator again.

BTW, are you running fullscreen?

EDIT:

Just a couple of things.

Firstly, the splashscreen sort of overlaps the main screen on startup, because the main screen is the parent, and the splash can't really exist without it.  At the moment.

That basically means I've got the form loading properly, and I actually get to it, so I can start intense work on the profile system.

The language system, however, I won't start just yet, since that requires I finish off my message box, which, as you may have guessed, isn't finished.

Finally, I dunno who did it, but thanks to one of the mods or admins, (Fly2e?) for renaming this thread more appropriately :D.

Right, I must get back to work. ;)

EDIT2:

Sorry Paul, missed the info on the new vars for editing, since I was addressing your runtime shader compiling.

I need to ask, should the last sliders by for colour tint?  Or should I replace them with more useful vars?

Also, since I haven't got to work on the preview section, I can now make a slideshow type display, where it sort of scrolls along, but springy style, so it pauses at each image.  It'll be slide formatted, and I've decided on this since it's better to show multiple situations, like mountains, lakes, cities, etc. so the user has a better idea of what exactly they're changing ;).

Man I gotta stop adding stuff before it gets too complicated ;D.

Title: Re: FSWC's back in progress!
Post by Str1ker on Jan 30th, 2008 at 5:19am
Hey,

when our website goes up, whenever that may be, perhaps I'll add an advice section regarding programming.  Might, might not, you never know.

I'd just like to say, to any programmers out there who are just starting out, if you come across a problem, that you have to work around, or solve, and it's really complicated, never push yourself.

Only go at it when you feel like doing it.  Don't even leave it, the moment you feel like doing it, just do it, don't put it off for the afternoon, just do it immediately.

So many times I've thought, right, I'm gonna do this, I wait for 10 mins, I get to it, and by then I've lost the will.

Just a little advice.  Probably not that many new programmers looking at this, but if you are, that is really good advice right there... :)

I'm tired, I'm gonna play FS now, leave FSWC for tomorrow... :P :-/ ::) :)

Title: Re: FSWC's back in progress!
Post by NickN on Jan 30th, 2008 at 6:33am



I dont like that funky over-saturated stuff. i go for the realistic looks  :)

Just give me 3 frdot's, a fresn Mn/Mx of .05 over .4, a good rum'n coke, and I am tickled pink





Title: Re: FSWC's back in progress!
Post by Str1ker on Jan 30th, 2008 at 6:44am

NickN wrote on Jan 30th, 2008 at 6:33am:
I dont like that funky over-saturated stuff. i go for the realistic looks  :)

Just give me 3 frdot's, a fresn Mn/Mx of .05 over .4, a good rum'n coke, and I am tickled pink




Dude, that shot is something I wanna see in motion ;).

Anyway, I think my shader thing was a bit of luck initially, but here's a definate way to change shaders during runtime.

Pause FSX.

Alt + Enter to enter windowed mode.

Make Changes.

Clear Cache.

Open FSX again.

Alt + Enter to go back to fullscreen.

^Guaranteed and tested.^

EDIT:

Oh, because I'm having a little fun with FSX now, and no longer taking screenies of Default textures with FSWC, I'm playing around with X Graphics now (until I get my hands on REX), and provided the base textures you use are fairly light coloured, usually the 'Green-Tinted' ones, the results are very nice ;).

Title: Re: FSWC's back in progress!
Post by pwheeler on Jan 30th, 2008 at 2:48pm
I think here's the problem with the shader cache. I run FSX in window mode. I know there are quite a few people who do so you'll need to make it obvious that if you run in windowed mode you have to either go full screen and back or exit the sim.

By the way, did you like the new night time tweaks? I guess its better to have a scalable moon glow than just getting rid of it completely.

Nick - great shot. Is that your GEX mod at work in the background?  ;)

Ashton not sure about the colour sliders. Not too sure if we can impliment this. It would involve adding more lines of code and I think there is a limit on how many functions you can have in a shader file.

Paul

Title: Re: FSWC's back in progress!
Post by pwheeler on Jan 30th, 2008 at 5:27pm
Ok confirmed.

the shader cache rebuild only works when the sim is running if you run in full screen mode. If you run in windowed mode you need to exit the sim or change to fullscreen and then back.

Just thought I'd give a comprehensive list of the variables I have for DX9 SP2.

fresnmax               - low angle reflections
fresnmin                 - high angle reflections
frdot * frdot * frdot ...             - interpolation curve
frdot * multiple                 - reflection intensity
basecolor.rgb * multiple               - texture colour intensity
specularfactor.x * multiple                 - sun specular intensity
multiple * (specularfactor.y ...                 - moon specular intensity
multiple * (saturate(dot...                    - moon glow intensity


Are these the same as you guys?

I'm still working on this. I'd like to find a way of reducing the size (width) of the specular reflections. So far no luck but I'm still trying.

Paul

Title: Re: FSWC's back in progress!
Post by Str1ker on Jan 30th, 2008 at 8:33pm
Just so you know, Shader Cache Rebuild does occur in Windowed mode, but it appears to do so in certain time intervals.

The closes thing to getting the effect is probably minimizing the window, doing your thing, then opening it again.

This basically means, a rebuild is called whenever FSX has to restart its graphics engine to form whichever device, whether it be a fullscreen graphic device, or windowed graphic device.

Those variables are pretty much what I have, and that's good, that's 8 sliders, and that's exactly what I have.

Please, don't make me add another slider, it is hell :o doing that.  That's whatcha get when your sliders are pictureboxes :P...

I haven't tried the nighttime tweaks yet, but I'll give it a go, and yeah, it's best to have everything scalable.

About the colour thing, let's not do it.  I think using float3(128,255,255) will be able to add to the basecolor.rgb thing, since it probably is a float3 value, but we don't really need that now anyway.  All these fancy texture pack dudes have many many texture sets for water so we'll leave people to change their water that way.

Besides, if we changed the basecolor by a little, that'll apply to every square metre of water in the FSX world, so you might want tropical areas to be greener, but guess what, the Pacific will also turn out a litttle bit greener if we added that colour function ;D.

And yeah, there is a limit to how many functions and stuff we can put in Shader Model 2.0 code.  I suppose it's good, since a lot of FSX people are still on GF6 or even FX cards. ;)

Finally, thanks for working so hard on the specular width, although I still think that's pretty much determined by textures.

However, may I suggest that the specular sharpness will probably be attributed to a curve of some sort, or the other specula<whatever> values defined at the beginning.

In SP1, I tried changing some of the other specular<whatever> values, one screwed the shader, the other turned the water black and white.  It seemed that one was some specular mask, which rolled across the water showing the specular stuff is it went.  Since the specular bits were static, there must have been an alpha value associated with it, and perhaps a blending curve of some sort ;).

Again, Good work guys,

Ashton

EDIT:

I'm joking about the number of values changeable.  I can probably fit one more slider, let's try and make it the sun reflection sharpness shall we? ;)

EDIT2:

Yay, I've now finished the splash screen.

Damn, I've now got to work out systematic file reading.  That sucks...

Title: Re: FSWC's back in progress!
Post by Str1ker on Jan 31st, 2008 at 10:44pm
w00t as most would say.

I've finished off the file reading.  I've gone INI style, which is basically what was used before Microsoft added a registry system.

Essentially, the FSX.CFG is an INI file, except the extension used is*.CFG, rather than *.INI.

Anyway, so, this means, I now how the ability to read and write INI styled files, and, believe it or not, the INI file reading isn't part of .NET, however, a few clever people found the functions within the kernel32 dll.

So, I basically didn't have to code anything.

Code I use for INI file reading.  Very simple to implement

Now, I must work on the language system, because now that I've done the language system, all file reading work is simply tedious, rather than complicated.

Hmm, I'm not sure which I prefer... :-?

EDIT:

WE WILL BE RECRUITING TRANSLATERS AT SOME POINT
Languages will hopefully include English, French, German, Dutch, Swedish, Spanish, Portugese, Italian.  Fancier languages which require special characters are not know yet, but we might support Thai, Japanese, Chinese, Korean, Russian (and all them eastern european languages), perhaps middle-eastern languages as well, if lucky.
No pay, no benefits, though, you will get the beta, and the language program, once that's done...

The aboce notice is kinda what we want to achieve, give or take a few languages, since we can't have too many, especially if I have to try and add fancy script support, which'll be difficult if it isn't already natively supported.

Guaranteed are the Western European languages though ;).

EDIT2:

Well, no sooner had I posted this, eriktu has now offered to do the French translation, so that spot's filled.  Thanks man.

Still, he can't translate all the languages, so we're still waiting for other translators ;).

Title: Re: FSWC's back in progress!
Post by Str1ker on Feb 1st, 2008 at 7:20am
Today, I have for you, two images:

Splash Screen:


Yes, the text seen there is shown, but it changes depending on what's happening.

Main Screen:


Don't worry, the credits text goes away the moment you move your mouse over a slider.  Like what I named Nick? ;D

When you move a slider, the image in the preview pane will change accordingly.  When a preset is selected, images of that preset will appear in the preview pane.  This doesn't occur with custom profiles though.

Another thing, I've hassled Paul for quite a while to get the right startImage, so appreciate it! >:( :D

Title: Re: FSWC's back in progress!
Post by SubZer0 † on Feb 1st, 2008 at 6:21pm
*Crowd shouts* "RELEASE! RELEASE!"  ;D ;D ;D

Title: Re: FSWC's back in progress!
Post by J. on Feb 1st, 2008 at 6:25pm
looking good ashton :)

nice UI

Title: Re: FSWC's back in progress!
Post by pwheeler on Feb 1st, 2008 at 10:50pm
Here's some more shots showing FSWC in action. An evening touring British Columbia. All the latest water shader enhancements are being used. All unedited. (Also using FEX, UTX, GEX)

Hope you like them...

Paul














Title: Re: FSWC's back in progress!
Post by Str1ker on Feb 1st, 2008 at 11:42pm
Nice shots man.

Thanks J, and SubZero, thanks, but if I release it now, it wouldn't work for anyone ;D.

Title: Re: FSWC's back in progress!
Post by J. on Feb 2nd, 2008 at 4:29am
wow some stunning shots paul! :O


Title: Re: FSWC's back in progress!
Post by Str1ker on Feb 2nd, 2008 at 5:37am
FSWC Default.pfl

Code:
[profile]
useimage      =      true
image            =      fswc_default.jpg
slider1value      =      5
slider2value      =      40
slider3value      =      74
slider4value      =      87
slider5value      =      81
slider6value      =      60
slider7value      =      85
slider8value      =      21


English.lng

Code:
[apply]
text            =      Apply
labeltext1      =      Applies all selected settings.
labeltext2      =      

[cancel]
text            =      Cancel
labeltext1      =      Cancels any changes, then exits the
labeltext2      =      program.

[help]
text            =      Help
labeltext1      =      Brings up the help documentation.
labeltext2      =

[profile]
text            =      <No Profile Selected>
labeltext1      =      Lets you select a profile from the list.
labeltext2      =      

[new]
text            =      New
labeltext1      =      Creates a new profile entry.
labeltext2      =      

[delete]
text            =      Delete
labeltext1      =      Deletes the currently selected profile.
labeltext2      =      

[rename]
text            =      Rename
labeltext1      =      Allows you to rename the selected profile.
labeltext2      =      

[import]
text            =      Import
labeltext1      =      Brings up the 'Import Profiles' dialog.
labeltext2      =      

[export]
text            =      Export
labeltext1      =      Brings up the 'Export Profiles' dialog.
labeltext2      =      

[restore]
text            =      Restore
labeltext1      =      Brings up the 'File Restoration' dialog.
labeltext2      =            

[slider1]
text            =      Low Angle Reflection Intensity:
modifiertext1      =      
modifiertext2      =      
modifiertext3      =      
modifiertext4      =      
modifiertext5      =      
modifiertext6      =      
modifiertext7      =      

[slider2]
text            =      High Angle Reflection Intensity:
modifiertext1      =      
modifiertext2      =      
modifiertext3      =      
modifiertext4      =      
modifiertext5      =      
modifiertext6      =      
modifiertext7      =      

[slider3]
text            =      Reflection Blend Curve Multiplier:
modifiertext1      =      
modifiertext2      =      
modifiertext3      =      
modifiertext4      =      
modifiertext5      =      
modifiertext6      =      
modifiertext7      =      

[slider4]
text            =      Reflection Blend Curve Intensity:
modifiertext1      =      
modifiertext2      =      
modifiertext3      =      
modifiertext4      =      
modifiertext5      =      
modifiertext6      =      
modifiertext7      =      

[slider5]
text            =      Texture-Base Colour Intensity:
modifiertext1      =      
modifiertext2      =      
modifiertext3      =      
modifiertext4      =      
modifiertext5      =      
modifiertext6      =      
modifiertext7      =      

[slider6]
text            =      Sun Specular Reflection Intensity:
modifiertext1      =      
modifiertext2      =      
modifiertext3      =      
modifiertext4      =      
modifiertext5      =      
modifiertext6      =      
modifiertext7      =      

[slider7]
text            =      Moon Specular Reflection Intensity:
modifiertext1      =      
modifiertext2      =      
modifiertext3      =      
modifiertext4      =      
modifiertext5      =      
modifiertext6      =      
modifiertext7      =      

[slider8]
text            =      Moon Glow Reflection Intensity:
modifiertext1      =      
modifiertext2      =      
modifiertext3      =      
modifiertext4      =      
modifiertext5      =      
modifiertext6      =      
modifiertext7      =      

[versioninfo]
version            =      Version:
cleansp1      =      Flight Simulator X - Clean Install/Service Pack 1
sp2acceleration      =      Flight Simulator X - Service Pack 2/Acceleration

[messages]
apply            =      Settings have been applied.
cancel            =      Are you sure you want to exit without saving any changes?
new            =      Please name your new profile:
delete            =      Are you sure you want to delete this profile?
rename            =      Please give your profile a new name:
import            =      Please find the directory where the new profile(s) is/are stored.
exportstep1      =      Please select the profile(s) you want to export:
exportstep2      =      Please select a directory where you'd like the profile(s) exported to:
restorequery      =      Are you sure you want to restore the original shader file?
restorenotice      =      If FS Water Configurator is run again, it will reinstall the custom shader file.
restorefinal      =      FS Water Configurator will now close.


Those are likely to be the final profile (*.pfl) and language (*.lng) files.  They can be edited with Notepad, like most things, and both come with their own editor.  The profile editor is FSWC, as you may have guessed, and the language editor will be a seperate program.

However, since I've also added an image system with the profiles, which is basically a slideshow type deal, images will only show up with FSWC default profiles.

However, I imagine a few people will want to share their profiles with others, and would also want to add their own custom pictures for their profiles.  That's easily done manually, but just in case, I'll make a profile editor just for that as well, though that is way down on the list of things to do ;).

BIG EDIT!

Okay, guys, don't think I'm overreacting, but...

I FRIGGIN' DID IT!

Did what?

I've made the profile box populate itself with the files in the Profiles folder.

This means the program is basically finished!  Okay, it's not, but that was what I was expecting to be the hurdle, but I've done it and it is so friggin' easy!  Well, weird at first, but after that easy!

Now, the only other real bump in the road is the file browser...

...hmm, just realised that that is going to be hard...

...alright, no more champaigne spraying...

Another EDIT:

Well that sucks.  I was gonna post a screenie of it, but apparently PrintScreen, much like it doesn't show the cursor, doesn't show dropdown menus either.  WHY?!?!?!?!?!?!?!?!?!

Oh well, you'll just have to take my word for it... :P

Title: Re: FSWC's back in progress!
Post by Str1ker on Feb 2nd, 2008 at 10:56am
Okay, I can't give you a screenie, so I'll give you the program.

Yes, I'll give you the program.  The actual program, as I have it at the moment.  This includes all files within it's directory.

HOWEVER, when you install it and stuff, you must remember, you are doing so at your own risk, and any damage caused by it is not my fault.  Well, I suppose it kinda would be my fault, but you installed it, so it's therefore your fault.

Whatever, you get the idea.

Instructions (must follow exactly):
Click this to download the file (do not let download manager kick in) - This has been updated, please scroll down to my latest post to get the never version...
Open the zip file, then extract the files (with folders enabled) to your default 'Program Files' directory.
Go to the folder named 'FS Water Configurator 2', and double click the application.
On the first run, wait for a few moments, then hit 'Alt + F4' to close the splash screen, then close the application regularly.
Run the application again, and it will work properly.

If you have issues with those instructions, you probably have issues in the head as well :P :D ;).

Anyway, feel free to experiment with the files.  So far, a lot, but not all of the language file system works.  Regular buttons like Apply and Cancel and the like will be changeable, however, their description text is not.

Also, the profile files don't change anything yet, however, you can add and rename more profile files to see if they show up in the profile box (top left corner if you don't already know).

Basically, if you download this, it doesn't do much other than look nice.  If for some reason you get a fully functioning one, then my download hoster magically completed everything for me, lol.

Have fun,

Ashton

Title: Re: FSWC's back in progress!
Post by DONTREADMYUSERNAME on Feb 2nd, 2008 at 12:50pm
Woohoo! Thanks a lot man! Downloading as I type!

Thank you!!!

Title: Re: FSWC's back in progress!
Post by NickN on Feb 2nd, 2008 at 12:59pm
Ashton

You and Paul did the work on this.. although the description you placed on my name is very flattering, its a bit over the top. I consider Phil Taylor an FS Guru, not myself.  :)

I would prefer you and Paul retain the titles as you guys deserve the the credit for a job well done. My name at the bottom without the fancy title, is fine

Lets not forget about Ingvarr either. He was the one that started it all and should be mentioned as the person who this was all based on.


I have not tested your product as of yet. I am pushing to have GEX Enhanced released next week and I simply do not have time right now.

3 things to remember...

1. Never let the software overwrite or replace anything automatically. Always make sure it waits for instructions to replace, delete or update files.

2. Always back up eveything that is replaced and also make sure if the program is uninstalled without the user restoring the originals, it will automatically restore the users install to what it was before the program was installed. In that, as it is run for the first time it should automatically back everything up without the users unput.

If the program does not require an installer, it should still do a "FIRST RUN" backup to ensure the user does not get lost and in the process end up overwriting the default in the process of using the software. In other words, make sure the software or user can not back up a changed file by mistake, overwriting the original default.

The first run backup is a NO TOUCH backup and is never to be overwritten manually/automatically by the software or by the user for any reason.

3. Make sure it is tested on installs that are not located in default locations and that it can detect exactly where the target files are without issue.


I did download and start the program here. It stalled and hung at the "detecting language" screen. I ended process on it and the second time it started, it did not hang.





Title: Re: FSWC's back in progress!
Post by J. on Feb 2nd, 2008 at 7:52pm
on first run you had to Alt-F4 ashton did say in his instructions.

Title: Re: FSWC's back in progress!
Post by Str1ker on Feb 2nd, 2008 at 8:36pm

NickN wrote on Feb 2nd, 2008 at 12:59pm:
Ashton

You and Paul did the work on this.. although the description you placed on my name is very flattering, its a bit over the top. I consider Phil Taylor an FS Guru, not myself.  :)

I would prefer you and Paul retain the titles as you guys deserve the the credit for a job well done. My name at the bottom without the fancy title, is fine

Lets not forget about Ingvarr either. He was the one that started it all and should be mentioned as the person who this was all based on.


I have not tested your product as of yet. I am pushing to have GEX Enhanced released next week and I simply do not have time right now.

3 things to remember...

1. Never let the software overwrite or replace anything automatically. Always make sure it waits for instructions to replace, delete or update files.

2. Always back up eveything that is replaced and also make sure if the program is uninstalled without the user restoring the originals, it will automatically restore the users install to what it was before the program was installed. In that, as it is run for the first time it should automatically back everything up without the users unput.

If the program does not require an installer, it should still do a "FIRST RUN" backup to ensure the user does not get lost and in the process end up overwriting the default in the process of using the software. In other words, make sure the software or user can not back up a changed file by mistake, overwriting the original default.

The first run backup is a NO TOUCH backup and is never to be overwritten manually/automatically by the software or by the user for any reason.

3. Make sure it is tested on installs that are not located in default locations and that it can detect exactly where the target files are without issue.


I did download and start the program here. It stalled and hung at the "detecting language" screen. I ended process on it and the second time it started, it did not hang.


Wow, elaborate.  Well, I've got the backing up bit covered, but uninstalling and stuff, well, sure, I'll add that too.

I'll check that list as guide lines as I continue building up the program ;).

As for your title ;D, we can't really put you just as 'Nick Needham', we've gotta give you something.

And yeah, Ingvarr, as I've said to Paul, I'll put him in, probably on first screen and stuff.

As for the program hanging, it isn't really hanging, it's waiting for a messagebox to come up asking about languages.  This never happens, because currently, there is no messagebox doing this.

Basically, the splash screen checks for the registry entries, and if none exists, it'll create them, including the Language entry, which, by default is set to English.  This means, even if the language selected box comes up, the registry entry is still there.  This is why I say Alt+F4 the app first, then run it again. ;)

Like J. said. :)

Also, please, feel free to experiment with what's there at the moment.  For example, make copies and rename the profiles in the Profiles folder, to see if they properly show up.  Open up 'English.lng' and change 'Apply' to 'FS Rocks' or something.

I wanna see if all works well with most people ;).

Thanks guys, and thanks Nick, for those guidelines.

EDIT:

Okay, here's an updated version.  This time, when a profile is seleceted, the sliders should move to the areas specified by the file that was selected.  No other functionality though....

Download link (again, don't let download manager kick in)

Title: Re: FSWC's back in progress!
Post by Str1ker on Feb 3rd, 2008 at 9:35pm
Okay, a small update, one which does not require me to reupload anything, but I have the language system working fully, sort of.

Still, some things are not changed depending on language, which is a drag, but it's mainly a tedious job, which is why I'm leaving it for near the end.

Anyway, the update I've done, will prompt you to select a language on the program's first run.  So far, I've tested it with two language files, one name 'English.lng' and the other named 'This is not a language.lng', with words and stuff in there replaced by, stupid things.

Anyway, if you want to try making ur own language files, u can simply edit 'English.lng'.  However, if you want to make it more interesintg, then open up the registry editor (regedit) and go to this path:

'HKEY_CURRENT_USER/Software/Striking Software/FS Water Configurator/2.0'

In there, there's a string value (well, they're all strings) called 'Language'.  If you want to use another language, simply edit the value to just the name of the file you want to use.

For example, if you have a file called 'Look closely or else.lng', you simply change the value to 'Look closely or else'.  I simply drop the extension.  Admittedly it's probably be easier for me to keep the extension, but I'm not selfish... :D  It makes more sense to regular people if you're new to registry editing.

Oh, BTW, if you don't know how to bring up the registry editor, Nick'll tell you.

Okay fine, I will.

Click on your start menu, then click on 'Run...'.  In the box, type in 'regedit'.  Click OK, and the default registry editor comes up.

Registry Key Tree is on the left, use that for navigating paths, and a regular file-style window on the right, showing registry values and their, well, values.

EDIT:

One other thing, does anyone think the icon might be a bit over saturated?  Because I think it does a bit, so I've made a few versions that are dimmer, with slightly less colour, but a bit more contrast.

I'd give you a screenie, but since I'm on XP, and the icon editor I use doesn't play nice and stuff, I can't really do that easily.

Well, I can't do it in less than 5 minutes, which is kinda my threshold when it comes to minor things like this...

EDIT2:

A guy over at FSW butchered my sig and made his own, lol.  I asked if he'd like a nice proper one like mine, made by Paul, and he said yeah.  So, I placed the order, and Paul made one.

Well, I thought, perhaps other people might want one too.  So here:


Dunno who'd want it, but, you know, just in case ;).

Title: Re: FSWC's back in progress!
Post by Str1ker on Feb 5th, 2008 at 11:38am
Well, I know it seems it's been a while since the last update, and you might think I've slowed down.

I'm here to stop that negative thought ;).

Truth is, I'm at a point in the programming, where the work ahead isn't so much challenging, more annoying, and for me, that's kind of bad, however, I constantly have moments where I'll just get on with it, so there's no issue there.

Actually, another reason for the pause, is we're discussing options about our website, and so far, it's looking good.  We've got a temporary address at the moment, mainly for a select few to see, and so quite a bit of thought is going in to that.

Paul, a man of many talents, who's done art and stuff for the project, including my signature, the splash screen, and startImage, is the man behind the website.

I assure you, the site is really cool, even though the only thing fully working is the home page.

Additionally, we've been in contact with <anonymous for now> regarding fancy functionality that you'll see in the end product, but, I really mustn't say.  I'm sure it's fine to say it, but in the end, I won't because he trusts me, I trust him, and I would do nothing to break it.  Paul's also in on this, so we're all discussing it, hoping to reach a final situation, where we can all continue easily.

A lot of ideas and stuff since then, but now, we're really trying to make it happen, with full understanding of what's happening between each other, so please, give us time.

Well, that's a fairly elaborate post, I think anyway, so if this thread starts slipping to the bottom again, don't panick ;).

Hmm, good news, I've just had an idea about how to get past this little issue I've been having. :D

That's all I have to say for now, so, happy simming,

Ashton

Title: Re: FSWC's back in progress!
Post by Str1ker on Feb 6th, 2008 at 11:42am
Heylo ppl.

vry abrviatd pst 2day bcuz i gota mke it quik.

Okay, joking about the above.  Actually, I've just finished the image scrolling slideshow system (hence the big buttons beneath the preview pane.

I've also added a default image shown for user profiles.  It's not final, I'll probably call on Paul once again to make another image, but that's roughly what you'll be seeing.



The buttons in that image are obviously inactive, since they're pale, and because it's just the User Profile image being shown.

It's all funny in testing, but once all systems work properly, I'll refine every detail, no matter how tedious, then we'll go into beta at some stage ;).

Cya guys, and sorry, no download at the moment.  I'm not sure if I'll do another download for you guys, at the moment, because I've got a lot of other stuff to work on.

If I have the time, perhaps I'll upload one with a fully working profile system so you guys can get a true idea of how it works, settings-wise.

Thanks for all your support, I promise I won't let you guys down,

Ashton

BTW, this time, i saved the image in PNG format (from Paint) so it isn't degraded in any way.  Shows you the program as it will be exactly.

Also, you'll notice the transparent area, the blue bit.  It used to be black, but that's a bit unfortunate for those who's systems decide transparency is a no no, since the black didn't look particularly nice.  I've changed it to blue because it's closer to the program's border colour.

Title: Re: FSWC's back in progress!
Post by Str1ker on Feb 8th, 2008 at 12:54am
Okay, another quick update, the profile system works mostly.  The 'New, Delete, and Rename' buttons work perfectly, and that's no exageration.  I'm serious, it's not, they work beautifully.

Anyway, so, next on the agenda are the 'Import and Export' buttons.  Now, before, I had said that they'd ask for you to find a folder, and then it would import profiles from within that folder.  Well, not anymore.

Instead, the Export button will allow you to select the profiles you want exported, including any and all images that may be associated, then it will ask you for a file name and location.  You click okay, and it creates a zip, with all the profile data in it.

As you might have already guessed, the Import button will let you search for a zip file, and when you click okay, it will automatically extract the files, place them in the correct folders, and hey presto, badabing, whatever expression you want, it's done.

Neat eh?

Title: Re: FSWC's back in progress!
Post by Str1ker on Feb 9th, 2008 at 10:44am
Okay, well, I'll be honest, usually when I think of an idea, I know I can do it.  However, I don't know how I'll do it.

Weird, I know, but anyway, here's the deal, when I mentioned the zip file idea, I had no idea how I'd do this.

Now, as it is to many, Google is your friend, and I use it a lot to check out programming stuff, and it's absolutely great.  So, here's the zip file story:

1)  I find this thing that does it for me, open source.  I download it, it doesn't work. :'(

2)  I find another site, which tells me how to use the J# (another Visual Studio-type language) libraries in C# to do the zip file stuff.  Again, I get it, but, it don't work. >:(

3)  Finally, I go to the Microsoft website for programming stuff, MSDN, Microsoft Developer Network, and I find this free download.  I download it, and it gives me an app, which actually works, thank god, with a Class for me to use as well.  Yay, I've found it. :D

Surprisingly, this has been going on for quite a while on many of the other components of this program, much like the INI file reading (except that only took two tries ;D).

This is basically how I got to where I am.  This is my first project in the C# language (before, I used Visual BASIC), and I wouldn't have made it here without the many on the internet giving away examples and writing articles for all to share.  And of course, I owe it to Google to finding those articles.  Live search sucks, Yahoo search sucks, most of them suck actually.

Right, I must get back to work.  What a nightmare... :P

Title: Re: FSWC's back in progress!
Post by J. on Feb 9th, 2008 at 11:21am
When programming and needing help MSDN is my first resort, a fantastic facility! sometimes i would not be able to cope without it, If i can't find it on MSDN i switch to google.... its ok.


Title: Re: FSWC's back in progress!
Post by Str1ker on Feb 9th, 2008 at 11:34am

J. wrote on Feb 9th, 2008 at 11:21am:
When programming and needing help MSDN is my first resort, a fantastic facility! sometimes i would not be able to cope without it, If i can't find it on MSDN i switch to google.... its ok.


Yeah, the only problem I have with MSDN is occasionally you might download an example that turns out to be really old, and won't work in VS2005.

Still, you're right, it's a handy place ;).

Title: Re: FSWC's back in progress!
Post by Str1ker on Feb 10th, 2008 at 12:51am
Hey, another update.

Due to really weird circumstances that make no sense at all, like most things in programming, I've changed the order of the export feature.

Originally, you select the profiles to export, then you select the file.

Well, now, I've determined that it's easier for me, and of no consequence to you, that you'll select the file and stuff to save to, and then you select whatever profiles you want saved.  ;)

I know, it's a bit odd, and I suppose if I tried explaining it, it'd be hopeless.  Even if I could try explaining in person, probably wouldn't make too much sense, but hey, whatever works right? :)

Ashton

Title: Re: FSWC's back in progress!
Post by Str1ker on Feb 11th, 2008 at 9:32am
Well, I've got the zip libraries in and working.

Actually, the libraries are from J#, not C#, so that's handy.  I still don't get why they don't just put the ziplibs in C#, but hey, I don't understand too much about how they've done all this, so I won't go into it.

Basically, the export button mostly works.  You can select the profiels to export, select a directory and file name, click okay, and presto, the zip is there.

However, I'm still working on the images thing.  Some people might associate images with the profiles they wanna share, so I've got to have those go along with the profiles as well.  It shouldn't be too hard, but, then again, most of this project shouldnt hav been too hard (but was).

At the moment, I'm working on a side idea for FSWC, something which'll be a surprise at the end.  Few people know what this idea is, but man is it gonna be awesome.

That's all I can say at the moment.

As for other stuff, there is no other stuff.  I'm working non-stop on FSWC, taking occasional breaks if I feel annoyed (but neither patient nor stubborn).

All in all, it's working out really well :).

Ashton

Title: Re: FSWC's back in progress!
Post by Str1ker on Feb 12th, 2008 at 3:41am
K, anybody involved with the project, i've sent some of u an email, with the latest build and that fancy file we've been talking about ;)

Title: Re: FSWC's back in progress!
Post by Str1ker on Feb 13th, 2008 at 10:25am
Hey again,

Just to outline what I have to do:

The import and export functions work.

The export functions however will not support images that go along with any profiles to be exported.  Whether or not the Import function will also include images, remains to be seen.

This kinda means, that they're not finished, but still need tweaking, much like the Browsing Form, which will allow you to enter directories to see files and such, however, it doesn't display much yet.  That'll be fixed near the end.

Well, now I have the time to work on the 'More' form, which'll display, mainly options, such as the slideshow timer, but also houses the backup system.

The backup system basically will first backup the Water20.fxh file, that's originally there.  It will also allow the user to restore that file, or a previously saved original file that comes with the program.

Once that's done, the foundation for the file editing will have been layed, and so I'd be able to start coding the Shader File modification code.

There already is a file, called 'FSWC Quick Change.exe' which can already set the shader settings and clear the cache, however, that program currently serves no purpose for the end-user.  Only the people developing the program have a use for it, however, it does work properly, so if you can work out how it works, good for you.

Now, I've mentioned it before, and I'll mention it again, there'll be a mini-SDK, downloadable seperately.

Basically, this SDK will hold two programs, both designed to each affect a single aspect of the final program.  These programs will be:

FSWC Language Editor
Starts a program, with multiple windows, each representing the windows that can come up in the regular FSWC.  Each spot that can have test displayed will be replaced by a textbox which can have text edited.  As the text is edited, the language file will be written.

FSWC Profile Editor
Starts a program, which allows the user to create profiles.  This doesn't sound great, I know, however it also includes the ability to create profiles, and presets, that also have images associated with it.  This means, if you've made an awesome bunch of profiles, that you wanna share, and you want to have images showing off how it is, and stuff like that, this'll be the thing to use.

There'll also be some extras.  I dunno what these extras'll be at the moment, because I can't remember what extra functions I added that can be modified.  No matter.  Of course, there'll be documentation as well.

Anyway, once the actual program functions work, meaning, it changes the shader files and clears the cache, I will turn my attention to the preview pane.

In that pane, an image will be shown, as you already know.  However, when a user moves their mouse over a particular slider, the image will change briefly, displaying an FS scene.  As the user moves the slider, this image will change.  Essentially this'll be a blending of two images, to give the user a rough idea of how those particular settings will affect the water.

I think I've mentioned before, that there'll be a nice little surprise, regarding extra functionality, which is what the Quick Change application is associated with, however, again, I will not disclose any info on it, since it really is a surprise.

Finally, we have been thinking about the website, and we've got something set up, but we won't really launch it or announce it until we reach the beta stage.

I think that's all I have to say, fairly long, but if you're really into this program now, I'm sure you've read all of that.

I'd just like to thank Paul, Nick, Tim, and, of course, all you guys who've taken interest in this project.  I would've written thanks in all previous posts, but this one is the longest so far, so it's probably the most appropriate to place thanks into.

Thanks again,

Ashton

P.S.  If you find any grammatical errors or spelling mistakes sorry.  I don't use Word to proof any of this, and I now realise I've written to much to go over it again, so if you find an odd sentence, please, take the time to work out what I meant.

Title: Re: FSWC's back in progress!
Post by Str1ker on Feb 13th, 2008 at 10:35pm
I know you like screenshots.

This is the 'More' screen of FSWC, housing mostly shader file options, like backing up, or even which one is actually used, depending on Flight Simulator version.  At the bottom, you'll notice a bare slider, which'll be the slideshow timer settings.  Next to that, there's the language selection box, in case you wanna change languages.



Just one more thing I'd like to say, I don't think I've left out any part of Flight Simulator X's interface.  Even that 'Version' groupBox was created from a screenie of groupBoxs in FS.  Even the fonts match, except for maybe the titlebar font, which I'm not so sure about :P...

Ashton

EDIT:
Just updated the image.  Now it shows directory stuff.  This'll actually save me a lot of time, so I can have the splash screen revert to this screen, rather than have a whole new browse form everytime a file ain't detected properly...

Title: Re: FSWC's back in progress!
Post by Str1ker on Feb 14th, 2008 at 10:41am
Hey guys,

Well, I'm making a lot of progress on FS Water Configurator, I'm definately going to release this when, provided my PC doesn't blow up again :o.

Anyway, now, just a brief description, I was flying through quite a few mission, making Presets for each mission that has any large amount of water in it, such as Oil Rig Transport, which just so happens to be my favourite :D.

All water textures, and sky textures are default, however, I have used X Graphics for the clouds, lights, and various other things.  Remember though, all water textures are default ;).

Now, for those of you with my latest build, which is, at the moment, three people (you know who you are ;)), use these settings for Quick Change:

Code:
[quickchange]
value1            =      5
value2            =      28
value3            =      78
value4            =      86
value5            =      37
value6            =      59
value7            =      42
value8            =      24


You better like these, because all screenies I've been taking for the profile system have caused me great pain.  Full settings at 10FPS is not my idea of a pleasant flight.  Still, I can complete most missions at that framerate anyway (except for the Red Bull ones :P).

One other thing, these are completely unedited.  Not even resized, lol...

Now, on to the shots ;):















Hope you enjoyed them, as much as I did making them (it looks so much better in motion 8-)),

Ashton

Title: Re: FSWC's back in progress!
Post by Str1ker on Feb 16th, 2008 at 12:21pm
Okay, another update, even though I barely get any replies anymore ;D.

I've worked a lot on the 'More Functions' screen, and I'm getting closer to the point where i should be able to add the shader function code, but still, not yet.

I've also got a lot of other things to clear up, so don't expect a miracle release.

One thing I have been working hard on, actually, are the Mission-related presets.  These are presets that can be used for missions, with default water textures.   obviously i cant include presets for all texture packs that exist, but hey, its freeware, so we support default everything anyway.

Ashton

Title: Re: FSWC's back in progress!
Post by fabian_e on Feb 17th, 2008 at 5:57am

Ashton Lawson wrote on Feb 16th, 2008 at 12:21pm:
Okay, another update, even though I barely get any replies anymore ;D.

I've worked a lot on the 'More Functions' screen, and I'm getting closer to the point where i should be able to add the shader function code, but still, not yet.

I've also got a lot of other things to clear up, so don't expect a miracle release.

One thing I have been working hard on, actually, are the Mission-related presets.  These are presets that can be used for missions, with default water textures.   obviously i cant include presets for all texture packs that exist, but hey, its freeware, so we support default everything anyway.

Ashton

Being silent doen't mean I'm not reading all of your posts ;).
Really looking forward to that add-on....,

Cheers and thank you for your hard work,

Fabian  8-)

Title: Re: FSWC's back in progress!
Post by Str1ker on Feb 17th, 2008 at 6:17am
Oh cool, thanks man.

It's kinda of a blog now isn't it?  Nick, Paul and I have stopped confering on this thread because we do it by email now, lol.

okay, quick thing, there's a small hitch with th export function, one, which I find, quite annoying.

because of this, i'll leave out the export function for now.  However, the import function should work fine, thus, the export button will remain greyed-out.

still, there'll be a miniSDK as stated above, so those who really want to share their profiles, can do that easily.

Ashton

EDIT:
Dam.  just thought of something, to do with the import function.  if one imports profiles in, which have the same names as existing ones, they may get replaced.

okay, i'm gonna grey-out both the buttons for now.  Future updates will add their functionality back in tho...

sorry :-/

Title: Re: FSWC's back in progress!
Post by EchoLdrWolf on Feb 17th, 2008 at 7:38am
Lookin good! But in the screens you posted before, the water looks really flat.

Title: Re: FSWC's back in progress!
Post by Str1ker on Feb 17th, 2008 at 10:19am

EchoLdrWolf wrote on Feb 17th, 2008 at 7:38am:
Lookin good! But in the screens you posted before, the water looks really flat.


I take it you mean the earlier ones yeah? :)

Because the Oil Rig shots are probably as rough as the water can get without looking silly ;D.

Title: Re: FSWC's back in progress!
Post by VFRDUDE123 on Feb 17th, 2008 at 10:26am
Hey, I can't wait to beta test this  ;D , is there a preview for what you choose? Maybe I could make it (would take a while though)

Title: Re: FSWC's back in progress!
Post by Str1ker on Feb 17th, 2008 at 10:41am

VFRDUDE123 wrote on Feb 17th, 2008 at 10:26am:
Hey, I can't wait to beta test this  ;D , is there a preview for what you choose? Maybe I could make it (would take a while though)


Okay dude, don't get over excited.  All the stuff in the program will be done by the team, the beta dudes need only make suggestions and test the program as we fix bugs and such.

So, for now, chill.  Also, you didn't really need to register here, just because you're a beta person.

Thanks for the offer though ;).

Title: Re: FSWC's back in progress!
Post by Str1ker on Feb 17th, 2008 at 9:22pm
Hmm,

Well I've just realised two things, one of which is really stupid, the other making me feels stupid.

The first one, is the realization of teh number of double posts I'm made in this thread.  It's crazy.  Double, Triple, Quadruple, Quinwhatever it is.

You can guess, that was the silly one.

Anyway, this next one, is regarding the language stuff.  I've just realised, that words on different languages are going to be different lengths, and stuff, so, to solve the issue of buttons that can't fit their words, I've added a font section to the language file.

This means, if, for example, there's a French word for for More, which is longer (physically) than the regular English one, then it might not fit properly into the button.  So, I can have the font changed according to the translater's will, thus, solving a few spacing issues.

Alternatively, I could get rid of some buttons, and make them longer in general, but that'll take too long, and I like my buttons...

Title: Re: FSWC's back in progress!
Post by Str1ker on Feb 24th, 2008 at 4:32pm
Right, here's the deal.

Too many days have gone by where I can't sleep due to me screwing up my internal clock.  So, it was time for a reset.

Tonight, I'm staying up all the way through to the next day.

Doing what?  Working intensely on FS Water Configurator.

Too many days have gone by where all I've done is change a font colour, or a button colour, it was time for some serious hard work.

That's what I'm doing right now, working really hard.  In fact, I've worked so bloody hard already, that all I have to do is touch up a few things, and hey presto, I'll be able to make the program actually change the bloody shader.

Yeah, that's right, it might actually do what it's supposed to do, I know, it's incredible isn't it?

I've already written a program that does it, Quick Change, I've mentioned it before, I think, so implementation of shader changing code is easy.

Paul's working mainly on the website, and other people are working on other aspects, but so far so good.

I've already selected my beta people, so don't come begging to be part of the beta, unless you have something really special to offer.  I mean really special.  Not something like, 'I have every addon possible for FS.'

Well, that's about it I think.

Thanks for keeping track of our progress so far.  I know it's nothing as big as FTX or REX, but hopefully it'll be a great freeware addon for FSX ;).

Thanks,

Ashton

Title: Re: FSWC's back in progress!
Post by fabian_e on Feb 24th, 2008 at 4:37pm
Thanks for the news.....,

Cool to see the project advancing.

Cheers,
Fabian

Title: Re: FSWC's back in progress!
Post by Str1ker on Feb 24th, 2008 at 5:39pm
Even better news, shader changing works now.

Yes, you can click Apply, and it does something.

So, select, e.g. Oil Rig Transport, sliders move to their respective positions, click Apply, go fly, and BAM, your water looks stormy.

This is awesome :D

Title: Re: FSWC's back in progress!
Post by J. on Feb 24th, 2008 at 5:43pm
LOL  

(just not to break habit :P from our convo earlier :)

good stuff ash mate :) good to hear about this project really coming along :)

Title: Re: FSWC's back in progress!
Post by ndude737 on Feb 26th, 2008 at 1:02pm
so how did the program-a-thon go? or is it still going

looking forward to this.

Nicholas

Title: Re: FSWC's back in progress!
Post by Str1ker on Feb 26th, 2008 at 11:18pm

N. Chapman wrote on Feb 26th, 2008 at 1:02pm:
so how did the program-a-thon go? or is it still going

looking forward to this.

Nicholas


Hehe, very poetic, lol.  It went quite well actually.  The moment the shader changing worked, I stopped ;).

Okay, but seriously, I've paused on the shader changing for a moment, mainly due to the fact that I've requested a beta tester of mine to test out the Service Pack 1 file.

Basically FSX, like a lot of other PC games, tends to be annoying for some, great for others.

Some people still have to run on Service Pack 1, or even just a clean install.

The original Water20.fxh mod, created by Ingvarr, was an SP1 shader file, which also worked on a clean FSX installation.

Now, some guys over at AVSIM, one of which being Nick, the other, I dunno, managed to convert the SP1 shader to work in SP2.  How?  I really have no clue.

From then on, all the shader advancements, by both Paul and Nick, were made on the SP2 file.

Because of this, the SP1 file still only works with High/Low/Specular reflections, and nothing else.  However, the file that I've sent to a beta tester, is modified, to include the various advancements we've made.

Whether or not it will work, I have no clue, but that's basically what I'm currently waiting on.

In the mean time, I'll work on other things when I feel like it ;D.

That was long wasn't it?

Ashton

Title: Re: FSWC's back in progress!
Post by NickN on Feb 27th, 2008 at 10:50am


I had a very small portion in this... Ingvarr started it.. I started working with it.. SP2 got released and I was tied up... I made a few changes and posted it for SP2 but Paul also made further changes around the same time and that is when he came on board and has put more into it than anyone else from that point on. I did find values that I prefer with the shimmer and posted them but nothing I have placed into the project would ever compare to what Paul and Ashton have. So the hero's and design guru's here are Paul and Ashton, not me.


I have had my nose in GEXn for several months but I am monitoring progress.


Title: Re: FSWC's back in progress!
Post by Str1ker on Feb 29th, 2008 at 11:02am
Nick, you don't have to be so...

...I can't think of a word, but dude, regardless of how much work you've done, compared to what we've done, doesn't matter.  You're still part of the team.

Also, you've laid down very good guidelines on backing up stuff, things I probably wouldn't think of myself, so hat's off to you there too.

How I'll implement those things, I'm not too sure yet, but I suppose everything works out somehow, lol.

Keep working hard man.  You're an icon in the FS community  ;).

______________________________


Okay, another Alpha build should come out soon, for select people, not necessarily all of the beta team, but definitely for my team.

Anyway, the deal is this, I'm quickly testing a RTM/SP1 file.  Well, I'm not, Tree Trimmer is.  If it works, then I can add in support for that, and bam, send out the next alpha build.  If that doesn't get done too soon, then I'll send out an alpha build anyway.

Things which aren't finished, include the browsing screen, a couple browse buttons on the 'More Functions' screen, and finally, preview image blending stuff.

The browsing screen does actually work, however, it doesn't currently display any directory info.  You can type stuff into the textboxes, which can be used, but the two panes are completely blank, so all I have to do is add directory and file displaying functions.

The browse buttons on the 'More Functions' screen are currently greyed-out when the folders are already correct.  If not, and, this is judged by FSWC itself, then the user can change them, by either typing directly into the textboxes, or browsing, by, you guessed it, clicking on the corresponding browse button.  This shouldn't be any problem implementing, simply, like all other things in this project, annoying.

Preview Image blending is the big programming job, which I'm thankful for, because it won't be boring.  It won't be easy either.  Currently, the program uses GDI for most stuff, which is standard with windows apps.  However, it seems I must delve into GDI+.  What's that?  Not so sure myself, but I have to deal with matrices (plural of matrix, no not the movie) and stuff like that, so that'll annoying, but hey, copying and pasting code off the internet ain't so bad.   Then again, I do have to convert all the values to what I need it for.

Anyway, once that's done, and I think I'm sure about this, we can go into beta, and announce our website, which will hopefully be ready by then.  I'm sure it will be, since I have a lot of work to do myself.

A little preview trailer-type thing is in the works, featuring Oil Rig Transport, Default water, and FSWC'd water.  So far, I think it's pretty cool, but man is it big (in size, not dimensions).  I'm going to have to work out stuff like compression, which I don't particularly want to do since anything like that compressed is really not the way it should be.  Watching the scene blur itself periodically inbetween key frames is just not how these things should be viewed, so, hopefully, I might find a compression method that won't completely destroy the quality.

I might make another FSWC trailer later on, but not so soon.  Probably after we hit beta.

That's all for now, I think.

I didn't really have to write all that, but, if news suddenly went dry for a while people might start losing faith, lol.

Ashton

Title: Re: FSWC's back in progress!
Post by Str1ker on Mar 2nd, 2008 at 7:51am
Link to many a screenshot

I can't be bothered to post it here anyway.  Takes a long time just uploading them, so clicky the link and enjoy.

Besides, some people have SimV blocked from work, not that I'm encouraging slacking-off...

Title: Re: FSWC's back in progress!
Post by Str1ker on Mar 6th, 2008 at 6:44am
Hey guys,

I've sent out a alpha builds to all of the beta people, so they get to test a functioning FS Water Configurator.  So far replies are good, since there's only one real reply, and it's good.

The other replies are regarding why they didn't get theirs, which I blame solely on my internet, lol.

Anyway, the deal is this, I've decided to get two things in, none of which required too much programming work, mainly string editing, and about five lines of extra code, but I've done it, so here it is:


So, can you guess what I've done?

I've made the titlebar place a '...' when the profile name is too long and I've added the modifier description text, which basically outlines the basic idea behind the slider in question.

That's all for now, tune in next week, least, I think it'll be next week I make another update.  I dunno.

EDIT:
Sorry, copy pasted from FSW, so previous image didn't display correctly, since it wasn't uploaded here.  Fixed now ;).

Ashton

Title: Re: FSWC's back in progress!
Post by NickN on Mar 6th, 2008 at 9:45am


Well, what you have done is link an image and not uploaded it

LOL

;D

The rest is by imagination only    :D

Title: Re: FSWC's back in progress!
Post by Str1ker on Mar 6th, 2008 at 10:23am

NickN wrote on Mar 6th, 2008 at 9:45am:
Well, what you have done is link an image and not uploaded it

LOL

;D

The rest is by imagination only    :D


Oh dam, lol, forgot.  I copy pasted the text from FSW and pasted it here, lol.

I'll change it...

Title: Re: FSWC's back in progress!
Post by Str1ker on Mar 13th, 2008 at 4:55am
Hey guys,

Just another quick update, nothing too relevant.

So far, the alpha builds I've sent out are working fine.  They're not fool proof though, but that's to be expected with an alpha build.

Anyway, here's the actual thing I've added:


Guess what it is.  Go on ;).

Ashton

Title: Re: FSWC's back in progress!
Post by BuggsK100RS on Mar 13th, 2008 at 8:43am
Is that A internet Button at the bottom next to the help one?

Ah its says FSWC website  8-)

Title: Re: FSWC's back in progress!
Post by Daube on Mar 13th, 2008 at 9:20am
That's trully impressive job there, Str1ker !!  :o 8-)
Sorry I didn't read the complete post, but from the picture of the interface, I do not see anything that would allow the user to get back to the default values... is it in the profiles maybe ?

Title: Re: FSWC's back in progress!
Post by Str1ker on Mar 13th, 2008 at 9:25am
Thanks guys.

Buggs, you got it right, that button with the earth will open IE and bring you to the FSWC website.

Daube, the direct shader file functions, for backing up, setting, or restoring the shader files are on the 'More Functions' window.  You click on the 'More...' button to get there.

I'm still doing shader file work, but once that's ready, I'm fool-proofing the shader file backup system, so no fool can miss it, unless he's the #1 fool in the world ;).

Title: Re: FSWC's back in progress!
Post by Str1ker on Mar 17th, 2008 at 12:24am


Alright, what do you notice about that screenie 8-)?

No points if you're Tim, Paul, or Reed :P.

Ashton ;)

Title: Re: FSWC's back in progress!
Post by J. on Mar 17th, 2008 at 4:18am
the pics now have  a fading transition?

Title: Re: FSWC's back in progress!
Post by Str1ker on Mar 17th, 2008 at 6:36am
No, but that's a bloody good idea.  I'll put that in V2.1 maybe.

It's actually a quick test of alpha-blending.  This is just the beginning of the preview system, whereby an image will be displayed in the preview pane that'll change depending on certain slider values.

It'll be kinda hard to do, but it should be easy.

WTF did I mean by that :-??

Title: Re: FSWC's back in progress!
Post by Wii on Mar 23rd, 2008 at 10:13pm
I've been trying to find this program forever when it was right under my...er...nose? Well anyways, trying it out. ;D

Title: Re: FSWC's back in progress!
Post by Str1ker on Mar 24th, 2008 at 12:53am
Glad you're interested.

One thing though, any version you download, won't work.  The only versions that work are the ones with my beta team, who seem to have turned into my alpha team actually.

Either way, we're working hard on it.  I'm actually re-doing the interface so it'll look the same, but the interaction with it will be different, in the sense of transitions, previews, etc.

Title: Re: FSWC's back in progress!
Post by fabian_e on Mar 24th, 2008 at 4:32am
Wow! It'll be an great addon! Really looking forward to it!

Thanks for time & hard work,

Cheers,
Fabian

Simviation Forum » Powered by YaBB 2.5 AE!
YaBB Forum Software © 2000-2010. All Rights Reserved.