public void initialize_scattersky()
            {
            Torque_Class_Helper tch = new Torque_Class_Helper("GFXStateBlockData", "ScatterSkySBData");
            tch.Props.Add("cullDefined", "true");
            tch.PropsAddString("cullMode", "GFXCullNone");
            tch.Props.Add("zDefined", "true");
            tch.Props.Add("zEnable", "true");
            tch.Props.Add("zWriteEnable", "false");
            tch.Props.Add("zFunc", "GFXCmpLessEqual");

            tch.Props.Add("samplersDefined", "true");
            tch.Props.Add("samplerStates[0]", "SamplerClampLinear");
            tch.Props.Add("samplerStates[1]", "SamplerClampLinear");
            tch.Props.Add("vertexColorEnable", "true");
            tch.Create();

            TorqueSingleton ts = new TorqueSingleton("ShaderData", "ScatterSkyShaderData");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/scatterSkyV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/scatterSkyP.hlsl");

            ts.PropsAddString("OGLVertexShaderFile", "shaders/common/gl/scatterSkyV.glsl");
            ts.PropsAddString("OGLPixelShaderFile", "shaders/common/gl/scatterSkyP.glsl");

            ts.Props.Add("pixVersion", "2.0");

            ts.Create();
            }
Exemple #2
0
        public void initbaselighting()
            {
            /*
             * client/lighting/advanced/shaders.cs  60000
             * client/lighting/advanced/lightViz.cs         61000
             * client/lighting/advanced/shadowViz.cs        62000
             * client/lighting/advanced/shadowViz.gui       63000
             * client/lighting/advanced/init.cs             64000
             * client/lighting/basic/init.cs                65000
             * client/lighting/basic/shadowFilter           66000
             * client/lighting/shadowMaps/init              67000
             */
            dnt.DoScriptInjection(ScriptType.Client, 66000, 66999);

            #region singleton GFXStateBlockData( BL_ProjectedShadowSBData )

            TorqueSingleton ts = new TorqueSingleton("GFXStateBlockData", "BL_ProjectedShadowSBData");
            ts.Props.Add("blendDefined", "true");
            ts.Props.Add("blendEnable", "true");
            ts.Props.Add("blendSrc", "GFXBlendDestColor");
            ts.Props.Add("blendDest", "GFXBlendZero");

            ts.Props.Add("zDefined", "true");
            ts.Props.Add("zEnable", "true");
            ts.Props.Add("zWriteEnable", "false");

            ts.Props.Add("samplersDefined", "true");
            ts.Props.Add("samplerStates[0]", "SamplerClampLinear");
            ts.Props.Add("vertexColorEnable", "true");
            ts.Create(m_ts);

            #endregion

            #region singleton ShaderData( BL_ProjectedShadowShaderData )

            ts = new TorqueSingleton("ShaderData", "BL_ProjectedShadowShaderData");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/projectedShadowV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/projectedShadowP.hlsl");

            ts.PropsAddString("OGLVertexShaderFile", "shaders/common/gl/projectedShadowV.glsl");
            ts.PropsAddString("OGLPixelShaderFile", "shaders/common/gl/projectedShadowP.glsl");

            ts.Props.Add("pixVersion", "2.0");
            ts.Create(m_ts);

            #endregion

            #region singleton CustomMaterial( BL_ProjectedShadowMaterial )

            ts = new TorqueSingleton("CustomMaterial", "BL_ProjectedShadowMaterial");
            ts.PropsAddString(@"sampler[""inputTex""]", "$miscbuff");

            ts.Props.Add("shader", "BL_ProjectedShadowShaderData");
            ts.Props.Add("stateBlock", "BL_ProjectedShadowSBData");
            ts.Props.Add("version", "2.0");
            ts.Props.Add("forwardLit", "true");
            ts.Create(m_ts);

            #endregion
            }
        public void GammaPostFX_Init()
            {
            TorqueSingleton ts = new TorqueSingleton("ShaderData", "GammaShader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/postFxV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/gammaP.hlsl");
            ts.Props.Add("pixVersion", "2.0");
            ts.Create();

            ts = new TorqueSingleton("GFXStateBlockData", "GammaStateBlock : PFX_DefaultStateBlock");
            ts.Props.Add("samplersDefined", "true");
            ts.Props.Add("samplerStates[0]", "SamplerClampLinear");
            ts.Props.Add("samplerStates[1]", "SamplerClampLinear");
            ts.Create();

            ts = new TorqueSingleton("PostEffect", "GammaPostFX");
            ts.Props.Add("isEnabled", "true");
            ts.Props.Add("allowReflectPass", "false");

            ts.PropsAddString("renderTime", "PFXBeforeBin");
            ts.PropsAddString("renderBin", "EditorBin");
            ts.Props.Add("renderPriority", "9999");

            ts.Props.Add("shader", "GammaShader");
            ts.Props.Add("stateBlock", "GammaStateBlock");

            ts.PropsAddString("texture[0]", "$backBuffer");
            ts.Props.Add("texture[1]", "$HDRPostFX::colorCorrectionRamp");
            ts.Create();
            }
        public void Initialize_AdvanceLight_LightViz4()
            {
            Torque_Class_Helper tch = new Torque_Class_Helper("ShaderData", "AL_ShadowVisualizeShader");
            tch.PropsAddString("DXVertexShaderFile", "shaders/common/guiMaterialV.hlsl");
            tch.PropsAddString("DXPixelShaderFile", "shaders/common/lighting/advanced/dbgShadowVisualizeP.hlsl");

            tch.PropsAddString("OGLVertexShaderFile", "shaders/common/gl/guiMaterialV.glsl");
            tch.PropsAddString("OGLPixelShaderFile", "shaders/common/lighting/advanced/gl/dbgShadowVisualizeP.glsl");

            tch.Props.Add("pixVersion", "2.0");
            tch.Create();

            tch = new Torque_Class_Helper("CustomMaterial", "AL_ShadowVisualizeMaterial");
            tch.Props.Add("shader", "AL_ShadowVisualizeShader");
            tch.Props.Add("stateBlock", "AL_DepthVisualizeState");

            tch.PropsAddString(@"sampler[""shadowMap""]", "#AL_ShadowVizTexture");
            tch.PropsAddString(@"sampler[""depthViz""]", "depthviz");

            tch.Props.Add("pixVersion", "2.0");
            tch.Create();

            TorqueSingleton ts = new TorqueSingleton("GuiControlProfile", "AL_ShadowLabelTextProfile");
            ts.PropsAddString("fontColor", "0 0 0");
            ts.Props.Add("autoSizeWidth", "true");
            ts.Props.Add("autoSizeHeight", "true");
            ts.PropsAddString("justify", "left");
            ts.Props.Add("fontSize", "14");
            ts.Create();
            }
        public void initialize_AudioStates()
            {
            TorqueSingleton ts = new TorqueSingleton("SFXState", "AudioStateNone");
            ts.Create(m_ts);

            console.Call("AudioStateNone", "activate");
            }
        public void initialize_clouds()
            {
            TorqueSingleton ts = new TorqueSingleton("ShaderData", "CloudLayerShader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/cloudLayerV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/cloudLayerP.hlsl");

            ts.PropsAddString("OGLVertexShaderFile", "shaders/common/gl/cloudLayerV.glsl");
            ts.PropsAddString("OGLPixelShaderFile", "shaders/common/gl/cloudLayerP.glsl");
            ts.Props.Add("pixVersion", "2.0");
            ts.Create();


            //------------------------------------------------------------------------------
            // BasicClouds
            //------------------------------------------------------------------------------

            ts = new TorqueSingleton("ShaderData", "BasicCloudsShader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/basicCloudsV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/basicCloudsP.hlsl");

            //OGLVertexShaderFile = "shaders/common/gl/basicCloudsV.glsl";
            //OGLPixelShaderFile = "shaders/common/gl/basicCloudsP.glsl";

            ts.Props.Add("pixVersion", "2.0");
            ts.Create();
            }
        public void fxaa_Init()
            {
            TorqueSingleton ts = new TorqueSingleton("GFXStateBlockData", "FXAA_StateBlock : PFX_DefaultStateBlock");
            ts.Props.Add("samplersDefined", "true");
            ts.Props.Add("samplerStates[0]", "SamplerClampLinear");
            ts.Create();

            ts = new TorqueSingleton("ShaderData", "FXAA_ShaderData");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/fxaa/fxaaV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/fxaa/fxaaP.hlsl");
            ts.PropsAddString("samplerNames[0]", "$colorTex");
            ts.Props.Add("pixVersion", "3.0");
            ts.Create();

            ts = new TorqueSingleton("PostEffect", "FXAA_PostEffect");
            ts.Props.Add("isEnabled", "false");

            ts.Props.Add("allowReflectPass", "false");
            ts.PropsAddString("renderTime", "PFXAfterDiffuse");

            ts.PropsAddString("texture[0]", "$backBuffer");

            ts.PropsAddString("target", "$backBuffer");

            ts.Props.Add("stateBlock", "FXAA_StateBlock");
            ts.Props.Add("shader", "FXAA_ShaderData");
            ts.Create();
            }
        public void lightRay_Init()
            {
            fGlobal["$LightRayPostFX::brightScalar"] = 0.75f;
            fGlobal["$LightRayPostFX::numSamples"] = 40f;
            fGlobal["$LightRayPostFX::density"] = 0.94f;
            fGlobal["$LightRayPostFX::weight"] = 5.65f;
            fGlobal["$LightRayPostFX::decay"] = 1.0f;
            fGlobal["$LightRayPostFX::exposure"] = 0.0005f;
            fGlobal["$LightRayPostFX::resolutionScale"] = 1.0f;


            TorqueSingleton ts = new TorqueSingleton("ShaderData", "LightRayOccludeShader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/postFxV.hlsl");
            ts.PropsAddString(" DXPixelShaderFile", "shaders/common/postFx/lightRay/lightRayOccludeP.hlsl");
            ts.Props.Add("pixVersion", "3.0");
            ts.Create();

            ts = new TorqueSingleton("ShaderData", "LightRayShader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/postFxV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/lightRay/lightRayP.hlsl");
            ts.Props.Add("pixVersion", "3.0");
            ts.Create();

            ts = new TorqueSingleton("GFXStateBlockData", "LightRayStateBlock : PFX_DefaultStateBlock");
            ts.Props.Add("samplersDefined", "true");
            ts.Props.Add("samplerStates[0]", "SamplerClampLinear");
            ts.Props.Add("samplerStates[1]", "SamplerClampLinear");
            ts.Create();

            console.Eval(@"
singleton PostEffect( LightRayPostFX )
{
   isEnabled = false;
   allowReflectPass = false;
        
   renderTime = ""PFXAfterDiffuse"";
   renderPriority = 0.1;
      
   shader = LightRayOccludeShader;
   stateBlock = LightRayStateBlock;
   texture[0] = ""$backBuffer"";
   texture[1] = ""#prepass"";
   target = ""$outTex"";
   targetFormat = ""GFXFormatR16G16B16A16F"";
      
   new PostEffect()
   {
      shader = LightRayShader;
      stateBlock = LightRayStateBlock;
      internalName = ""final"";
      texture[0] = ""$inTex"";
      texture[1] = ""$backBuffer"";
      target = ""$backBuffer"";
   };
};
");
            }
        public void terrainBlock_Init()
            {
            TorqueSingleton ts = new TorqueSingleton("ShaderData", "TerrainBlendShader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/terrain/blendV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/terrain/blendP.hlsl");

            ts.PropsAddString("OGLVertexShaderFile", "shaders/common/terrain/gl/blendV.glsl");
            ts.PropsAddString("OGLPixelShaderFile", "shaders/common/terrain/gl/blendP.glsl");
            ts.Props.Add("pixVersion", "2.0");
            ts.Create(m_ts);
            }
        public void InitAudioData()
            {
            TorqueSingleton ts = new TorqueSingleton("SFXDescription", "BulletFireDesc : AudioEffect");
            ts.Props.Add("isLooping", "false");
            ts.Props.Add("is3D", "true");
            ts.Props.Add("ReferenceDistance", "10.0");
            ts.Props.Add("MaxDistance", "60.0");
            ts.Create(m_ts);

            ts = new TorqueSingleton("SFXDescription", "BulletImpactDesc : AudioEffect");
            ts.Props.Add("isLooping", "false");
            ts.Props.Add("is3D", "true");
            ts.Props.Add("ReferenceDistance", "10.0");
            ts.Props.Add("MaxDistance", "30.0");
            ts.Create(m_ts);
            }
        public void materials_Init()
            {
            TorqueSingleton ts = new TorqueSingleton("Material", "WarningMaterial");
            ts.PropsAddString("diffuseMap[0]", "core/art/warnMat");
            ts.Props.Add("emissive[0]", "false");
            ts.Props.Add("translucent", "false");
            ts.Create(m_ts);

            ts = new TorqueSingleton("CubemapData", "WarnMatCubeMap");
            ts.PropsAddString("cubeFace[0]", "core/art/warnMat");
            ts.PropsAddString("cubeFace[1]", "core/art/warnMat");
            ts.PropsAddString("cubeFace[2]", "core/art/warnMat");
            ts.PropsAddString("cubeFace[3]", "core/art/warnMat");
            ts.PropsAddString("cubeFace[4]", "core/art/warnMat");
            ts.PropsAddString("cubeFace[5]", "core/art/warnMat");
            ts.Create(m_ts);
            }
        public void chromaticLens_init()
            {
            console.SetVar("$CAPostFx::enabled", false);
            // The lens distortion coefficient.
            console.SetVar("$CAPostFx::distCoeffecient", -0.05);
            // The cubic distortion value.
            console.SetVar("$CAPostFx::cubeDistortionFactor", -0.1);
            // The amount and direction of the maxium shift for
            // the red, green, and blue channels.
            console.SetVar("$CAPostFx::colorDistortionFactor", "0.005 -0.005 0.01");


            TorqueSingleton ts = new TorqueSingleton("GFXStateBlockData", "PFX_DefaultChromaticLensStateBlock");

            ts.Props.Add("zDefined", "true");
            ts.Props.Add("zEnable", "false");
            ts.Props.Add("zWriteEnable", "false");
            ts.Props.Add("samplersDefined", "true");
            ts.Props.Add("samplerStates[0]", "SamplerClampPoint");
            ts.Create(m_ts);

            ts = new TorqueSingleton("ShaderData", "PFX_ChromaticLensShader");

            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/postFxV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/chromaticLens.hlsl");
            ts.Props.Add("pixVersion", "3.0");
            ts.Create(m_ts);


            ts = new TorqueSingleton("PostEffect", "ChromaticLensPostFX");
            ts.PropsAddString("renderTime", "PFXAfterDiffuse");
            ts.Props.Add("renderPriority", "0.2");
            ts.Props.Add("isEnabled", "false");
            ts.Props.Add("allowReflectPass", "false");

            ts.Props.Add("shader", "PFX_ChromaticLensShader");
            ts.Props.Add("stateBlock", "PFX_DefaultChromaticLensStateBlock");
            ts.PropsAddString("texture[0]", "$backBuffer");
            ts.PropsAddString("target", "backBuffer");
            ts.Create(m_ts);
            }
        public void Initialize_AudioAmbiences()
            {
            TorqueSingleton ts = new TorqueSingleton("SFXAmbience", "AudioAmbienceDefault");
            ts.Props.Add("environment", " AudioEnvOff");
            ts.Create();

            ts = new TorqueSingleton("SFXAmbience", "AudioAmbienceOutside");
            ts.Props.Add("environment", "AudioEnvPlain");
            ts.Props.Add("states[ 0 ]", "AudioLocationOutside");
            ts.Create();

            ts = new TorqueSingleton("SFXAmbience", "AudioAmbienceInside");
            ts.Props.Add("environment", "AudioEnvRoom");
            ts.Props.Add("states[ 0 ]", "AudioLocationInside");
            ts.Create();

            ts = new TorqueSingleton("SFXAmbience", "AudioAmbienceUnderwater");
            ts.Props.Add("environment", "AudioEnvUnderwater");
            ts.Props.Add("states[ 0 ]", "AudioLocationUnderwater");
            ts.Create();
            }
        public void flash_Init()
            {
            TorqueSingleton ts = new TorqueSingleton("ShaderData", "PFX_FlashShader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/postFxV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/flashP.hlsl");
            ts.PropsAddString("defines", "WHITE_COLOR=float4(1.0,1.0,1.0,0.0);MUL_COLOR=float4(1.0,0.25,0.25,0.0)");
            ts.Props.Add("pixVersion", "2.0");
            ts.Create();

            ts = new TorqueSingleton("PostEffect", "FlashFx");
            ts.Props.Add("isEnabled", "false");
            ts.Props.Add("allowReflectPass", "false");

            ts.PropsAddString("renderTime", "PFXAfterDiffuse");

            ts.Props.Add("shader", "PFX_FlashShader");
            ts.PropsAddString("texture[0]", "$backBuffer");
            ts.Props.Add("renderPriority", "10");
            ts.Props.Add("stateBlock", "PFX_DefaultStateBlock");
            ts.Create();
            }
        public void initialize_postFx()
            {
            TorqueSingleton ts = new TorqueSingleton("GFXStateBlockData", "PFX_DefaultStateBlock");


            ts.Props.Add("zDefined", "true");
            ts.Props.Add("zEnable", "false");
            ts.Props.Add("zWriteEnable", "false");

            ts.Props.Add("samplersDefined", "true");
            ts.Props.Add("samplerStates[0]", "SamplerClampLinear");
            ts.Create(m_ts);

            ts = new TorqueSingleton("ShaderData", "PFX_PassthruShader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/postFxV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/passthruP.hlsl");
            //   OGLVertexShaderFile  = "shaders/common/postFx/gl//postFxV.glsl";
            //   OGLPixelShaderFile   = "shaders/common/postFx/gl/passthruP.glsl";
            ts.PropsAddString("samplerNames[0]", "$inputTex");
            ts.Props.Add("pixVersion", "2.0");
            ts.Create(m_ts);
            }
        public void shaders_Init()
            {
            TorqueSingleton ts = new TorqueSingleton("ShaderData", "_DebugInterior_");

            ts.PropsAddString("DXVertexShaderFile", "shaders/common/debugInteriorsV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/debugInteriorsP.hlsl");
            ts.PropsAddString("OGLVertexShaderFile", "shaders/common/gl/debugInteriorsV.glsl");
            ts.PropsAddString("OGLPixelShaderFile", "shaders/common/gl/debugInteriorsP.glsl");
            ts.Props.Add("pixVersion", "1.1");
            ts.Create();

            ts = new TorqueSingleton("ShaderData", "ParticlesShaderData");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/particlesV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/particlesP.hlsl");

            ts.PropsAddString("OGLVertexShaderFile", "shaders/common/gl/particlesV.glsl");
            ts.PropsAddString("OGLPixelShaderFile", "shaders/common/gl/particlesP.glsl");
            ts.Props.Add("pixVersion", "2.0");
            ts.Create();

            ts = new TorqueSingleton("ShaderData", "OffscreenParticleCompositeShaderData");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/particleCompositeV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/particleCompositeP.hlsl");

            ts.PropsAddString("OGLVertexShaderFile", "shaders/common/gl/particleCompositeV.glsl");
            ts.PropsAddString("OGLPixelShaderFile", "shaders/common/gl/particleCompositeP.glsl");
            ts.Props.Add("pixVersion", "2.0");
            ts.Create();

            //-----------------------------------------------------------------------------
            // Planar Reflection
            //-----------------------------------------------------------------------------

            Torque_Class_Helper tch = new Torque_Class_Helper("ShaderData", "ReflectBump");

            tch.PropsAddString("DXVertexShaderFile", "shaders/common/planarReflectBumpV.hlsl");
            tch.PropsAddString("DXPixelShaderFile", "shaders/common/planarReflectBumpP.hlsl");

            tch.PropsAddString("OGLVertexShaderFile", "shaders/common/gl/planarReflectBumpV.glsl");
            tch.PropsAddString("OGLPixelShaderFile", "shaders/common/gl/planarReflectBumpP.glsl");

            tch.PropsAddString("samplerNames[0]", "$diffuseMap");
            tch.PropsAddString("samplerNames[1]", "$refractMap");
            tch.PropsAddString("samplerNames[2]", "$bumpMap");
            tch.Props.Add("pixVersion", "2.0");
            tch.Create();

            tch = new Torque_Class_Helper("ShaderData", "Reflect");
            tch.PropsAddString("DXVertexShaderFile", "shaders/common/planarReflectV.hlsl");
            tch.PropsAddString("DXPixelShaderFile", "shaders/common/planarReflectP.hlsl");

            tch.PropsAddString("OGLVertexShaderFile", "shaders/common/gl/planarReflectV.glsl");
            tch.PropsAddString("OGLPixelShaderFile", "shaders/common/gl/planarReflectP.glsl");

            tch.PropsAddString("samplerNames[0]", "$diffuseMap");
            tch.PropsAddString("samplerNames[1]", "$refractMap");
            tch.Props.Add("pixVersion", "1.4");
            tch.Create();

            tch = new Torque_Class_Helper("ShaderData", "fxFoliageReplicatorShader");
            tch.PropsAddString("DXVertexShaderFile", "shaders/common/fxFoliageReplicatorV.hlsl");
            tch.PropsAddString("DXPixelShaderFile", "shaders/common/fxFoliageReplicatorP.hlsl");

            tch.PropsAddString("OGLVertexShaderFile", "shaders/common/gl/fxFoliageReplicatorV.glsl");
            tch.PropsAddString("OGLPixelShaderFile", "shaders/common/gl/fxFoliageReplicatorP.glsl");

            tch.PropsAddString("samplerNames[0]", "$diffuseMap");
            tch.PropsAddString("samplerNames[1]", "$alphaMap");
            tch.Props.Add("pixVersion", "1.4");
            tch.Create();
            }
Exemple #17
0
        public void dof_init1()
            {
            TorqueSingleton ts = new TorqueSingleton("PostEffect", "DOFPostEffect");
            ts.PropsAddString("renderTime", "PFXAfterBin");
            ts.PropsAddString("renderBin", "GlowBin");
            ts.Props.Add("renderPriority", "0.1");

            ts.Props.Add("shader", "PFX_DOFDownSampleShader");
            ts.Props.Add("stateBlock", "PFX_DOFDownSampleStateBlock");
            ts.PropsAddString("texture[0]", "$backBuffer");
            ts.PropsAddString("texture[1]", "#prepass");
            ts.PropsAddString("target", "#shrunk");
            ts.PropsAddString("targetScale", "0.25 0.25");

            ts.Props.Add("isEnabled", "false");
            coPostEffect DOFPostEffect = ts.Create();

            ts = new TorqueSingleton("PostEffect", "DOFBlurY");
            ts.Props.Add("shader", "PFX_DOFBlurYShader");
            ts.Props.Add("stateBlock", "PFX_DOFBlurStateBlock");
            ts.PropsAddString("texture[0]", "#shrunk");
            ts.PropsAddString("target", "$outTex");
            coPostEffect DOFBlurY = ts.Create();

            DOFPostEffect.add(DOFBlurY);


            ts = new TorqueSingleton("PostEffect", "DOFBlurX");
            ts.Props.Add("shader", "PFX_DOFBlurXShader");
            ts.Props.Add("stateBlock", "PFX_DOFBlurStateBlock");
            ts.PropsAddString("texture[0]", "$inTex");
            ts.PropsAddString("target", "#largeBlur");
            coPostEffect DOFBlurX = ts.Create();
            DOFPostEffect.add(DOFBlurX);

            ts = new TorqueSingleton("PostEffect", "DOFCalcCoC");
            ts.Props.Add("shader", "PFX_DOFCalcCoCShader");
            ts.Props.Add("stateBlock", "PFX_DOFCalcCoCStateBlock");
            ts.PropsAddString("texture[0]", "#shrunk");
            ts.PropsAddString("texture[1]", "#largeBlur");
            ts.PropsAddString("target", "$outTex");
            coPostEffect DOFCalcCoC = ts.Create();
            DOFPostEffect.add(DOFCalcCoC);


            ts = new TorqueSingleton("PostEffect", "DOFSmallBlur");
            ts.Props.Add("shader", "PFX_DOFSmallBlurShader");
            ts.Props.Add("stateBlock", "PFX_DefaultDOFStateBlock");
            ts.PropsAddString("texture[0]", "$inTex");
            ts.PropsAddString("target", "$outTex");
            coPostEffect DOFSmallBlur = ts.Create();
            DOFPostEffect.add(DOFSmallBlur);


            ts = new TorqueSingleton("PostEffect", "DOFFinalPFX");
            ts.Props.Add("shader", "PFX_DOFFinalShader");
            ts.Props.Add("stateBlock", "PFX_DOFFinalStateBlock");
            ts.PropsAddString("texture[0]", "$backBuffer");
            ts.PropsAddString("texture[1]", "$inTex");
            ts.PropsAddString("texture[2]", "#largeBlur");
            ts.PropsAddString("texture[3]", "#prepass");
            ts.PropsAddString("target", "$backBuffer");
            coPostEffect DOFFinalPFX = ts.Create();
            DOFPostEffect.add(DOFFinalPFX);
            }
Exemple #18
0
        public void dof_init()
            {
            TorqueSingleton ts = new TorqueSingleton("GFXStateBlockData", "PFX_DefaultDOFStateBlock");
            ts.Props.Add("zDefined", "true");
            ts.Props.Add("zEnable", "false");
            ts.Props.Add("zWriteEnable", "false");

            ts.Props.Add("samplersDefined", "true");
            ts.Props.Add("samplerStates[0]", "SamplerClampPoint");
            ts.Props.Add("samplerStates[1]", "SamplerClampPoint");
            ts.Create();

            ts = new TorqueSingleton("GFXStateBlockData", "PFX_DOFCalcCoCStateBlock");
            ts.Props.Add("zDefined", "true");
            ts.Props.Add("zEnable", "false");
            ts.Props.Add("zWriteEnable", "false");

            ts.Props.Add("samplersDefined", "true");
            ts.Props.Add("samplerStates[0]", "SamplerClampLinear");
            ts.Props.Add("samplerStates[1]", "SamplerClampLinear");
            ts.Create();

            ts = new TorqueSingleton("GFXStateBlockData", "PFX_DOFDownSampleStateBlock");
            ts.Props.Add("zDefined", "true");
            ts.Props.Add("zEnable", "false");
            ts.Props.Add("zWriteEnable", "false");

            ts.Props.Add("samplersDefined", "true");
            ts.Props.Add("samplerStates[0]", "SamplerClampLinear");
            ts.Props.Add("samplerStates[1]", "SamplerClampPoint");
            ts.Create();


            ts = new TorqueSingleton("GFXStateBlockData", "PFX_DOFBlurStateBlock");
            ts.Props.Add("zDefined", "true");
            ts.Props.Add("zEnable", "false");
            ts.Props.Add("zWriteEnable", "false");

            ts.Props.Add("samplersDefined", "true");
            ts.Props.Add("samplerStates[0]", "SamplerClampLinear");
            ts.Create();

            ts = new TorqueSingleton("GFXStateBlockData", "PFX_DOFFinalStateBlock");
            ts.Props.Add("zDefined", "true");
            ts.Props.Add("zEnable", "false");
            ts.Props.Add("zWriteEnable", "false");

            ts.Props.Add("samplersDefined", "true");
            ts.Props.Add("samplerStates[0]", "SamplerClampLinear");
            ts.Props.Add("samplerStates[1]", "SamplerClampLinear");
            ts.Props.Add("samplerStates[2]", "SamplerClampLinear");
            ts.Props.Add("samplerStates[3]", "SamplerClampPoint");

            ts.Props.Add("blendDefined", "true");
            ts.Props.Add("blendEnable", "true");
            ts.Props.Add("blendDest", "GFXBlendInvSrcAlpha");
            ts.Props.Add("blendSrc", "GFXBlendOne");
            ts.Create();

            ts = new TorqueSingleton("ShaderData", "PFX_DOFDownSampleShader");

            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/dof/DOF_DownSample_V.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/dof/DOF_DownSample_P.hlsl");
            ts.Props.Add("pixVersion", "3.0");
            ts.Create();

            ts = new TorqueSingleton("ShaderData", "PFX_DOFBlurYShader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/dof/DOF_Gausian_V.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/dof/DOF_Gausian_P.hlsl");
            ts.Props.Add("pixVersion", "2.0");
            ts.PropsAddString("defines", "BLUR_DIR=float2(0.0,1.0)");
            ts.Create();

            ts = new TorqueSingleton("ShaderData", "PFX_DOFBlurXShader : PFX_DOFBlurYShader");
            ts.PropsAddString("defines", "BLUR_DIR=float2(1.0,0.0)");
            ts.Create();

            ts = new TorqueSingleton("ShaderData", "PFX_DOFCalcCoCShader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/dof/DOF_CalcCoC_V.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/dof/DOF_CalcCoC_P.hlsl");
            ts.Props.Add("pixVersion", "3.0");
            ts.Create();

            ts = new TorqueSingleton("ShaderData", "PFX_DOFSmallBlurShader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/dof/DOF_SmallBlur_V.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/dof/DOF_SmallBlur_P.hlsl");
            ts.Props.Add("pixVersion", "3.0");
            ts.Create();

            ts = new TorqueSingleton("ShaderData", "PFX_DOFFinalShader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/dof/DOF_Final_V.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/dof/DOF_Final_P.hlsl");
            ts.Props.Add("pixVersion", "3.0");
            ts.Create();
            }
Exemple #19
0
        public void Initialize_Audio()
            {
            new TorqueSingleton("SFXDescription", "AudioMaster").Create();
            TorqueSingleton ts = new TorqueSingleton("SFXSource", "AudioChannelMaster");
            ts.Props.Add("description", "AudioMaster");
            ts.Create();

            ts = new TorqueSingleton("SFXDescription", "AudioChannel");
            ts.Props.Add("sourceGroup", "AudioChannelMaster");
            ts.Create();

            ts = new TorqueSingleton("SFXSource", "AudioChannelDefault");
            ts.Props.Add("description", "AudioChannel");
            ts.Create();

            ts = new TorqueSingleton("SFXSource", "AudioChannelGui");
            ts.Props.Add("description", "AudioChannel");
            ts.Create();

            ts = new TorqueSingleton("SFXSource", "AudioChannelEffects");
            ts.Props.Add("description", "AudioChannel");
            ts.Create();

            ts = new TorqueSingleton("SFXSource", "AudioChannelMessages");
            ts.Props.Add("description", "AudioChannel");
            ts.Create();

            ts = new TorqueSingleton("SFXSource", "AudioChannelMusic");
            ts.Props.Add("description", "AudioChannel");
            ts.Create();

            ((coSFXSource)"AudioChannelMaster").play(-1);
            ((coSFXSource)"AudioChannelDefault").play(-1);
            ((coSFXSource)"AudioChannelGui").play(-1);
            ((coSFXSource)"AudioChannelMusic").play(-1);
            ((coSFXSource)"AudioChannelMessages").play(-1);
            ((coSFXSource)"AudioChannelEffects").stop(-1);


            //SFXSource.play("AudioChannelMaster", -1);
            //SFXSource.play("AudioChannelDefault", -1);
            //SFXSource.play("AudioChannelGui", -1);
            //SFXSource.play("AudioChannelMusic", -1);
            //SFXSource.play("AudioChannelMessages", -1);

            //SFXSource.stop("AudioChannelEffects", -1);
            //-----------------------------------------------------------------------------
            //    Master SFXDescriptions.
            //-----------------------------------------------------------------------------

            // Master description for interface audio.
            ts = new TorqueSingleton("SFXDescription", "AudioGui");
            ts.Props.Add("volume", "1.0");
            ts.Props.Add("sourceGroup", "AudioChannelGui");
            ts.Create();


            ts = new TorqueSingleton("SFXDescription", "AudioEffect");
            ts.Props.Add("volume", "1.0");
            ts.Props.Add("sourceGroup", "AudioChannelEffects");
            ts.Create();

            ts = new TorqueSingleton("SFXDescription", "AudioMessage");
            ts.Props.Add("volume", "1.0");
            ts.Props.Add("sourceGroup", "AudioChannelMessages");
            ts.Create();

            ts = new TorqueSingleton("SFXDescription", "AudioMusic");
            ts.Props.Add("volume", "1.0");
            ts.Props.Add("sourceGroup", "AudioChannelMusic");
            ts.Create();

            iGlobal["$GuiAudioType"] = 1;
            iGlobal["$SimAudioType"] = 2;
            iGlobal["$MessageAudioType"] = 3;
            iGlobal["$MusicAudioType"] = 4;
            sGlobal["$AudioChannels[0]"] = "AudioChannelDefault";
            sGlobal["$AudioChannels[1]"] = "AudioChannelGui";
            sGlobal["$AudioChannels[2]"] = "AudioChannelEffects";
            sGlobal["$AudioChannels[3]"] = "AudioChannelMessages";
            sGlobal["$AudioChannels[4]"] = "AudioChannelMusic";
            new TorqueSingleton("SimSet", "SFXPausedSet").Create();
            }
        public void initRenderManager_Auto1()
            {
            TorqueSingleton ts = new TorqueSingleton("GFXStateBlockData", "AL_FormatTokenState : PFX_DefaultStateBlock");
            ts.Props.Add("samplersDefined", "true");
            ts.Props.Add("samplerStates[0]", "SamplerClampPoint");
            ts.Create(m_ts);

            ts = new TorqueSingleton("PostEffect", "AL_FormatCopy");
            ts.Props.Add("isEnabled", "false");
            ts.Props.Add("allowReflectPass", "true");
            ts.Props.Add("shader", "PFX_PassthruShader");
            ts.Props.Add("stateBlock", "AL_FormatTokenState");
            ts.PropsAddString("texture[0]", "$inTex");
            ts.PropsAddString("target", "$backbuffer");
            ts.Create(m_ts);
            }
Exemple #21
0
        public void initialize_SSAO1()
            {
            TorqueSingleton ts = new TorqueSingleton("GFXStateBlockData", "SSAOStateBlock : PFX_DefaultStateBlock");
            ts.Props.Add("samplersDefined", "true");
            ts.Props.Add("samplerStates[0]", "SamplerClampPoint");
            ts.Props.Add("samplerStates[1]", "SamplerWrapLinear");
            ts.Props.Add("samplerStates[2]", "SamplerClampPoint");
            ts.Create(m_ts);


            ts = new TorqueSingleton("GFXStateBlockData", "SSAOBlurStateBlock : PFX_DefaultStateBlock");
            ts.Props.Add("samplersDefined", "true");
            ts.Props.Add("samplerStates[0]", "SamplerClampLinear");
            ts.Props.Add("samplerStates[1]", "SamplerClampPoint");
            ts.Create(m_ts);


            ts = new TorqueSingleton("ShaderData", "SSAOShader");

            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/postFxV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/ssao/SSAO_P.hlsl");
            ts.Props.Add("pixVersion", "3.0");
            ts.Create(m_ts);


            ts = new TorqueSingleton("ShaderData", "SSAOBlurYShader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/ssao/SSAO_Blur_V.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/ssao/SSAO_Blur_P.hlsl");
            ts.Props.Add("pixVersion", "3.0");

            ts.PropsAddString("defines", "BLUR_DIR=float2(0.0,1.0)");
            ts.Create(m_ts);


            ts = new TorqueSingleton("ShaderData", "SSAOBlurXShader : SSAOBlurYShader");
            ts.PropsAddString("defines", "BLUR_DIR=float2(1.0,0.0)");
            ts.Create(m_ts);

            console.Eval(@"
singleton PostEffect( SSAOPostFx )
{     
   allowReflectPass = false;
     
   renderTime = ""PFXBeforeBin"";
   renderBin = ""AL_LightBinMgr"";   
   renderPriority = 10;
   
   shader = SSAOShader;
   stateBlock = SSAOStateBlock;
         
   texture[0] = ""#prepass"";         
   texture[1] = ""$noise_png"";
   texture[2] = ""#ssao_pow_table"";
   
   target = ""$outTex"";
   targetScale = ""0.5 0.5"";
   
   singleton PostEffect()
   {
      internalName = ""blurY"";
      
      shader = SSAOBlurYShader;
      stateBlock = SSAOBlurStateBlock;
      
      texture[0] = ""$inTex"";
      texture[1] = ""#prepass"";
      
      target = ""$outTex""; 
   };
      
   singleton PostEffect()
   {
      internalName = ""blurX"";
      
      shader = SSAOBlurXShader;
      stateBlock = SSAOBlurStateBlock;
      
      texture[0] = ""$inTex"";
      texture[1] = ""#prepass"";
      
      target = ""$outTex""; 
   };   
   
   singleton PostEffect()
   {
      internalName = ""blurY2"";
      
      shader = SSAOBlurYShader;
      stateBlock = SSAOBlurStateBlock;
            
      texture[0] = ""$inTex"";
      texture[1] = ""#prepass"";
      
      target = ""$outTex""; 
   };
   
   singleton PostEffect()
   {
      internalName = ""blurX2"";
            
      shader = SSAOBlurXShader;
      stateBlock = SSAOBlurStateBlock;
            
      texture[0] = ""$inTex"";
      texture[1] = ""#prepass"";

      target = ""#ssaoMask"";   
   };  
};


");

            ts = new TorqueSingleton("PostEffect", "SSAOVizPostFx");
            ts.Props.Add("allowReflectPass", "false");
            ts.Props.Add("shader", "PFX_PassthruShader");
            ts.Props.Add("stateBlock", "PFX_DefaultStateBlock");
            ts.PropsAddString("texture[0]", "#ssaoMask");
            ts.PropsAddString("target", "$backbuffer");
            ts.Create(m_ts);


            ts = new TorqueSingleton("ShaderData", "SSAOPowTableShader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/ssao/SSAO_PowerTable_V.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/ssao/SSAO_PowerTable_P.hlsl");
            ts.Props.Add("pixVersion", "2.0");
            ts.Create(m_ts);

            ts = new TorqueSingleton("PostEffect", "SSAOPowTablePostFx");
            ts.Props.Add("shader", "SSAOPowTableShader");
            ts.Props.Add("stateBlock", "PFX_DefaultStateBlock");

            ts.PropsAddString("renderTime", "PFXTexGenOnDemand");

            ts.PropsAddString("target", "#ssao_pow_table");

            ts.PropsAddString("targetFormat", "GFXFormatR16F");
            ts.PropsAddString("targetSize", "256 1");
            ts.Create(m_ts);

            console.SetVar("$noise_png", noise_png);
            }
        public void Initialize_AudioEnviroments()
            {
            TorqueSingleton ts = new TorqueSingleton("SFXEnvironment", "AudioEnvOff");
            ts.PropsAddString("envSize ".Trim(), "7.5");
            ts.PropsAddString("envDiffusion ".Trim(), "1.0");
            ts.PropsAddString("room ".Trim(), "-10000");
            ts.PropsAddString("roomHF ".Trim(), "-10000");
            ts.PropsAddString("roomLF ".Trim(), "0");
            ts.PropsAddString("decayTime ".Trim(), "1.0");
            ts.PropsAddString("decayHFRatio ".Trim(), "1.0");
            ts.PropsAddString("decayLFRatio ".Trim(), "1.0");
            ts.PropsAddString("reflections ".Trim(), "-2602");
            ts.PropsAddString("reflectionsDelay ".Trim(), "0.007");
            ts.PropsAddString("reflectionsPan[ 0 ] ".Trim(), "0.0");
            ts.PropsAddString("reflectionsPan[ 1 ] ".Trim(), "0.0");
            ts.PropsAddString("reflectionsPan[ 2 ] ".Trim(), "0.0");
            ts.PropsAddString("reverb ".Trim(), "200");
            ts.PropsAddString("reverbDelay ".Trim(), "0.011");
            ts.PropsAddString("reverbPan[ 0 ] ".Trim(), "0.0");
            ts.PropsAddString("reverbPan[ 1 ] ".Trim(), "0.0");
            ts.PropsAddString("reverbPan[ 2 ] ".Trim(), "0.0");
            ts.PropsAddString("echoTime ".Trim(), "0.25");
            ts.PropsAddString("echoDepth ".Trim(), "0.0");
            ts.PropsAddString("modulationTime ".Trim(), "0.25");
            ts.PropsAddString("modulationDepth ".Trim(), "0.0");
            ts.PropsAddString("airAbsorptionHF ".Trim(), "-5.0");
            ts.PropsAddString("HFReference ".Trim(), "5000.0");
            ts.PropsAddString("LFReference ".Trim(), "250.0");
            ts.PropsAddString("roomRolloffFactor ".Trim(), "0.0");
            ts.PropsAddString("diffusion ".Trim(), "0.0");
            ts.PropsAddString("density ".Trim(), "0.0");
            ts.Props.Add("flags ".Trim(), "0x33");
            ts.Create();

            ts = new TorqueSingleton("SFXEnvironment", "AudioEnvGeneric");
            ts.PropsAddString("envSize", "7.5");
            ts.PropsAddString("envDiffusion", "1.0");
            ts.PropsAddString("room", "-1000");
            ts.PropsAddString("roomHF", "-100");
            ts.PropsAddString("roomLF", "0");
            ts.PropsAddString("decayTime", "1.49");
            ts.PropsAddString("decayHFRatio", "0.83");
            ts.PropsAddString("decayLFRatio", "1.0");
            ts.PropsAddString("reflections", "-2602");
            ts.PropsAddString("reflectionsDelay", "0.007");
            ts.PropsAddString("reflectionsPan[ 0 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 1 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 2 ]", "0.0");
            ts.PropsAddString("reverb", "200");
            ts.PropsAddString("reverbDelay", "0.011");
            ts.PropsAddString("reverbPan[ 0 ]", "0.0");
            ts.PropsAddString("reverbPan[ 1 ]", "0.0");
            ts.PropsAddString("reverbPan[ 2 ]", "0.0");
            ts.PropsAddString("echoTime", "0.25");
            ts.PropsAddString("echoDepth", "0.0");
            ts.PropsAddString("modulationTime", "0.25");
            ts.PropsAddString("modulationDepth", "0.0");
            ts.PropsAddString("airAbsorptionHF", "-5.0");
            ts.PropsAddString("HFReference", "5000.0");
            ts.PropsAddString("LFReference", "250.0");
            ts.PropsAddString("roomRolloffFactor", "0.0");
            ts.PropsAddString("diffusion", "100.0");
            ts.PropsAddString("density", "100.0");
            ts.Props.Add("flags", "0x3f");
            ts.Create();

            ts = new TorqueSingleton("SFXEnvironment", "AudioEnvRoom");
            ts.PropsAddString("envSize", "1.9");
            ts.PropsAddString("envDiffusion", "1.0");
            ts.PropsAddString("room", "-1000");
            ts.PropsAddString("roomHF", "-454");
            ts.PropsAddString("roomLF", "0");
            ts.PropsAddString("decayTime", "0.4");
            ts.PropsAddString("decayHFRatio", "0.83");
            ts.PropsAddString("decayLFRatio", "1.0");
            ts.PropsAddString("reflections", "-1646");
            ts.PropsAddString("reflectionsDelay", "0.002");
            ts.PropsAddString("reflectionsPan[ 0 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 1 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 2 ]", "0.0");
            ts.PropsAddString("reverb", "53");
            ts.PropsAddString("reverbDelay", "0.003");
            ts.PropsAddString("reverbPan[ 0 ]", "0.0");
            ts.PropsAddString("reverbPan[ 1 ]", "0.0");
            ts.PropsAddString("reverbPan[ 2 ]", "0.0");
            ts.PropsAddString("echoTime", "0.25");
            ts.PropsAddString("echoDepth", "0.0");
            ts.PropsAddString("modulationTime", "0.25");
            ts.PropsAddString("modulationDepth", "0.0");
            ts.PropsAddString("airAbsorptionHF", "-5.0");
            ts.PropsAddString("HFReference", "5000.0");
            ts.PropsAddString("LFReference", "250.0");
            ts.PropsAddString("roomRolloffFactor", "0.0");
            ts.PropsAddString("diffusion", "100.0");
            ts.PropsAddString("density", "100.0");
            ts.Props.Add("flags", "0x3f");
            ts.Create();

            ts = new TorqueSingleton("SFXEnvironment", "AudioEnvPaddedCell");
            ts.PropsAddString("envSize", "1.4");
            ts.PropsAddString("envDiffusion", "1.0");
            ts.PropsAddString("room", "-1000");
            ts.PropsAddString("roomHF", "-6000");
            ts.PropsAddString("roomLF", "0");
            ts.PropsAddString("decayTime", "0.17");
            ts.PropsAddString("decayHFRatio", "0.1");
            ts.PropsAddString("decayLFRatio", "1.0");
            ts.PropsAddString("reflections", "-1204");
            ts.PropsAddString("reflectionsDelay", "0.001");
            ts.PropsAddString("reflectionsPan[ 0 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 1 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 2 ]", "0.0");
            ts.PropsAddString("reverb", "207");
            ts.PropsAddString("reverbDelay", "0.002");
            ts.PropsAddString("reverbPan[ 0 ]", "0.0");
            ts.PropsAddString("reverbPan[ 1 ]", "0.0");
            ts.PropsAddString("reverbPan[ 2 ]", "0.0");
            ts.PropsAddString("echoTime", "0.25");
            ts.PropsAddString("echoDepth", "0.0");
            ts.PropsAddString("modulationTime", "0.25");
            ts.PropsAddString("modulationDepth", "0.0");
            ts.PropsAddString("airAbsorptionHF", "-5.0");
            ts.PropsAddString("HFReference", "5000.0");
            ts.PropsAddString("LFReference", "250.0");
            ts.PropsAddString("roomRolloffFactor", "0.0");
            ts.PropsAddString("diffusion", "100.0");
            ts.PropsAddString("density", "100.0");
            ts.Props.Add("flags", "0x3f");
            ts.Create();

            ts = new TorqueSingleton("SFXEnvironment", "AudioEnvBathroom");
            ts.PropsAddString("envSize", "1.4");
            ts.PropsAddString("envDiffusion", "1.0");
            ts.PropsAddString("room", "-1000");
            ts.PropsAddString("roomHF", "-1200");
            ts.PropsAddString("roomLF", "0");
            ts.PropsAddString("decayTime", "1.49");
            ts.PropsAddString("decayHFRatio", "0.54");
            ts.PropsAddString("decayLFRatio", "1.0");
            ts.PropsAddString("reflections", "-370");
            ts.PropsAddString("reflectionsDelay", "0.007");
            ts.PropsAddString("reflectionsPan[ 0 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 1 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 2 ]", "0.0");
            ts.PropsAddString("reverb", "1030");
            ts.PropsAddString("reverbDelay", "0.011");
            ts.PropsAddString("reverbPan[ 0 ]", "0.0");
            ts.PropsAddString("reverbPan[ 1 ]", "0.0");
            ts.PropsAddString("reverbPan[ 2 ]", "0.0");
            ts.PropsAddString("echoTime", "0.25");
            ts.PropsAddString("echoDepth", "0.0");
            ts.PropsAddString("modulationTime", "0.25");
            ts.PropsAddString("modulationDepth", "0.0");
            ts.PropsAddString("airAbsorptionHF", "-5.0");
            ts.PropsAddString("HFReference", "5000.0");
            ts.PropsAddString("LFReference", "250.0");
            ts.PropsAddString("roomRolloffFactor", "0.0");
            ts.PropsAddString("diffusion", "100.0");
            ts.PropsAddString("density", "60.0");
            ts.Props.Add("flags", "0x3f");
            ts.Create();

            ts = new TorqueSingleton("SFXEnvironment", "AudioEnvLivingRoom");
            ts.PropsAddString("envSize", "2.5");
            ts.PropsAddString("envDiffusion", "1.0");
            ts.PropsAddString("room", "-1000");
            ts.PropsAddString("roomHF", "-6000");
            ts.PropsAddString("roomLF", "0");
            ts.PropsAddString("decayTime", "0.5");
            ts.PropsAddString("decayHFRatio", "0.1");
            ts.PropsAddString("decayLFRatio", "1.0");
            ts.PropsAddString("reflections", "-1376");
            ts.PropsAddString("reflectionsDelay", "0.003");
            ts.PropsAddString("reflectionsPan[ 0 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 1 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 2 ]", "0.0");
            ts.PropsAddString("reverb", "-1104");
            ts.PropsAddString("reverbDelay", "0.004");
            ts.PropsAddString("reverbPan[ 0 ]", "0.0");
            ts.PropsAddString("reverbPan[ 1 ]", "0.0");
            ts.PropsAddString("reverbPan[ 2 ]", "0.0");
            ts.PropsAddString("echoTime", "0.25");
            ts.PropsAddString("echoDepth", "0.0");
            ts.PropsAddString("modulationTime", "0.25");
            ts.PropsAddString("modulationDepth", "0.0");
            ts.PropsAddString("airAbsorptionHF", "-5.0");
            ts.PropsAddString("HFReference", "5000.0");
            ts.PropsAddString("LFReference", "250.0");
            ts.PropsAddString("roomRolloffFactor", "0.0");
            ts.PropsAddString("diffusion", "100.0");
            ts.PropsAddString("density", "100.0");
            ts.Props.Add("flags", "0x3f");
            ts.Create();

            ts = new TorqueSingleton("SFXEnvironment", "AudioEnvStoneRoom");
            ts.PropsAddString("envSize", "11.6");
            ts.PropsAddString("envDiffusion", "1.0");
            ts.PropsAddString("room", "-1000");
            ts.PropsAddString("roomHF", "300");
            ts.PropsAddString("roomLF", "0");
            ts.PropsAddString("decayTime", "2.31");
            ts.PropsAddString("decayHFRatio", "0.64");
            ts.PropsAddString("decayLFRatio", "1.0");
            ts.PropsAddString("reflections", "-711");
            ts.PropsAddString("reflectionsDelay", "0.012");
            ts.PropsAddString("reflectionsPan[ 0 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 1 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 2 ]", "0.0");
            ts.PropsAddString("reverb", "83");
            ts.PropsAddString("reverbDelay", "0.017");
            ts.PropsAddString("reverbPan[ 0 ]", "0.0");
            ts.PropsAddString("reverbPan[ 1 ]", "0.0");
            ts.PropsAddString("reverbPan[ 2 ]", "0.0");
            ts.PropsAddString("echoTime", "0.25");
            ts.PropsAddString("echoDepth", "0.0");
            ts.PropsAddString("modulationTime", "0.25");
            ts.PropsAddString("modulationDepth", "0.0");
            ts.PropsAddString("airAbsorptionHF", "-5.0");
            ts.PropsAddString("HFReference", "-5000.0");
            ts.PropsAddString("LFReference", "250.0");
            ts.PropsAddString("roomRolloffFactor", "0.0");
            ts.PropsAddString("diffusion", "100.0");
            ts.PropsAddString("density", "100.0");
            ts.Props.Add("flags", "0x3f");
            ts.Create();

            ts = new TorqueSingleton("SFXEnvironment", "AudioEnvAuditorium");
            ts.PropsAddString("envSize", "21.6");
            ts.PropsAddString("envDiffusion", "1.0");
            ts.PropsAddString("room", "-1000");
            ts.PropsAddString("roomHF", "-476");
            ts.PropsAddString("roomLF", "0");
            ts.PropsAddString("decayTime", "4.32");
            ts.PropsAddString("decayHFRatio", "0.59");
            ts.PropsAddString("decayLFRatio", "1.0");
            ts.PropsAddString("reflections", "0.789");
            ts.PropsAddString("reflectionsDelay", "0.02");
            ts.PropsAddString("reflectionsPan[ 0 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 1 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 2 ]", "0.0");
            ts.PropsAddString("reverb", "-289");
            ts.PropsAddString("reverbDelay", "0.03");
            ts.PropsAddString("reverbPan[ 0 ]", "0.0");
            ts.PropsAddString("reverbPan[ 1 ]", "0.0");
            ts.PropsAddString("reverbPan[ 2 ]", "0.0");
            ts.PropsAddString("echoTime", "0.25");
            ts.PropsAddString("echoDepth", "0.0");
            ts.PropsAddString("modulationTime", "0.25");
            ts.PropsAddString("modulationDepth", "0.0");
            ts.PropsAddString("airAbsorptionHF", "-5.0");
            ts.PropsAddString("HFReference", "5000.0");
            ts.PropsAddString("LFReference", "250.0");
            ts.PropsAddString("roomRolloffFactor", "0.0");
            ts.PropsAddString("diffusion", "100.0");
            ts.PropsAddString("density", "100.0");
            ts.Props.Add("flags", "0x3f");
            ts.Create();

            ts = new TorqueSingleton("SFXEnvironment", "AudioEnvConcertHall");
            ts.PropsAddString("envSize", "19.6");
            ts.PropsAddString("envDiffusion", "1.0");
            ts.PropsAddString("room", "-1000");
            ts.PropsAddString("roomHF", "-500");
            ts.PropsAddString("roomLF", "0");
            ts.PropsAddString("decayTime", "3.92");
            ts.PropsAddString("decayHFRatio", "0.7");
            ts.PropsAddString("decayLFRatio", "1.0");
            ts.PropsAddString("reflections", "-1230");
            ts.PropsAddString("reflectionsDelay", "0.02");
            ts.PropsAddString("reflectionsPan[ 0 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 1 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 2 ]", "0.0");
            ts.PropsAddString("reverb", "-2");
            ts.PropsAddString("reverbDelay", "0.029");
            ts.PropsAddString("reverbPan[ 0 ]", "0.0");
            ts.PropsAddString("reverbPan[ 1 ]", "0.0");
            ts.PropsAddString("reverbPan[ 2 ]", "0.0");
            ts.PropsAddString("echoTime", "0.25");
            ts.PropsAddString("echoDepth", "0.0");
            ts.PropsAddString("modulationTime", "0.25");
            ts.PropsAddString("modulationDepth", "0.0");
            ts.PropsAddString("airAbsorptionHF", "-5.0");
            ts.PropsAddString("HFReference", "5000.0");
            ts.PropsAddString("LFReference", "250.0");
            ts.PropsAddString("roomRolloffFactor", "0.0");
            ts.PropsAddString("diffusion", "100.0");
            ts.PropsAddString("density", "100.0");
            ts.Props.Add("flags", "0x3f");
            ts.Create();

            ts = new TorqueSingleton("SFXEnvironment", "AudioEnvCave");
            ts.PropsAddString("envSize", "14.6");
            ts.PropsAddString("envDiffusion", "1.0");
            ts.PropsAddString("room", "-1000");
            ts.PropsAddString("roomHF", "0");
            ts.PropsAddString("roomLF", "0");
            ts.PropsAddString("decayTime", "2.91");
            ts.PropsAddString("decayHFRatio", "1.3");
            ts.PropsAddString("decayLFRatio", "1.0");
            ts.PropsAddString("reflections", "-602");
            ts.PropsAddString("reflectionsDelay", "0.015");
            ts.PropsAddString("reflectionsPan[ 0 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 1 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 2 ]", "0.0");
            ts.PropsAddString("reverb", "-302");
            ts.PropsAddString("reverbDelay", "0.022");
            ts.PropsAddString("reverbPan[ 0 ]", "0.0");
            ts.PropsAddString("reverbPan[ 1 ]", "0.0");
            ts.PropsAddString("reverbPan[ 2 ]", "0.0");
            ts.PropsAddString("echoTime", "0.25");
            ts.PropsAddString("echoDepth", "0.0");
            ts.PropsAddString("modulationTime", "0.25");
            ts.PropsAddString("modulationDepth", "0.0");
            ts.PropsAddString("airAbsorptionHF", "-5.0");
            ts.PropsAddString("HFReference", "5000.0");
            ts.PropsAddString("LFReference", "250.0");
            ts.PropsAddString("roomRolloffFactor", "0.0");
            ts.PropsAddString("diffusion", "100.0");
            ts.PropsAddString("density", "100.0");
            ts.Props.Add("flags", "0x1f");
            ts.Create();

            ts = new TorqueSingleton("SFXEnvironment", "AudioEnvArena");
            ts.PropsAddString("envSize", "36.2f");
            ts.PropsAddString("envDiffusion", "1.0");
            ts.PropsAddString("room", "-1000");
            ts.PropsAddString("roomHF", "-698");
            ts.PropsAddString("roomLF", "0");
            ts.PropsAddString("decayTime", "7.24");
            ts.PropsAddString("decayHFRatio", "0.33");
            ts.PropsAddString("decayLFRatio", "1.0");
            ts.PropsAddString("reflections", "-1166");
            ts.PropsAddString("reflectionsDelay", "0.02");
            ts.PropsAddString("reflectionsPan[ 0 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 1 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 2 ]", "0.0");
            ts.PropsAddString("reverb", "16");
            ts.PropsAddString("reverbDelay", "0.03");
            ts.PropsAddString("reverbPan[ 0 ]", "0.0");
            ts.PropsAddString("reverbPan[ 1 ]", "0.0");
            ts.PropsAddString("reverbPan[ 2 ]", "0.0");
            ts.PropsAddString("echoTime", "0.25");
            ts.PropsAddString("echoDepth", "0.0");
            ts.PropsAddString("modulationTime", "0.25");
            ts.PropsAddString("modulationDepth", "0.0");
            ts.PropsAddString("airAbsorptionHF", "-5.0");
            ts.PropsAddString("HFReference", "5000.0");
            ts.PropsAddString("LFReference", "250.0");
            ts.PropsAddString("roomRolloffFactor", "0.0");
            ts.PropsAddString("diffusion", "100.0");
            ts.PropsAddString("density", "100.0");
            ts.Props.Add("flags", "0x3f");
            ts.Create();


            ts = new TorqueSingleton("SFXEnvironment", "AudioEnvHangar");
            ts.PropsAddString("envSize", "50.3");
            ts.PropsAddString("envDiffusion", "1.0");
            ts.PropsAddString("room", "-1000");
            ts.PropsAddString("roomHF", "-1000");
            ts.PropsAddString("roomLF", "0");
            ts.PropsAddString("decayTime", "10.05");
            ts.PropsAddString("decayHFRatio", "0.23");
            ts.PropsAddString("decayLFRatio", "1.0");
            ts.PropsAddString("reflections", "-602");
            ts.PropsAddString("reflectionsDelay", "0.02");
            ts.PropsAddString("reflectionsPan[ 0 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 1 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 2 ]", "0.0");
            ts.PropsAddString("reverb", "198");
            ts.PropsAddString("reverbDelay", "0.03");
            ts.PropsAddString("reverbPan[ 0 ]", "0.0");
            ts.PropsAddString("reverbPan[ 1 ]", "0.0");
            ts.PropsAddString("reverbPan[ 2 ]", "0.0");
            ts.PropsAddString("echoTime", "0.25");
            ts.PropsAddString("echoDepth", "0.0");
            ts.PropsAddString("modulationTime", "0.25");
            ts.PropsAddString("modulationDepth", "0.0");
            ts.PropsAddString("airAbsorptionHF", "-5.0");
            ts.PropsAddString("HFReference", "5000.0");
            ts.PropsAddString("LFReference", "250.0");
            ts.PropsAddString("roomRolloffFactor", "0.0");
            ts.PropsAddString("diffusion", "100.0");
            ts.PropsAddString("density", "100.0");
            ts.Props.Add("flags", "0x3f");
            ts.Create();

            ts = new TorqueSingleton("SFXEnvironment", "AudioEnvCarpettedHallway");
            ts.PropsAddString("envSize", "1.9");
            ts.PropsAddString("envDiffusion", "1.0");
            ts.PropsAddString("room", "-1000");
            ts.PropsAddString("roomHF", "-4000");
            ts.PropsAddString("roomLF", "0");
            ts.PropsAddString("decayTime", "0.3");
            ts.PropsAddString("decayHFRatio", "0.1");
            ts.PropsAddString("decayLFRatio", "1.0");
            ts.PropsAddString("reflections", "-1831");
            ts.PropsAddString("reflectionsDelay", "0.002");
            ts.PropsAddString("reflectionsPan[ 0 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 1 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 2 ]", "0.0");
            ts.PropsAddString("reverb", "-1630");
            ts.PropsAddString("reverbDelay", "0.03");
            ts.PropsAddString("reverbPan[ 0 ]", "0.0");
            ts.PropsAddString("reverbPan[ 1 ]", "0.0");
            ts.PropsAddString("reverbPan[ 2 ]", "0.0");
            ts.PropsAddString("echoTime", "0.25");
            ts.PropsAddString("echoDepth", "0.0");
            ts.PropsAddString("modulationTime", "0.25");
            ts.PropsAddString("modulationDepth", "0.0");
            ts.PropsAddString("airAbsorptionHF", "-5.0");
            ts.PropsAddString("HFReference", "5000.0");
            ts.PropsAddString("LFReference", "250.0");
            ts.PropsAddString("roomRolloffFactor", "0.0");
            ts.PropsAddString("diffusion", "100.0");
            ts.PropsAddString("density", "100.0");
            ts.Props.Add("flags", "0x3f");
            ts.Create();


            ts = new TorqueSingleton("SFXEnvironment", "AudioEnvHallway");
            ts.PropsAddString("envSize", "1.8");
            ts.PropsAddString("envDiffusion", "1.0");
            ts.PropsAddString("room", "-1000");
            ts.PropsAddString("roomHF", "-300");
            ts.PropsAddString("roomLF", "0");
            ts.PropsAddString("decayTime", "1.49");
            ts.PropsAddString("decayHFRatio", "0.59");
            ts.PropsAddString("decayLFRatio", "1.0");
            ts.PropsAddString("reflections", "-1219");
            ts.PropsAddString("reflectionsDelay", "0.007");
            ts.PropsAddString("reflectionsPan[ 0 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 1 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 2 ]", "0.0");
            ts.PropsAddString("reverb", "441");
            ts.PropsAddString("reverbDelay", "0.011");
            ts.PropsAddString("reverbPan[ 0 ]", "0.0");
            ts.PropsAddString("reverbPan[ 1 ]", "0.0");
            ts.PropsAddString("reverbPan[ 2 ]", "0.0");
            ts.PropsAddString("echoTime", "0.25");
            ts.PropsAddString("echoDepth", "0.0");
            ts.PropsAddString("modulationTime", "0.25");
            ts.PropsAddString("modulationDepth", "0.0");
            ts.PropsAddString("airAbsorptionHF", "-5.0");
            ts.PropsAddString("HFReference", "5000.0");
            ts.PropsAddString("LFReference", "250.0");
            ts.PropsAddString("roomRolloffFactor", "0.0");
            ts.PropsAddString("diffusion", "100.0");
            ts.PropsAddString("density", "100.0");
            ts.Props.Add("flags", "0x3f");
            ts.Create();

            ts = new TorqueSingleton("SFXEnvironment", "AudioEnvStoneCorridor");
            ts.PropsAddString("envSize", "13.5");
            ts.PropsAddString("envDiffusion", "1.0");
            ts.PropsAddString("room", "-1000");
            ts.PropsAddString("roomHF", "-237");
            ts.PropsAddString("roomLF", "0");
            ts.PropsAddString("decayTime", "2.7");
            ts.PropsAddString("decayHFRatio", "0.79");
            ts.PropsAddString("decayLFRatio", "1.0");
            ts.PropsAddString("reflections", "-1214");
            ts.PropsAddString("reflectionsDelay", "0.013");
            ts.PropsAddString("reflectionsPan[ 0 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 1 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 2 ]", "0.0");
            ts.PropsAddString("reverb", "395");
            ts.PropsAddString("reverbDelay", "0.02");
            ts.PropsAddString("reverbPan[ 0 ]", "0.0");
            ts.PropsAddString("reverbPan[ 1 ]", "0.0");
            ts.PropsAddString("reverbPan[ 2 ]", "0.0");
            ts.PropsAddString("echoTime", "0.25");
            ts.PropsAddString("echoDepth", "0.0");
            ts.PropsAddString("modulationTime", "0.25");
            ts.PropsAddString("modulationDepth", "0.0");
            ts.PropsAddString("airAbsorptionHF", "-5.0");
            ts.PropsAddString("HFReference", "5000.0");
            ts.PropsAddString("LFReference", "250.0");
            ts.PropsAddString("roomRolloffFactor", "0.0");
            ts.PropsAddString("diffusion", "100.0");
            ts.PropsAddString("density", "100.0");
            ts.Props.Add("flags", "0x3f");
            ts.Create();


            ts = new TorqueSingleton("SFXEnvironment", "AudioEnvAlley");
            ts.PropsAddString("envSize", "7.5");
            ts.PropsAddString("envDiffusion", "0.3");
            ts.PropsAddString("room", "-1000");
            ts.PropsAddString("roomHF", "-270");
            ts.PropsAddString("roomLF", "0");
            ts.PropsAddString("decayTime", "1.49");
            ts.PropsAddString("decayHFRatio", "0.86");
            ts.PropsAddString("decayLFRatio", "1.0");
            ts.PropsAddString("reflections", "-1204");
            ts.PropsAddString("reflectionsDelay", "0.007");
            ts.PropsAddString("reflectionsPan[ 0 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 1 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 2 ]", "0.0");
            ts.PropsAddString("reverb", "-4");
            ts.PropsAddString("reverbDelay", "0.011");
            ts.PropsAddString("reverbPan[ 0 ]", "0.0");
            ts.PropsAddString("reverbPan[ 1 ]", "0.0");
            ts.PropsAddString("reverbPan[ 2 ]", "0.0");
            ts.PropsAddString("echoTime", "0.125");
            ts.PropsAddString("echoDepth", "0.95");
            ts.PropsAddString("modulationTime", "0.25");
            ts.PropsAddString("modulationDepth", "0.0");
            ts.PropsAddString("airAbsorptionHF", "-5.0");
            ts.PropsAddString("HFReference", "5000.0");
            ts.PropsAddString("LFReference", "250.0");
            ts.PropsAddString("roomRolloffFactor", "0.0");
            ts.PropsAddString("diffusion", "100.0");
            ts.PropsAddString("density", "100.0");
            ts.Props.Add("flags", "0x3f");
            ts.Create();

            ts = new TorqueSingleton("SFXEnvironment", "AudioEnvForest");
            ts.PropsAddString("envSize", "38.0");
            ts.PropsAddString("envDiffusion", "0.3");
            ts.PropsAddString("room", "-1000");
            ts.PropsAddString("roomHF", "-3300");
            ts.PropsAddString("roomLF", "0");
            ts.PropsAddString("decayTime", "1.49");
            ts.PropsAddString("decayHFRatio", "0.54");
            ts.PropsAddString("decayLFRatio", "1.0");
            ts.PropsAddString("reflections", "-2560");
            ts.PropsAddString("reflectionsDelay", "0.162");
            ts.PropsAddString("reflectionsPan[ 0 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 1 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 2 ]", "0.0");
            ts.PropsAddString("reverb", "-229");
            ts.PropsAddString("reverbDelay", "0.088");
            ts.PropsAddString("reverbPan[ 0 ]", "0.0");
            ts.PropsAddString("reverbPan[ 1 ]", "0.0");
            ts.PropsAddString("reverbPan[ 2 ]", "0.0");
            ts.PropsAddString("echoTime", "0.125");
            ts.PropsAddString("echoDepth", "1.0");
            ts.PropsAddString("modulationTime", "0.25");
            ts.PropsAddString("modulationDepth", "0.0");
            ts.PropsAddString("airAbsorptionHF", "-5.0");
            ts.PropsAddString("HFReference", "5000.0");
            ts.PropsAddString("LFReference", "250.0");
            ts.PropsAddString("roomRolloffFactor", "0.0");
            ts.PropsAddString("diffusion", "79.0");
            ts.PropsAddString("density", "100.0");
            ts.Props.Add("flags", "0x3f");
            ts.Create();

            ts = new TorqueSingleton("SFXEnvironment", "AudioEnvCity");
            ts.PropsAddString("envSize", "7.5");
            ts.PropsAddString("envDiffusion", "0.5");
            ts.PropsAddString("room", "-1000");
            ts.PropsAddString("roomHF", "-800");
            ts.PropsAddString("roomLF", "0");
            ts.PropsAddString("decayTime", "1.49");
            ts.PropsAddString("decayHFRatio", "0.67");
            ts.PropsAddString("decayLFRatio", "1.0");
            ts.PropsAddString("reflections", "-2273");
            ts.PropsAddString("reflectionsDelay", "0.007");
            ts.PropsAddString("reflectionsPan[ 0 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 1 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 2 ]", "0.0");
            ts.PropsAddString("reverb", "-1691");
            ts.PropsAddString("reverbDelay", "0.011");
            ts.PropsAddString("reverbPan[ 0 ]", "0.0");
            ts.PropsAddString("reverbPan[ 1 ]", "0.0");
            ts.PropsAddString("reverbPan[ 2 ]", "0.0");
            ts.PropsAddString("echoTime", "0.25");
            ts.PropsAddString("echoDepth", "0.0");
            ts.PropsAddString("modulationTime", "0.25");
            ts.PropsAddString("modulationDepth", "0.0");
            ts.PropsAddString("airAbsorptionHF", "-5.0");
            ts.PropsAddString("HFReference", "5000.0");
            ts.PropsAddString("LFReference", "250.0");
            ts.PropsAddString("roomRolloffFactor", "0.0");
            ts.PropsAddString("diffusion", "50.0");
            ts.PropsAddString("density", "100.0");
            ts.Props.Add("flags", "0x3f");
            ts.Create();

            ts = new TorqueSingleton("SFXEnvironment", "AudioEnvMountains");
            ts.PropsAddString("envSize", "100.0");
            ts.PropsAddString("envDiffusion", "0.27");
            ts.PropsAddString("room", "-1000");
            ts.PropsAddString("roomHF", "-2500");
            ts.PropsAddString("roomLF", "0");
            ts.PropsAddString("decayTime", "1.49");
            ts.PropsAddString("decayHFRatio", "0.21");
            ts.PropsAddString("decayLFRatio", "1.0");
            ts.PropsAddString("reflections", "-2780");
            ts.PropsAddString("reflectionsDelay", "0.3");
            ts.PropsAddString("reflectionsPan[ 0 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 1 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 2 ]", "0.0");
            ts.PropsAddString("reverb", "-1434");
            ts.PropsAddString("reverbDelay", "0.1");
            ts.PropsAddString("reverbPan[ 0 ]", "0.0");
            ts.PropsAddString("reverbPan[ 1 ]", "0.0");
            ts.PropsAddString("reverbPan[ 2 ]", "0.0");
            ts.PropsAddString("echoTime", "0.25");
            ts.PropsAddString("echoDepth", "1.0");
            ts.PropsAddString("modulationTime", "0.25");
            ts.PropsAddString("modulationDepth", "0.0");
            ts.PropsAddString("airAbsorptionHF", "-5.0");
            ts.PropsAddString("HFReference", "5000.0");
            ts.PropsAddString("LFReference", "250.0");
            ts.PropsAddString("roomRolloffFactor", "0.0");
            ts.PropsAddString("diffusion", "27.0");
            ts.PropsAddString("density", "100.0");
            ts.Props.Add("flags", "0x1f");
            ts.Create();

            ts = new TorqueSingleton("SFXEnvironment", "AudioEnvQuary");
            ts.PropsAddString("envSize", "17.5");
            ts.PropsAddString("envDiffusion", "1.0");
            ts.PropsAddString("room", "-1000");
            ts.PropsAddString("roomHF", "-1000");
            ts.PropsAddString("roomLF", "0");
            ts.PropsAddString("decayTime", "1.49");
            ts.PropsAddString("decayHFRatio", "0.83");
            ts.PropsAddString("decayLFRatio", "1.0");
            ts.PropsAddString("reflections", "-10000");
            ts.PropsAddString("reflectionsDelay", "0.061");
            ts.PropsAddString("reflectionsPan[ 0 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 1 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 2 ]", "0.0");
            ts.PropsAddString("reverb", "500");
            ts.PropsAddString("reverbDelay", "0.025");
            ts.PropsAddString("reverbPan[ 0 ]", "0.0");
            ts.PropsAddString("reverbPan[ 1 ]", "0.0");
            ts.PropsAddString("reverbPan[ 2 ]", "0.0");
            ts.PropsAddString("echoTime", "0.125");
            ts.PropsAddString("echoDepth", "0.7");
            ts.PropsAddString("modulationTime", "0.25");
            ts.PropsAddString("modulationDepth", "0.0");
            ts.PropsAddString("airAbsorptionHF", "-5.0");
            ts.PropsAddString("HFReference", "5000.0");
            ts.PropsAddString("LFReference", "250.0");
            ts.PropsAddString("roomRolloffFactor", "0.0");
            ts.PropsAddString("diffusion", "100.0");
            ts.PropsAddString("density", "100.0");
            ts.Props.Add("flags", "0x3f");
            ts.Create();


            ts = new TorqueSingleton("SFXEnvironment", "AudioEnvPlain");
            ts.PropsAddString("envSize", "42.5");
            ts.PropsAddString("envDiffusion", "0.21");
            ts.PropsAddString("room", "-1000");
            ts.PropsAddString("roomHF", "-2000");
            ts.PropsAddString("roomLF", "0");
            ts.PropsAddString("decayTime", "1.49");
            ts.PropsAddString("decayHFRatio", "0.5");
            ts.PropsAddString("decayLFRatio", "1.0");
            ts.PropsAddString("reflections", "-2466");
            ts.PropsAddString("reflectionsDelay", "0.179");
            ts.PropsAddString("reflectionsPan[ 0 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 1 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 2 ]", "0.0");
            ts.PropsAddString("reverb", "-1926");
            ts.PropsAddString("reverbDelay", "0.1");
            ts.PropsAddString("reverbPan[ 0 ]", "0.0");
            ts.PropsAddString("reverbPan[ 1 ]", "0.0");
            ts.PropsAddString("reverbPan[ 2 ]", "0.0");
            ts.PropsAddString("echoTime", "0.25");
            ts.PropsAddString("echoDepth", "1.0");
            ts.PropsAddString("modulationTime", "0.25");
            ts.PropsAddString("modulationDepth", "0.0");
            ts.PropsAddString("airAbsorptionHF", "-5.0");
            ts.PropsAddString("HFReference", "5000.0");
            ts.PropsAddString("LFReference", "250.0");
            ts.PropsAddString("roomRolloffFactor", "0.0");
            ts.PropsAddString("diffusion", "21.0");
            ts.PropsAddString("density", "100.0");
            ts.Props.Add("flags", "0x3f");
            ts.Create();

            ts = new TorqueSingleton("SFXEnvironment", "AudioEnvParkingLot");
            ts.PropsAddString("envSize", "8.3");
            ts.PropsAddString("envDiffusion", "1.0");
            ts.PropsAddString("room", "-1000");
            ts.PropsAddString("roomHF", "0");
            ts.PropsAddString("roomLF", "0");
            ts.PropsAddString("decayTime", "1.65");
            ts.PropsAddString("decayHFRatio", "1.5");
            ts.PropsAddString("decayLFRatio", "1.0");
            ts.PropsAddString("reflections", "-1363");
            ts.PropsAddString("reflectionsDelay", "0.008");
            ts.PropsAddString("reflectionsPan[ 0 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 1 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 2 ]", "0.0");
            ts.PropsAddString("reverb", "-1153");
            ts.PropsAddString("reverbDelay", "0.012");
            ts.PropsAddString("reverbPan[ 0 ]", "0.0");
            ts.PropsAddString("reverbPan[ 1 ]", "0.0");
            ts.PropsAddString("reverbPan[ 2 ]", "0.0");
            ts.PropsAddString("echoTime", "0.25");
            ts.PropsAddString("echoDepth", "0.0");
            ts.PropsAddString("modulationTime", "0.25");
            ts.PropsAddString("modulationDepth", "0.0");
            ts.PropsAddString("airAbsorptionHF", "-5.0");
            ts.PropsAddString("HFReference", "5000.0");
            ts.PropsAddString("LFReference", "250.0");
            ts.PropsAddString("roomRolloffFactor", "0.0");
            ts.PropsAddString("diffusion", "100.0");
            ts.PropsAddString("density", "100.0");
            ts.Props.Add("flags", "0x1f");
            ts.Create();


            ts = new TorqueSingleton("SFXEnvironment", "AudioEnvSewerPipe");
            ts.PropsAddString("envSize", "1.7");
            ts.PropsAddString("envDiffusion", "0.8");
            ts.PropsAddString("room", "-1000");
            ts.PropsAddString("roomHF", "-1000");
            ts.PropsAddString("roomLF", "0");
            ts.PropsAddString("decayTime", "2.81");
            ts.PropsAddString("decayHFRatio", "0.14");
            ts.PropsAddString("decayLFRatio", "1.0");
            ts.PropsAddString("reflections", "429");
            ts.PropsAddString("reflectionsDelay", "0.014");
            ts.PropsAddString("reflectionsPan[ 0 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 1 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 2 ]", "0.0");
            ts.PropsAddString("reverb", "1023");
            ts.PropsAddString("reverbDelay", "0.21");
            ts.PropsAddString("reverbPan[ 0 ]", "0.0");
            ts.PropsAddString("reverbPan[ 1 ]", "0.0");
            ts.PropsAddString("reverbPan[ 2 ]", "0.0");
            ts.PropsAddString("echoTime", "0.25");
            ts.PropsAddString("echoDepth", "0.0");
            ts.PropsAddString("modulationTime", "0.25");
            ts.PropsAddString("modulationDepth", "0.0");
            ts.PropsAddString("airAbsorptionHF", "-5.0");
            ts.PropsAddString("HFReference", "5000.0");
            ts.PropsAddString("LFReference", "250.0");
            ts.PropsAddString("roomRolloffFactor", "0.0");
            ts.PropsAddString("diffusion", "80.0");
            ts.PropsAddString("density", "60.0");
            ts.Props.Add("flags", "0x3f");
            ts.Create();

            ts = new TorqueSingleton("SFXEnvironment", "AudioEnvUnderwater");
            ts.PropsAddString("envSize", "1.8");
            ts.PropsAddString("envDiffusion", "1.0");
            ts.PropsAddString("room", "-1000");
            ts.PropsAddString("roomHF", "-4000");
            ts.PropsAddString("roomLF", "0");
            ts.PropsAddString("decayTime", "1.49");
            ts.PropsAddString("decayHFRatio", "0.1");
            ts.PropsAddString("decayLFRatio", "1.0");
            ts.PropsAddString("reflections", "-449");
            ts.PropsAddString("reflectionsDelay", "0.007");
            ts.PropsAddString("reflectionsPan[ 0 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 1 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 2 ]", "0.0");
            ts.PropsAddString("reverb", "1700");
            ts.PropsAddString("reverbDelay", "0.011");
            ts.PropsAddString("reverbPan[ 0 ]", "0.0");
            ts.PropsAddString("reverbPan[ 1 ]", "0.0");
            ts.PropsAddString("reverbPan[ 2 ]", "0.0");
            ts.PropsAddString("echoTime", "0.25");
            ts.PropsAddString("echoDepth", "0.0");
            ts.PropsAddString("modulationTime", "1.18");
            ts.PropsAddString("modulationDepth", "0.348");
            ts.PropsAddString("airAbsorptionHF", "-5.0");
            ts.PropsAddString("HFReference", "5000.0");
            ts.PropsAddString("LFReference", "250.0");
            ts.PropsAddString("roomRolloffFactor", "0.0");
            ts.PropsAddString("diffusion", "100.0");
            ts.PropsAddString("density", "100.0");
            ts.Props.Add("flags", "0x3f");
            ts.Create();


            ts = new TorqueSingleton("SFXEnvironment", "AudioEnvDrugged");
            ts.PropsAddString("envSize", "1.9");
            ts.PropsAddString("envDiffusion", "0.5");
            ts.PropsAddString("room", "-1000");
            ts.PropsAddString("roomHF", "0");
            ts.PropsAddString("roomLF", "0");
            ts.PropsAddString("decayTime", "8.39");
            ts.PropsAddString("decayHFRatio", "1.39");
            ts.PropsAddString("decayLFRatio", "1.0");
            ts.PropsAddString("reflections", "-115");
            ts.PropsAddString("reflectionsDelay", "0.002");
            ts.PropsAddString("reflectionsPan[ 0 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 1 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 2 ]", "0.0");
            ts.PropsAddString("reverb", "985");
            ts.PropsAddString("reverbDelay", "0.03");
            ts.PropsAddString("reverbPan[ 0 ]", "0.0");
            ts.PropsAddString("reverbPan[ 1 ]", "0.0");
            ts.PropsAddString("reverbPan[ 2 ]", "0.0");
            ts.PropsAddString("echoTime", "0.25");
            ts.PropsAddString("echoDepth", "0.0");
            ts.PropsAddString("modulationTime", "0.25");
            ts.PropsAddString("modulationDepth", "1.0");
            ts.PropsAddString("airAbsorptionHF", "-5.0");
            ts.PropsAddString("HFReference", "5000.0");
            ts.PropsAddString("LFReference", "250.0");
            ts.PropsAddString("roomRolloffFactor", "0.0");
            ts.PropsAddString("diffusion", "100.0");
            ts.PropsAddString("density", "100.0");
            ts.Props.Add("flags", "0x1f");
            ts.Create();


            ts = new TorqueSingleton("SFXEnvironment", "AudioEnvDizzy");
            ts.PropsAddString("envSize", "1.8");
            ts.PropsAddString("envDiffusion", "0.6");
            ts.PropsAddString("room", "-1000.0");
            ts.PropsAddString("roomHF", "-400");
            ts.PropsAddString("roomLF", "0");
            ts.PropsAddString("decayTime", "17.23");
            ts.PropsAddString("decayHFRatio", "0.56");
            ts.PropsAddString("decayLFRatio", "1.0");
            ts.PropsAddString("reflections", "-1713");
            ts.PropsAddString("reflectionsDelay", "0.02");
            ts.PropsAddString("reflectionsPan[ 0 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 1 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 2 ]", "0.0");
            ts.PropsAddString("reverb", "-613");
            ts.PropsAddString("reverbDelay", "0.03");
            ts.PropsAddString("reverbPan[ 0 ]", "0.0");
            ts.PropsAddString("reverbPan[ 1 ]", "0.0");
            ts.PropsAddString("reverbPan[ 2 ]", "0.0");
            ts.PropsAddString("echoTime", "0.25");
            ts.PropsAddString("echoDepth", "1.0");
            ts.PropsAddString("modulationTime", "0.81");
            ts.PropsAddString("modulationDepth", "0.31");
            ts.PropsAddString("airAbsorptionHF", "-5.0");
            ts.PropsAddString("HFReference", "5000.0");
            ts.PropsAddString("LFReference", "250.0");
            ts.PropsAddString("roomRolloffFactor", "0.0");
            ts.PropsAddString("diffusion", "100.0");
            ts.PropsAddString("density", "100.0");
            ts.Props.Add("flags", "0x1f");
            ts.Create();

            ts = new TorqueSingleton("SFXEnvironment", "AudioEnvPsychotic");
            ts.PropsAddString("envSize", "1.0");
            ts.PropsAddString("envDiffusion", "0.5");
            ts.PropsAddString("room", "-1000");
            ts.PropsAddString("roomHF", "-151");
            ts.PropsAddString("roomLF", "0");
            ts.PropsAddString("decayTime", "7.56");
            ts.PropsAddString("decayHFRatio", "0.91");
            ts.PropsAddString("decayLFRatio", "1.0");
            ts.PropsAddString("reflections", "-626");
            ts.PropsAddString("reflectionsDelay", "0.02");
            ts.PropsAddString("reflectionsPan[ 0 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 1 ]", "0.0");
            ts.PropsAddString("reflectionsPan[ 2 ]", "0.0");
            ts.PropsAddString("reverb", "774");
            ts.PropsAddString("reverbDelay", "0.03");
            ts.PropsAddString("reverbPan[ 0 ]", "0.0");
            ts.PropsAddString("reverbPan[ 1 ]", "0.0");
            ts.PropsAddString("reverbPan[ 2 ]", "0.0");
            ts.PropsAddString("echoTime", "0.25");
            ts.PropsAddString("echoDepth", "0.0");
            ts.PropsAddString("modulationTime", "4.0");
            ts.PropsAddString("modulationDepth", "1.0");
            ts.PropsAddString("airAbsorptionHF", "-5.0");
            ts.PropsAddString("HFReference", "5000.0");
            ts.PropsAddString("LFReference", "250.0");
            ts.PropsAddString("roomRolloffFactor", "0.0");
            ts.PropsAddString("diffusion", "100.0");
            ts.PropsAddString("density", "100.0");
            ts.Props.Add("flags", "0x1f");
            ts.Create();
            }
Exemple #23
0
        public void fog_Init()
            {
            TorqueSingleton ts = new TorqueSingleton("ShaderData", "FogPassShader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/postFxV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/fogP.hlsl");
            //   OGLVertexShaderFile  = "shaders/common/postFx/gl//postFxV.glsl";
            //   OGLPixelShaderFile   = "shaders/common/postFx/gl/fogP.glsl";
            ts.PropsAddString("samplerNames[0]", "$prepassTex");
            ts.Props.Add("pixVersion", "2.0");
            ts.Create(m_ts);

            ts = new TorqueSingleton("GFXStateBlockData", "FogPassStateBlock : PFX_DefaultStateBlock");
            ts.Props.Add("blendDefined", "true");
            ts.Props.Add("blendEnable", "true");
            ts.Props.Add("blendSrc", "GFXBlendSrcAlpha");
            ts.Props.Add("blendDest", "GFXBlendInvSrcAlpha");
            ts.Create(m_ts);

            ts = new TorqueSingleton("PostEffect", "FogPostFx");
            // We forward render the reflection pass
            // so it does its own fogging.
            ts.Props.Add("allowReflectPass", "false");
            ts.PropsAddString("renderTime", "PFXBeforeBin");
            ts.PropsAddString("renderBin", "ObjTranslucentBin");
            ts.Props.Add("shader", "FogPassShader");
            ts.Props.Add("stateBlock", "FogPassStateBlock");
            ts.PropsAddString("texture[0]", "#prepass");
            ts.Props.Add("renderPriority", "5");
            ts.Props.Add("isEnabled", "true");
            ts.Create(m_ts);

            ts = new TorqueSingleton("ShaderData", "UnderwaterFogPassShader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/postFxV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/underwaterFogP.hlsl");
            //   OGLVertexShaderFile  = "shaders/common/postFx/gl/postFxV.glsl";
            //   OGLPixelShaderFile   = "shaders/common/postFx/gl/fogP.glsl";
            ts.PropsAddString("samplerNames[0]", "$prepassTex");
            ts.Props.Add("pixVersion", "2.0");
            ts.Create(m_ts);

            ts = new TorqueSingleton("GFXStateBlockData", "UnderwaterFogPassStateBlock : PFX_DefaultStateBlock");
            ts.Props.Add("samplersDefined", "true");
            ts.Props.Add("samplerStates[0]", "SamplerClampPoint");
            ts.Props.Add("samplerStates[1]", "SamplerClampPoint");
            ts.Props.Add("samplerStates[2]", "SamplerClampLinear");
            ts.Create(m_ts);

            ts = new TorqueSingleton("PostEffect", "UnderwaterFogPostFx");
            ts.Props.Add("oneFrameOnly", "true");
            ts.Props.Add("onThisFrame", "false");

            // Let the fog effect render during the 
            // reflection pass.
            ts.Props.Add("allowReflectPass", "true");

            ts.PropsAddString("renderTime", "PFXBeforeBin");
            ts.PropsAddString("renderBin", "ObjTranslucentBin");

            ts.Props.Add("shader", "UnderwaterFogPassShader");
            ts.Props.Add("stateBlock", "UnderwaterFogPassStateBlock");
            ts.PropsAddString("texture[0]", "#prepass");
            ts.PropsAddString("texture[1]", "$backBuffer");
            ts.PropsAddString("texture[2]", "#waterDepthGradMap");

            // Needs to happen after the FogPostFx
            ts.Props.Add("renderPriority", "4");

            ts.Props.Add("isEnabled", "true");
            ts.Create(m_ts);
            }
        public void edgeAA_Init()
            {
            TorqueSingleton ts = new TorqueSingleton("GFXStateBlockData", "PFX_DefaultEdgeAAStateBlock");

            ts.Props.Add("zDefined", "true");
            ts.Props.Add("zEnable", "false");
            ts.Props.Add("zWriteEnable", "false");
            ts.Props.Add("samplersDefined", "true");
            ts.Props.Add("samplerStates[0]", "SamplerClampPoint");
            ts.Create();


            ts = new TorqueSingleton("ShaderData", "PFX_EdgeAADetectShader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/postFxV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/edgeaa/edgeDetectP.hlsl");
            //OGLVertexShaderFile  = "shaders/common/postFx/gl//postFxV.glsl";
            //OGLPixelShaderFile   = "shaders/common/postFx/gl/passthruP.glsl";
            ts.PropsAddString("samplerNames[0]", "$inputTex");
            ts.Props.Add("pixVersion", "3.0");
            ts.Create();

            ts = new TorqueSingleton("ShaderData", "PFX_EdgeAAShader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/edgeaa/edgeAAV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/edgeaa/edgeAAP.hlsl");
            //OGLVertexShaderFile  = "shaders/common/postFx/gl//postFxV.glsl";
            //OGLPixelShaderFile   = "shaders/common/postFx/gl/passthruP.glsl";
            ts.PropsAddString("samplerNames[0]", "$inputTex");
            ts.Props.Add("pixVersion", "3.0");
            ts.Create();

            ts = new TorqueSingleton("ShaderData", "PFX_EdgeAADebugShader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/postFxV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/edgeaa/dbgEdgeDisplayP.hlsl");
            //OGLVertexShaderFile  = "shaders/common/postFx/gl//postFxV.glsl";
            //OGLPixelShaderFile   = "shaders/common/postFx/gl/passthruP.glsl";
            ts.PropsAddString("samplerNames[0]", "$inputTex");
            ts.Props.Add("pixVersion", "3.0");
            ts.Create();

            ts = new TorqueSingleton("PostEffect", "EdgeDetectPostEffect");
            ts.PropsAddString("renderTime", "PFXBeforeBin");
            ts.PropsAddString("renderBin", "ObjTranslucentBin");
            //renderPriority = 0.1;
            ts.PropsAddString("targetScale", "0.5 0.5");
            ts.Props.Add("shader", "PFX_EdgeAADetectShader");
            ts.Props.Add("stateBlock", "PFX_DefaultEdgeAAStateBlock");
            ts.PropsAddString("texture[0]", "#prepass");
            ts.PropsAddString("target", "#edge");
            ts.Props.Add("isEnabled", "false");
            ts.Create();

            ts = new TorqueSingleton("PostEffect", "EdgeAAPostEffect");
            ts.PropsAddString("renderTime", "PFXAfterDiffuse");
            //renderBin = "ObjTranslucentBin";      
            //renderPriority = 0.1;

            ts.Props.Add("shader", "PFX_EdgeAAShader");
            ts.Props.Add("stateBlock", "PFX_DefaultEdgeAAStateBlock");
            ts.PropsAddString("texture[0]", "#edge");
            ts.PropsAddString("texture[1]", "$backBuffer");
            ts.PropsAddString("target", "$backBuffer");
            ts.Create();

            ts = new TorqueSingleton("PostEffect", "Debug_EdgeAAPostEffect");
            ts.PropsAddString("renderTime", "PFXAfterDiffuse");
            //renderBin = "ObjTranslucentBin";      
            //renderPriority = 0.1;

            ts.Props.Add("shader", "PFX_EdgeAADebugShader");
            ts.Props.Add("stateBlock", "PFX_DefaultEdgeAAStateBlock");
            ts.PropsAddString("texture[0]", "#edge");
            ts.PropsAddString("target", "$backBuffer");
            ts.Create();
            }
        public void MLAA_Init()
            {
            TorqueSingleton ts = new TorqueSingleton("GFXStateBlockData", "MLAA_EdgeDetectStateBlock : PFX_DefaultStateBlock");
            // Mark the edge pixels in stencil.
            ts.Props.Add("stencilDefined", "true");
            ts.Props.Add("stencilEnable", "true");
            ts.Props.Add("stencilPassOp", "GFXStencilOpReplace");
            ts.Props.Add("stencilFunc", "GFXCmpAlways");
            ts.Props.Add("stencilRef", "1");

            ts.Props.Add("samplersDefined", "true");
            ts.Props.Add("samplerStates[0]", "SamplerClampLinear");
            ts.Create();

            ts = new TorqueSingleton("ShaderData", "MLAA_EdgeDetectionShader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/mlaa/offsetV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/mlaa/edgeDetectionP.hlsl");
            ts.PropsAddString("samplerNames[0]", "$colorMapG");
            ts.Props.Add("pixVersion", "3.0");
            ts.Create();

            ts = new TorqueSingleton("GFXStateBlockData", "MLAA_BlendWeightCalculationStateBlock : PFX_DefaultStateBlock");
            // Here we want to process only marked pixels.
            ts.Props.Add("stencilDefined", "true");
            ts.Props.Add("stencilEnable", "true");
            ts.Props.Add("stencilPassOp", "GFXStencilOpKeep");
            ts.Props.Add("stencilFunc", "GFXCmpEqual");
            ts.Props.Add("stencilRef", "1");

            ts.Props.Add("samplersDefined", "true");
            ts.Props.Add("samplerStates[0]", "SamplerClampPoint");
            ts.Props.Add("samplerStates[1]", "SamplerClampLinear");
            ts.Props.Add("samplerStates[2]", "SamplerClampPoint");
            ts.Create();

            ts = new TorqueSingleton("ShaderData", "MLAA_BlendWeightCalculationShader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/mlaa/passthruV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/mlaa/blendWeightCalculationP.hlsl");
            ts.PropsAddString("samplerNames[0]", "$edgesMap");
            ts.PropsAddString("samplerNames[1]", "$edgesMapL");
            ts.PropsAddString("samplerNames[2]", "$areaMap");
            ts.Props.Add("pixVersion", "3.0");
            ts.Create();

            ts = new TorqueSingleton("GFXStateBlockData", "MLAA_NeighborhoodBlendingStateBlock : PFX_DefaultStateBlock");

            // Here we want to process only marked pixels too.
            ts.Props.Add("stencilDefined", "true");
            ts.Props.Add("stencilEnable", "true");
            ts.Props.Add("stencilPassOp", "GFXStencilOpKeep");
            ts.Props.Add("stencilFunc", "GFXCmpEqual");
            ts.Props.Add("stencilRef", "1");
            ts.Props.Add("samplersDefined", "true");
            ts.Props.Add("samplerStates[0]", "SamplerClampPoint");
            ts.Props.Add("samplerStates[1]", "SamplerClampLinear");
            ts.Props.Add("samplerStates[2]", "SamplerClampPoint");
            ts.Create();

            ts = new TorqueSingleton("ShaderData", "MLAA_NeighborhoodBlendingShader");

            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/mlaa/offsetV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/mlaa/neighborhoodBlendingP.hlsl");
            ts.PropsAddString("samplerNames[0]", "$blendMap");
            ts.PropsAddString("samplerNames[1]", "$colorMapL");
            ts.PropsAddString("samplerNames[2]", "$colorMap");
            ts.Props.Add("pixVersion", "3.0");
            ts.Create();

            console.Eval(@"

singleton PostEffect( MLAAFx )
{
   isEnabled = false;
   
   allowReflectPass = false;
   renderTime = ""PFXAfterDiffuse"";

   texture[0] = ""$backBuffer""; //colorMapG      
   texture[1] = ""#prepass""; // Used for depth detection

   target = ""$outTex"";
   targetClear = PFXTargetClear_OnDraw;
   targetClearColor = ""0 0 0 0"";

   stateBlock = MLAA_EdgeDetectStateBlock;
   shader = MLAA_EdgeDetectionShader;
   lumaCoefficients = ""0.2126 0.7152 0.0722"";

   threshold = 0.1;

   depthThreshold = 0.01;

   new PostEffect()
   {
      internalName = ""blendingWeightsCalculation"";

      target = ""$outTex"";
      targetClear = PFXTargetClear_OnDraw;

      shader = MLAA_BlendWeightCalculationShader;
      stateBlock = MLAA_BlendWeightCalculationStateBlock;

      texture[0] = ""$inTex""; // Edges mask    
      texture[1] = ""$inTex""; // Edges mask 
      texture[2] = ""$AreaMap33_dds"";
   };

   new PostEffect()
   {
      internalName = ""neighborhoodBlending"";

      shader = MLAA_NeighborhoodBlendingShader;
      stateBlock = MLAA_NeighborhoodBlendingStateBlock;

      texture[0] = ""$inTex""; // Blend weights
      texture[1] = ""$backBuffer"";      
      texture[2] = ""$backBuffer"";      
   };
};

");
            }
        public void initializeShadowFilter()
            {
            #region singleton ShaderData( BL_ShadowFilterShaderV )

            TorqueSingleton ts = new TorqueSingleton("ShaderData", "BL_ShadowFilterShaderV");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/lighting/basic/shadowFilterV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/lighting/basic/shadowFilterP.hlsl");
            ts.PropsAddString("OGLVertexShaderFile", "shaders/common/lighting/basic/gl/shadowFilterV.glsl");
            ts.PropsAddString("OGLPixelShaderFile", "shaders/common/lighting/basic/gl/shadowFilterP.glsl");
            ts.PropsAddString("samplerNames[0]", "$diffuseMap");
            ts.PropsAddString("defines", "BLUR_DIR=float2(1.0,0.0)");
            ts.Props.Add("pixVersion", "2.0");
            ts.Create(m_ts);

            #endregion

            #region singleton ShaderData( BL_ShadowFilterShaderH : BL_ShadowFilterShaderV )

            ts = new TorqueSingleton("ShaderData", "BL_ShadowFilterShaderH : BL_ShadowFilterShaderV");
            ts.PropsAddString("defines", "BLUR_DIR=float2(0.0,1.0)");
            ts.Create(m_ts);

            #endregion

            #region singleton GFXStateBlockData( BL_ShadowFilterSB : PFX_DefaultStateBlock )

            ts = new TorqueSingleton("GFXStateBlockData", " BL_ShadowFilterSB : PFX_DefaultStateBlock");
            ts.Props.Add("colorWriteDefined", "true");
            ts.Props.Add("colorWriteRed", "false");
            ts.Props.Add("colorWriteGreen", "false");
            ts.Props.Add("colorWriteBlue", "false");
            ts.Props.Add("blendDefined", "true");
            ts.Props.Add("blendEnable", "true");
            ts.Create(m_ts);

            #endregion

            // NOTE: This is ONLY used in Basic Lighting, and 
            // only directly by the ProjectedShadow.  It is not 
            // meant to be manually enabled like other PostEffects.

            #region singleton PostEffect( BL_ShadowFilterPostFx )

            console.Eval(@"singleton PostEffect( BL_ShadowFilterPostFx )
{
    // Blur vertically
   shader = BL_ShadowFilterShaderV;
   stateBlock = PFX_DefaultStateBlock;
   targetClear = ""PFXTargetClear_OnDraw"";
   targetClearColor = ""0 0 0 0"";
   texture[0] = ""$inTex"";
   target = ""$outTex"";   

   // Blur horizontal
   new PostEffect()
   {
      shader = BL_ShadowFilterShaderH;
      stateBlock = PFX_DefaultStateBlock;
      texture[0] = ""$inTex"";
      target = ""$outTex"";
   };
};
");

            #endregion
            }
        public void water_init()
            {
            TorqueSingleton ts = new TorqueSingleton("ShaderData", "WaterShader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/water/waterV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/water/waterP.hlsl");
            ts.PropsAddString("OGLVertexShaderFile", "shaders/common/water/gl/waterV.glsl");
            ts.PropsAddString("OGLPixelShaderFile", "shaders/common/water/gl/waterP.glsl");
            ts.Props.Add("pixVersion", "3.0");
            ts.Create();

            Torque_Class_Helper tch = new Torque_Class_Helper("GFXSamplerStateData", "WaterSampler");

            tch.Props.Add("textureColorOp", "GFXTOPModulate");
            tch.Props.Add("addressModeU", "GFXAddressWrap");
            tch.Props.Add("addressModeV", "GFXAddressWrap");
            tch.Props.Add("addressModeW", "GFXAddressWrap");
            tch.Props.Add("magFilter", "GFXTextureFilterLinear");
            tch.Props.Add("minFilter", "GFXTextureFilterAnisotropic");
            tch.Props.Add("mipFilter", "GFXTextureFilterLinear");
            tch.Props.Add("maxAnisotropy", "4");
            tch.Create();


            ts = new TorqueSingleton("GFXStateBlockData", "WaterStateBlock");
            ts.Props.Add("samplersDefined", "true");
            ts.Props.Add("samplerStates[0]", "WaterSampler"); // noise
            ts.Props.Add("samplerStates[1]", "SamplerClampPoint"); // #prepass
            ts.Props.Add("samplerStates[2]", "SamplerClampLinear"); // $reflectbuff
            ts.Props.Add("samplerStates[3]", "SamplerClampPoint"); // $backbuff
            ts.Props.Add("samplerStates[4]", "SamplerWrapLinear"); // $cubemap   
            ts.Props.Add("samplerStates[5]", "SamplerWrapLinear"); // foam     
            ts.Props.Add("samplerStates[6]", "SamplerClampLinear"); // depthMap ( color gradient ) 
            ts.Props.Add("cullDefined", "true");
            ts.PropsAddString("cullMode", "GFXCullCCW");
            ts.Create();

            ts = new TorqueSingleton("GFXStateBlockData", "UnderWaterStateBlock : WaterStateBlock");
            ts.PropsAddString("cullMode", "GFXCullCW");
            ts.Create();

            ts = new TorqueSingleton("CustomMaterial", "WaterMat");
            ts.PropsAddString(@"sampler[""prepassTex""]", "#prepass");
            ts.PropsAddString(@"sampler[""reflectMap""]", "$reflectbuff");
            ts.PropsAddString(@"sampler[""refractBuff""]", "$backbuff");

            ts.Props.Add("shader", "WaterShader");
            ts.Props.Add("stateBlock", "WaterStateBlock");
            ts.Props.Add("version", "3.0");

            ts.Props.Add("useAnisotropic[0]", "true");
            ts.Create();


            //-----------------------------------------------------------------------------
            // Underwater
            //-----------------------------------------------------------------------------

            ts = new TorqueSingleton("ShaderData", "UnderWaterShader");
            ts.PropsAddString(@"DXVertexShaderFile", "shaders/common/water/waterV.hlsl");
            ts.PropsAddString(@"DXPixelShaderFile", "shaders/common/water/waterP.hlsl");

            ts.PropsAddString(@"OGLVertexShaderFile", "shaders/common/water/gl/waterV.glsl");
            ts.PropsAddString(@"OGLPixelShaderFile", "shaders/common/water/gl/waterP.glsl");

            ts.PropsAddString(@"defines", "UNDERWATER");
            ts.Props.Add("pixVersion", "3.0");
            ts.Create();

            ts = new TorqueSingleton("CustomMaterial", "UnderwaterMat");
            // These samplers are set in code not here.
            // This is to allow different WaterObject instances
            // to use this same material but override these textures
            // per instance.   
            //sampler["bumpMap"] = "core/art/water/noise02";
            //sampler["foamMap"] = "core/art/water/foam";
            ts.PropsAddString(@"sampler[""prepassTex""]", "#prepass");
            ts.PropsAddString(@"sampler[""refractBuff""]", "$backbuff");

            ts.PropsAddString(@"shader", "UnderWaterShader");
            ts.PropsAddString(@"stateBlock", "UnderWaterStateBlock");
            ts.PropsAddString(@"specular", "0.75 0.75 0.75 1.0");
            ts.Props.Add(@"specularPower", "48.0");
            ts.Props.Add(@"version", "3.0");
            ts.Create();


            //-----------------------------------------------------------------------------
            // Basic Water
            //-----------------------------------------------------------------------------

            ts = new TorqueSingleton("ShaderData", "WaterBasicShader");

            ts.PropsAddString("DXVertexShaderFile", "shaders/common/water/waterBasicV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/water/waterBasicP.hlsl");

            ts.PropsAddString("OGLVertexShaderFile", "shaders/common/water/gl/waterBasicV.glsl");
            ts.PropsAddString("OGLPixelShaderFile", "shaders/common/water/gl/waterBasicP.glsl");
            ts.Props.Add("pixVersion", "2.0");
            ts.Create();

            ts = new TorqueSingleton("GFXStateBlockData", "WaterBasicStateBlock");
            ts.Props.Add("samplersDefined", "true");
            ts.Props.Add("samplerStates[0]", "WaterSampler"); // noise
            ts.Props.Add("samplerStates[2]", "SamplerClampLinear"); // $reflectbuff
            ts.Props.Add("samplerStates[3]", "SamplerClampPoint"); // $backbuff
            ts.Props.Add("samplerStates[4]", "SamplerWrapLinear"); // $cubemap
            ts.Props.Add("cullDefined", "true");
            ts.PropsAddString("cullMode", "GFXCullCCW");
            ts.Create();

            ts = new TorqueSingleton("GFXStateBlockData", "UnderWaterBasicStateBlock : WaterBasicStateBlock");
            ts.PropsAddString("cullMode", "GFXCullCW");
            ts.Create();

            ts = new TorqueSingleton("CustomMaterial", "WaterBasicMat");
            // These samplers are set in code not here.
            // This is to allow different WaterObject instances
            // to use this same material but override these textures
            // per instance.     
            //sampler["bumpMap"] = "core/art/water/noise02";
            //sampler["skyMap"] = "$cubemap";   

            //sampler["prepassTex"] = "#prepass";
            ts.PropsAddString(@"sampler[""reflectMap""]", "$reflectbuff");
            ts.PropsAddString(@"sampler[""refractBuff""]", "$backbuff");

            ts.Props.Add("cubemap", "NewLevelSkyCubemap");
            ts.Props.Add("shader", "WaterBasicShader");
            ts.Props.Add("stateBlockZ", "WaterBasicStateBlock");
            ts.Props.Add("version", "2.0");
            ts.Create();

            //-----------------------------------------------------------------------------
            // Basic UnderWater
            //-----------------------------------------------------------------------------

            ts = new TorqueSingleton("ShaderData", "UnderWaterBasicShader");
            ts.PropsAddString(@"DXVertexShaderFile", "shaders/common/water/waterBasicV.hlsl");
            ts.PropsAddString(@"DXPixelShaderFile", "shaders/common/water/waterBasicP.hlsl");

            ts.PropsAddString(@"OGLVertexShaderFile", "shaders/common/water/gl/waterBasicV.glsl");
            ts.PropsAddString(@"OGLPixelShaderFile", "shaders/common/water/gl/waterBasicP.glsl");

            ts.PropsAddString(@"defines", "UNDERWATER");
            ts.Props.Add("pixVersion", "2.0");
            ts.Create();

            ts = new TorqueSingleton("CustomMaterial", "UnderwaterBasicMat");
            // These samplers are set in code not here.
            // This is to allow different WaterObject instances
            // to use this same material but override these textures
            // per instance.  
            //sampler["bumpMap"] = "core/art/water/noise02";
            //samplers["skyMap"] = "$cubemap";  

            //sampler["prepassTex"] = "#prepass";
            ts.PropsAddString(@"sampler[""refractBuff""]", "$backbuff");

            ts.Props.Add("shader", "UnderWaterBasicShader");
            ts.Props.Add("stateBlock", "UnderWaterBasicStateBlock");
            ts.Props.Add("version", "2.0");
            ts.Create();
            }
Exemple #28
0
 public void hdr_Init_3()
     {
     TorqueSingleton ts = new TorqueSingleton("PostEffect", "LuminanceVisPostFX");
     ts.Props.Add("isEnabled", "false");
     ts.Props.Add("allowReflectPass", "false");
     ts.PropsAddString("renderTime", "PFXBeforeBin");
     ts.PropsAddString("renderBin", "EditorBin");
     ts.Props.Add("renderPriority", "9999");
     ts.Props.Add("shader", "LuminanceVisShader");
     ts.Props.Add("stateBlock", "LuminanceVisStateBlock");
     ts.PropsAddString("texture[0]", "$backBuffer");
     ts.PropsAddString("target", "$backBuffer");
     ts.Create();
     sGlobal["$HDRPostFX::colorCorrectionRamp"] = default_color_correction;
     }
Exemple #29
0
        public void hdr_Init()
            {
            // Blends between the scene and the tone mapped scene.
            sGlobal["$HDRPostFX::enableToneMapping"] = "1.0";

            // The tone mapping middle grey or exposure value used
            // to adjust the overall "balance" of the image.
            //
            // 0.18 is fairly common value.
            //
            //$HDRPostFX::keyValue = 0.18;
            sGlobal["$HDRPostFX::keyValue"] = "0.18";

            // The minimum luninace value to allow when tone mapping 
            // the scene.  Is particularly useful if your scene very 
            // dark or has a black ambient color in places.
            sGlobal["$HDRPostFX::minLuminace"] = "0.001";

            // The lowest luminance value which is mapped to white.  This
            // is usually set to the highest visible luminance in your 
            // scene.  By setting this to smaller values you get a contrast
            // enhancement.
            sGlobal["$HDRPostFX::whiteCutoff"] = "1.0";

            // The rate of adaptation from the previous and new 
            // average scene luminance. 
            sGlobal["$HDRPostFX::adaptRate"] = "2.0";


            // Blends between the scene and the blue shifted version
            // of the scene for a cinematic desaturated night effect.
            sGlobal["$HDRPostFX::enableBlueShift"] = "0.0";

            // The blue shift color value.
            sGlobal["$HDRPostFX::blueShiftColor"] = "1.05 0.97 1.27";


            // Blends between the scene and the bloomed scene.
            sGlobal["$HDRPostFX::enableBloom"] = "1.0";

            // The threshold luminace value for pixels which are
            // considered "bright" and need to be bloomed.

            sGlobal["$HDRPostFX::brightPassThreshold"] = "1.0";

            // These are used in the gaussian blur of the
            // bright pass for the bloom effect.
            sGlobal["$HDRPostFX::gaussMultiplier"] = "0.3";

            sGlobal["$HDRPostFX::gaussMean"] = "0.0";

            sGlobal["$HDRPostFX::gaussStdDev"] = "0.8";


            // The 1x255 color correction ramp texture used
            // by both the HDR shader and the GammaPostFx shader
            // for doing full screen color correction. 

            sGlobal["$HDRPostFX::colorCorrectionRamp"] = default_color_correction;


            TorqueSingleton ts = new TorqueSingleton("ShaderData", "HDR_BrightPassShader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/postFxV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/hdr/brightPassFilterP.hlsl");
            ts.Props.Add("pixVersion", "3.0");
            ts.Create();

            ts = new TorqueSingleton("ShaderData", "HDR_DownScale4x4Shader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/hdr/downScale4x4V.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/hdr/downScale4x4P.hlsl");
            ts.Props.Add("pixVersion", "2.0");
            ts.Create();


            ts = new TorqueSingleton("ShaderData", "HDR_BloomGaussBlurHShader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/postFxV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/hdr/bloomGaussBlurHP.hlsl");
            ts.Props.Add("pixVersion", "3.0");
            ts.Create();


            ts = new TorqueSingleton("ShaderData", "HDR_BloomGaussBlurVShader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/postFxV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/hdr/bloomGaussBlurVP.hlsl");
            ts.Props.Add("pixVersion", "3.0");
            ts.Create();

            ts = new TorqueSingleton("ShaderData", "HDR_SampleLumShader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/postFxV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/hdr/sampleLumInitialP.hlsl");
            ts.Props.Add("pixVersion", "3.0");
            ts.Create();

            ts = new TorqueSingleton("ShaderData", "HDR_DownSampleLumShader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/postFxV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/hdr/sampleLumIterativeP.hlsl");
            ts.Props.Add("pixVersion", "3.0");
            ts.Create();

            ts = new TorqueSingleton("ShaderData", "HDR_CalcAdaptedLumShader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/postFxV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/hdr/calculateAdaptedLumP.hlsl");
            ts.Props.Add("pixVersion", "3.0");
            ts.Create();

            ts = new TorqueSingleton("ShaderData", "HDR_CombineShader");
            ts.PropsAddString("DXVertexShaderFile", "shaders/common/postFx/postFxV.hlsl");
            ts.PropsAddString("DXPixelShaderFile", "shaders/common/postFx/hdr/finalPassCombineP.hlsl");
            ts.Props.Add("pixVersion", "3.0");
            ts.Create();

            ts = new TorqueSingleton("GFXStateBlockData", "HDR_SampleStateBlock : PFX_DefaultStateBlock");
            ts.Props.Add("samplersDefined", "true");
            ts.Props.Add("samplerStates[0]", "SamplerClampPoint");
            ts.Props.Add("samplerStates[1]", "SamplerClampPoint");
            ts.Create();

            ts = new TorqueSingleton("GFXStateBlockData", "HDR_DownSampleStateBlock : PFX_DefaultStateBlock");
            ts.Props.Add("samplersDefined", "true");
            ts.Props.Add("samplerStates[0]", "SamplerClampLinear");
            ts.Props.Add("samplerStates[1]", "SamplerClampLinear");
            ts.Create();


            ts = new TorqueSingleton("GFXStateBlockData", "HDR_CombineStateBlock : PFX_DefaultStateBlock");

            ts.Props.Add("samplersDefined", "true");
            ts.Props.Add("samplerStates[0]", "SamplerClampPoint");
            ts.Props.Add("samplerStates[1]", "SamplerClampLinear");
            ts.Props.Add("samplerStates[2]", "SamplerClampLinear");
            ts.Props.Add("samplerStates[3]", "SamplerClampLinear");
            ts.Create();


            ts = new TorqueSingleton("GFXStateBlockData", "HDRStateBlock");
            ts.Props.Add("samplersDefined", "true");
            ts.Props.Add("samplerStates[0]", "SamplerClampLinear");
            ts.Props.Add("samplerStates[1]", "SamplerClampLinear");
            ts.Props.Add("samplerStates[2]", "SamplerClampLinear");
            ts.Props.Add("samplerStates[3]", "SamplerClampLinear");

            ts.Props.Add("blendDefined", "true");
            ts.Props.Add("blendDest", "GFXBlendOne");
            ts.Props.Add("blendSrc", "GFXBlendZero");

            ts.Props.Add("zDefined", "true");
            ts.Props.Add("zEnable", "false");
            ts.Props.Add("zWriteEnable", "false");

            ts.Props.Add("cullDefined", "true");
            ts.Props.Add("cullMode", "GFXCullNone");
            ts.Create();
            }
 public void initialize_AudioStates()
     {
     coSFXState AudioStateNone = new TorqueSingleton("SFXState", "AudioStateNone").Create();
     AudioStateNone.activate();
     }