FSWC Update

FSX including FSX Steam version.

Re: FSWC Update

Postby Ashar » Sat Nov 10, 2007 11:36 pm

The pics look great. My question is about frame rate hits.
..well, I guess I dont need to ask because that statement pretty much implies the question  ;D



Thats the idea and reason for this.. you get the high reflections the 2xMAX shader would typically run with the slider set to 2xLOW-MED

No frame hit

Unfortunately I am hearing there may be an issue with acceleration... str!ker, make sure you re-check those tests with SP2/acceleration. They changed a few things which may not allow this to work, however, that may also be because some older video cards are not compliant so re-check the results if you can with a few running SP2/Accel

I am in Rome, Italy and will be back some time next week.



Oh man, had I been there we could've met up... :-[ :-[
Blabbing Away at SimV Since June 8, 2004
Ashar
Major
Major
 
Posts: 4041
Joined: Wed Mar 14, 2007 4:13 am
Location: Ottawa, Ontario

Re: FSWC Update

Postby Ashton Lawson » Sun Nov 11, 2007 11:15 am

Okay, it seems Vista 64-bit support is shot until the next version.
Last edited by Ashton Lawson on Sun Nov 11, 2007 8:37 pm, edited 1 time in total.
Image
FS Water Configurator+ has new modifications in the works, plus DirectX 10, Service Pack
1, and Radeon HD 3+ Series support.
Ashton Lawson
Major
Major
 
Posts: 1211
Joined: Thu Jun 15, 2006 5:25 am
Location: Phuket, Thailand

Re: FSWC Update

Postby Barnes » Sun Nov 11, 2007 11:27 am

Hi Str1ker,

I've been watching your progress with great interest because I was thrilled with what Ingvarr's Water20.fxh file did for the appearance of FSX. I must add however that I am also concerned about the Acceleration/SP2 compatability issue as mentioned by NickN. As I understand it, your program will make modifications to Ingvarr's original Water20.fxh file (If I am wrong about this point, please disregard). It seems that alot of people, myself included, are reporting that this file will not work with SP2. I'm sure that you are aware of this thread http://forums.avsim.net/dcboard.php?az=show_mesg&forum=121&topic_id=419193&mesg_id=419193&page=6 but if not, take a look from about response 46 down.
I even tried using the Water20.fxh file with a fresh installation of FSX plus SP2, and had the same problems mentioned in that thread. I'm not so sure that it is simply an issue with older video cards and drivers because I am using a relatively new Radeon X1950 Pro with 7.10 drivers under XP 32bit.
Anyway, good luck with your program, and I will be thrilled if it does turn out to work with SP2. I've really missed Ingvarr's water shader effects since installing Acceleration.

Dave
Last edited by Barnes on Sun Nov 11, 2007 12:35 pm, edited 1 time in total.
Barnes
 

Re: FSWC Update

Postby NickN » Sun Nov 11, 2007 8:05 pm

Str1ker

I had someone send me a copy of Water20.fxh from an Accel install. This tweak will not work with Acceleration. I am not home at my system yet but I am almost positive it will not work with SP2 unless the shader changes were only implemented in Acceleration, which make no sense. The shaders underwent a large change and the file you are editing is completely different in Accel/SP2 therefore the calls Ingvarr made in the original file are invalid. I think it is still possible but it will require Ingvar or you decipher the changes and rework the tweak.

The work you have done is only valid for SP1.

They did not change the ENVs or other textures but they did upgrade the oceanheightfield textures which control the wave fx. Including Water20.fxh, there were about 100 shader files upgraded to include water, land, buildings and aircraft.
Last edited by NickN on Sun Nov 11, 2007 8:06 pm, edited 1 time in total.
User avatar
NickN
Lieutenant Colonel
Lieutenant Colonel
 
Posts: 6317
Joined: Mon Sep 05, 2005 12:57 pm

Re: FSWC Update

Postby Ashton Lawson » Sun Nov 11, 2007 8:36 pm

Barnes, thanks for your support man.
Last edited by Ashton Lawson on Sun Nov 11, 2007 8:39 pm, edited 1 time in total.
Image
FS Water Configurator+ has new modifications in the works, plus DirectX 10, Service Pack
1, and Radeon HD 3+ Series support.
Ashton Lawson
Major
Major
 
Posts: 1211
Joined: Thu Jun 15, 2006 5:25 am
Location: Phuket, Thailand

Re: FSWC Update

Postby Barnes » Sun Nov 11, 2007 8:39 pm

Rats...

This is disappointing because, from reading other threads, it appears that Ingvarr was not interested in making any further FSX mods. He had only modified the SP1 version of Water20.fxh to prove a point to Phil Taylor.
Barnes
 

Re: FSWC Update

Postby Barnes » Sun Nov 11, 2007 8:49 pm

Sorry Str1ker, I posted before seeing your reply...
I'm glad to see that you are going to take a shot at modifying the SP2 Water20.fxh yourself!

Good Luck!!!
Barnes
 

Re: FSWC Update

Postby NickN » Sun Nov 11, 2007 8:54 pm

Just to give you an idea...


The original file is 15kb and the SP2 updated file is about 9.5kb so they changed quite a bit. The original file starts off as shown:

//---------------------------------------------------------------------------
// Flight Simulator X - Shader Effect Files
// Copyright (c) 2006, Microsoft Corporation
//---------------------------------------------------------------------------
#include
#include

#define vLightDir vSunVectorWorld

// Potential textures
texture Water_BaseTexture            : TEXTURE0;
texture LandDetailTexture       : TEXTURE1;
texture Water_FresnelTexture      : TEXTURE2;
texture Water_EnvTexture            : TEXTURE3;
texture Water_BumpTexture            : TEXTURE4;
texture Water_FXTexture                  : TEXTURE5;

