// inscatter texture // transmittance texture //static RwTexId m_transmittanceLut; //static RwTexId m_inscatterLutR; //static RwTexId m_inscatterLutM; internal static void Init() { m_ps = MyShaders.CreatePs("atmosphere.hlsl"); m_psPerSample = MyShaders.CreatePs("atmosphere.hlsl", MyRender11.ShaderSampleFrequencyDefine()); m_precomputeDensity = MyShaders.CreateCs("AtmospherePrecompute.hlsl"); m_proxyVs = MyShaders.CreateVs("atmosphere.hlsl"); m_proxyIL = MyShaders.CreateIL(m_proxyVs.BytecodeId, MyVertexLayouts.GetLayout(MyVertexInputComponentType.POSITION_PACKED)); }
internal static unsafe void Init() { //MyRender11.RegisterSettingsChangedListener(new OnSettingsChangedDelegate(RecreateShadersForSettings)); DirectionalEnvironmentLight_Pixel = MyShaders.CreatePs("Lighting/LightDir.hlsl"); DirectionalEnvironmentLight_Sample = MyShaders.CreatePs("Lighting/LightDir.hlsl", MyRender11.ShaderSampleFrequencyDefine()); PointlightsTiled_Pixel = MyShaders.CreatePs("Lighting/LightPoint.hlsl"); PointlightsTiled_Sample = MyShaders.CreatePs("Lighting/LightPoint.hlsl", MyRender11.ShaderSampleFrequencyDefine()); m_preparePointLights = MyShaders.CreateCs("Lighting/PrepareLights.hlsl", new[] { new ShaderMacro("NUMTHREADS", TILE_SIZE) }); SpotlightProxyVs = MyShaders.CreateVs("Lighting/LightSpot.hlsl"); SpotlightPs_Pixel = MyShaders.CreatePs("Lighting/LightSpot.hlsl"); SpotlightPs_Sample = MyShaders.CreatePs("Lighting/LightSpot.hlsl", MyRender11.ShaderSampleFrequencyDefine()); SpotlightProxyIL = MyShaders.CreateIL(SpotlightProxyVs.BytecodeId, MyVertexLayouts.GetLayout(MyVertexInputComponentType.POSITION_PACKED)); m_pointlightCullHwBuffer = MyHwBuffers.CreateStructuredBuffer(MyRender11Constants.MAX_POINT_LIGHTS, sizeof(MyPointlightConstants), true, null, "MyLightRendering"); }
internal static unsafe void Init() { //MyRender11.RegisterSettingsChangedListener(new OnSettingsChangedDelegate(RecreateShadersForSettings)); DirectionalEnvironmentLight_Pixel = MyShaders.CreatePs("light.hlsl", "directional_environment"); DirectionalEnvironmentLight_Sample = MyShaders.CreatePs("light.hlsl", "directional_environment", MyShaderHelpers.FormatMacros(MyRender11.ShaderSampleFrequencyDefine())); PointlightsTiled_Pixel = MyShaders.CreatePs("light.hlsl", "pointlights_tiled"); PointlightsTiled_Sample = MyShaders.CreatePs("light.hlsl", "pointlights_tiled", MyShaderHelpers.FormatMacros(MyRender11.ShaderSampleFrequencyDefine())); m_preparePointLights = MyShaders.CreateCs("prepare_lights.hlsl", "prepare_lights", MyShaderHelpers.FormatMacros("NUMTHREADS " + TILE_SIZE)); SpotlightProxyVs = MyShaders.CreateVs("light.hlsl", "proxyVs"); SpotlightPs_Pixel = MyShaders.CreatePs("light.hlsl", "spotlightFromProxy"); SpotlightPs_Sample = MyShaders.CreatePs("light.hlsl", "spotlightFromProxy", MyShaderHelpers.FormatMacros(MyRender11.ShaderSampleFrequencyDefine())); SpotlightProxyIL = MyShaders.CreateIL(SpotlightProxyVs.BytecodeId, MyVertexLayouts.GetLayout(MyVertexInputComponentType.POSITION_PACKED)); var stride = sizeof(MyPointlightConstants); m_pointlightCullHwBuffer = MyHwBuffers.CreateStructuredBuffer(MyRender11Constants.MAX_POINT_LIGHTS, stride, true); m_pointlightsConstants = MyHwBuffers.CreateConstantsBuffer(sizeof(MyPointlightInfo) * MyRender11Constants.MAX_POINT_LIGHTS); m_spotlightsConstants = MyHwBuffers.CreateConstantsBuffer(sizeof(MySpotlightConstants) * MyRender11Constants.MAX_SPOTLIGHTS); m_sunlightConstants = MyHwBuffers.CreateConstantsBuffer(sizeof(MySunlightConstantsLayout)); }
// inscatter texture // transmittance texture //static RwTexId m_transmittanceLut; //static RwTexId m_inscatterLutR; //static RwTexId m_inscatterLutM; internal static unsafe void Init() { m_ps = MyShaders.CreatePs("Transparent/Atmosphere/AtmosphereGBuffer.hlsl"); m_psPerSample = MyShaders.CreatePs("Transparent/Atmosphere/AtmosphereGBuffer.hlsl", MyRender11.ShaderSampleFrequencyDefine()); m_psEnv = MyShaders.CreatePs("Transparent/Atmosphere/AtmosphereEnv.hlsl"); m_psEnvPerSample = MyShaders.CreatePs("Transparent/Atmosphere/AtmosphereEnv.hlsl", MyRender11.ShaderSampleFrequencyDefine()); m_precomputeDensity = MyShaders.CreateCs("Transparent/Atmosphere/AtmospherePrecompute.hlsl"); m_proxyVs = MyShaders.CreateVs("Transparent/Atmosphere/AtmosphereVS.hlsl"); m_proxyIL = MyShaders.CreateIL(m_proxyVs.BytecodeId, MyVertexLayouts.GetLayout(MyVertexInputComponentType.POSITION_PACKED)); m_cb = MyManagers.Buffers.CreateConstantBuffer("CommonObjectCB" + sizeof(AtmosphereConstants), sizeof(AtmosphereConstants), usage: SharpDX.Direct3D11.ResourceUsage.Dynamic); }
internal static void Init() { //m_copyPs = MyShaders.CreatePs("postprocess.hlsl", "copy"); //m_clearAlphaPs = MyShaders.CreatePs("postprocess.hlsl", "clear_alpha"); m_blurH = MyShaders.CreatePs("blur.hlsl", "blur_h", MyShaderHelpers.FormatMacros(MyRender11.ShaderSampleFrequencyDefine())); m_blurV = MyShaders.CreatePs("blur.hlsl", "blur_v"); }
// inscatter texture // transmittance texture //static RwTexId m_transmittanceLut; //static RwTexId m_inscatterLutR; //static RwTexId m_inscatterLutM; internal static void Init() { m_ps = MyShaders.CreatePs("atmosphere.hlsl", "psAtmosphereInscatter"); m_psT = MyShaders.CreatePs("atmosphere.hlsl", "psAtmosphereTransmittance"); m_psPerSample = MyShaders.CreatePs("atmosphere.hlsl", "psAtmosphereInscatter", MyShaderHelpers.FormatMacros(MyRender11.ShaderSampleFrequencyDefine())); m_psTPerSample = MyShaders.CreatePs("atmosphere.hlsl", "psAtmosphereTransmittance", MyShaderHelpers.FormatMacros(MyRender11.ShaderSampleFrequencyDefine())); m_precomputeDensity = MyShaders.CreateCs("AtmospherePrecompute.hlsl", "precomputeDensity"); m_precomputeInscatter1 = MyShaders.CreateCs("AtmospherePrecompute.hlsl", "precomputeInscatter1"); m_proxyVs = MyShaders.CreateVs("atmosphere.hlsl", "proxyVs"); m_proxyIL = MyShaders.CreateIL(m_proxyVs.BytecodeId, MyVertexLayouts.GetLayout(MyVertexInputComponentType.POSITION_PACKED)); //Precompute(); }