// Global variables
matrix mEnv                  : WATERENVMATRIX;
matrix mTexBeml            : TEXBEMLMATRIX;
float3 vCamEyePoint : CAMERAPOSITION;
float4 vScales : SCALES;

#define fDetailScaleLand
Last edited by NickN on Sun Nov 11, 2007 9:13 pm, edited 1 time in total.
User avatar
NickN
Lieutenant Colonel
Lieutenant Colonel
 
Posts: 6317
Joined: Mon Sep 05, 2005 12:57 pm

Re: FSWC Update

Postby Ashton Lawson » Mon Nov 12, 2007 1:02 am

[quote]
Just to give you an idea...


The original file is 15kb and the SP2 updated file is about 9.5kb so they changed quite a bit. The original file starts off as shown:

//---------------------------------------------------------------------------
// Flight Simulator X - Shader Effect Files
// Copyright (c) 2006, Microsoft Corporation
//---------------------------------------------------------------------------
#include
#include

#define vLightDir vSunVectorWorld

// Potential textures
texture Water_BaseTexture            : TEXTURE0;
texture LandDetailTexture       : TEXTURE1;
texture Water_FresnelTexture      : TEXTURE2;
texture Water_EnvTexture            : TEXTURE3;
texture Water_BumpTexture            : TEXTURE4;
texture Water_FXTexture                  : TEXTURE5;

// Global variables
matrix mEnv                  : WATERENVMATRIX;
matrix mTexBeml            : TEXBEMLMATRIX;
float3 vCamEyePoint : CAMERAPOSITION;
float4 vScales : SCALES;

#define fDetailScaleLand
Image
FS Water Configurator+ has new modifications in the works, plus DirectX 10, Service Pack
1, and Radeon HD 3+ Series support.
Ashton Lawson
Major
Major
 
Posts: 1211
Joined: Thu Jun 15, 2006 5:25 am
Location: Phuket, Thailand

Re: FSWC Update

Postby NickN » Mon Nov 12, 2007 5:45 am

Remember that Ingvarr defined the min/max fresnel variables

#define fresnMin x.x
#define fresnMax x.x
Last edited by NickN on Mon Nov 12, 2007 6:00 am, edited 1 time in total.
User avatar
NickN
Lieutenant Colonel
Lieutenant Colonel
 
Posts: 6317
Joined: Mon Sep 05, 2005 12:57 pm

Re: FSWC Update

Postby NickN » Mon Nov 12, 2007 6:00 am

Code: Select all
        // 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 = float4(pow(o.vNormalWS.yyy,3),v.vColor.a);

    // 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;

        //float lightFactor_sun = 1.0;
        float lightFactor_sun = saturate(dot(vSunVectorWorld_Sun,vSurfaceNorm));

    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 };
        
    Color = float4(( (0.4 * lightFactor_sun+0.8) * lerp(baseColor, (0.5+baseColor)*envColor, Input.MiscData.x)).xyz,fAlpha);

    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);
}

User avatar
NickN
Lieutenant Colonel
Lieutenant Colonel
 
Posts: 6317
Joined: Mon Sep 05, 2005 12:57 pm

Re: FSWC Update

Postby Ashton Lawson » Mon Nov 12, 2007 6:03 am

[quote]


Remember that Ingvarr defined the min/max fresnel variables

#define fresnMin x.x
#define fresnMax x.x
Last edited by Ashton Lawson on Mon Nov 12, 2007 6:08 am, edited 1 time in total.
Image
FS Water Configurator+ has new modifications in the works, plus DirectX 10, Service Pack
1, and Radeon HD 3+ Series support.
Ashton Lawson
Major
Major
 
Posts: 1211
Joined: Thu Jun 15, 2006 5:25 am
Location: Phuket, Thailand

Re: FSWC Update

Postby NickN » Mon Nov 12, 2007 6:24 am

on its way in email and yes the code above is the clean SP2/Accel version

I have to run.

ltr
User avatar
NickN
Lieutenant Colonel
Lieutenant Colonel
 
Posts: 6317
Joined: Mon Sep 05, 2005 12:57 pm

Re: FSWC Update

Postby Flying Mouse » Mon Nov 12, 2007 6:31 am

WOw now this is called team work  ::) ::) ::)

You each deserve a whole year free subscription to your most liked cookie manufacturer.

Keep up th e wonderfull work  ;)
Coolermaster Storm Enforcer Chassis/ Corsair TX750W PSU/ Gigabyte Ga-990fxa Mobo/ AMD Phenom X4 965 BE 3.4Ghz C3/Coolermaster V6GT CPU air cooler/ 8GB RAM Corsair DDR3 2000Mhz/ Gigabyte GTX570 Overclocked Edition GPU/ Windows 7 Prem 64bit/ 750Gb & 150
User avatar
Flying Mouse
Major
Major
 
Posts: 1574
Joined: Wed May 23, 2007 3:58 am
Location: Somewhere in a bushplane

Re: FSWC Update

Postby NickN » Mon Nov 12, 2007 8:28 am

Just a quick follow up.. and an FYI

In SP1 the terrain shader folder which has its contents written at sim boot also changed in method in SP2. What happens now is the contents are written dynamically as the shader is called/used
User avatar
NickN
Lieutenant Colonel
Lieutenant Colonel
 
Posts: 6317
Joined: Mon Sep 05, 2005 12:57 pm

PreviousNext

Return to Flight Simulator X (FSX) and Steam

Who is online

Users browsing this forum: No registered users and 780 guests