コード例 #1
0
        private static void HotReload_NOT(AssetsManagerInstance AM)
        {
            AM.ImportAsset(@"Deffered\CommonVS.hlsl", "CommonVS", true);
            //AM.ImportShaderAsset(@"Commons\ScreenQuadPS.hlsl", "ScreenQuadPS", "PSMain", true);
            //AM.ImportShaderAsset(@"Deffered\LightPass.hlsl", "MSAA_LightPassPS", "PSMain", "MSAA", true);
            //AM.ImportShaderAsset(@"Commons\ScreenQuadPS.hlsl", "MSAA_ScreenQuadPS", "PSMain", "MSAA", true);

            AM.ImportShaderAsset(@"Deffered\LightPass.hlsl", "LightPassPS", "PSMain", true);
            AM.ImportShaderAsset(@"Deffered\FillGBuffer.hlsl", "FillGBufferPS", "FillGBufferPS", true);
            AM.ImportShaderAsset(@"Deffered\FillGBuffer.hlsl", "FillGBufferSkyboxPS", "FillGBufferPS",
                                 "TEXTURE_CUBE_ALBEDO_MAP", true);
            AM.ImportShaderAsset(@"Deffered\FillGBuffer.hlsl", "FillGBufferMaskedPS", "FillGBufferPS",
                                 "MASKED", true);
            //AM.ImportShaderAsset(@"Deffered\DownscalingCS.hlsl", "DownsamplingFirstCS", "DownScaleFirstPass", true);
            //AM.ImportShaderAsset(@"Deffered\DownscalingCS.hlsl", "DownsamplingSecondCS", "DownScaleSecondPass", true);
            AM.ImportShaderAsset(@"Commons\ScreenQuadPS.hlsl", "ScreenQuadPS", "PSMain", true);
            AM.ImportShaderAsset(@"Commons\ScreenQuadVS.hlsl", "ScreenQuadVS", "VSMain", true);

            Dictionary <string, string> pathNamePairs = new Dictionary <string, string>();

            //pathNamePairs.Add("Textures/SnowRock/rock-snow-ice1-2k_Base_Color.png", "SnowRockAlbedoMap");
            foreach (string path in pathNamePairs.Keys)
            {
                AM.ImportAsset(RawContentPath + path, pathNamePairs[path], true);
            }
            //AM.CreateMaterialAsset("SnowRockMaterial", "SnowRockAlbedoMap",
            //    "SnowRockNormalMap", "SnowRockRoughnessMap",
            //    "SnowRockMetallicMap", "SnowRockOcclusionMap");
        }
コード例 #2
0
        private void ImportAsset()
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter = "Raw assets|*.obj;*.fbx;*.bmp;*.jpg;*.png|Shader source code|*.hlsl|All files|*.*";
            if (openFileDialog.ShowDialog() == FDialogResult.Cancel)
            {
                return;
            }
            string FilePath     = openFileDialog.FileName;
            string SafeFileName = openFileDialog.SafeFileName;

            AssetsManagerInstance AssetManager = AssetsManagerInstance.GetManager();
            string    assetName = SafeFileName.Split('.')[0];
            BaseAsset asset;

            if (AssetManager.ImportAsset(FilePath, assetName, true, out asset))
            {
                if (asset.Type == AssetTypes.Mesh)
                {
                    EngineCore.AssetsLoader.DropCachedMesh(assetName);
                }
                RefreshAssetsTable();
            }
            else
            {
                System.Windows.MessageBox.Show("Import Failed");
            }
            SelectedFolder = asset.Type;
        }
コード例 #3
0
        private static void ImportTextures(AssetsManagerInstance AM)
        {
            Dictionary <string, string> pathNamePairs = new Dictionary <string, string>();

            pathNamePairs.Add(@"Textures\WoodenLatticeMap.png", "WoodenLatticeMap");
            pathNamePairs.Add(@"SponzaMaps\sponza_floor_a_diff.png", "SponzaFloorAlbedo");
            pathNamePairs.Add(@"SponzaMaps\sponza_floor_a_diff_NRM.png", "SponzaFloorNormal");
            pathNamePairs.Add(@"SponzaMaps\sponza_roof_diff.png", "SponzaRoofAlbedo");
            pathNamePairs.Add(@"SponzaMaps\sponza_roof_diff_NRM.png", "SponzaRoofNormal");
            pathNamePairs.Add(@"SponzaMaps\sponza_column_a_diff.png", "SponzaColumnAAlbedo");
            pathNamePairs.Add(@"SponzaMaps\sponza_column_a_ddn.png", "SponzaColumnANormal");
            pathNamePairs.Add(@"SponzaMaps\sponza_column_b_diff.png", "SponzaColumnBAlbedo");
            pathNamePairs.Add(@"SponzaMaps\sponza_column_b_ddn.png", "SponzaColumnBNormal");
            pathNamePairs.Add(@"SponzaMaps\sponza_column_c_diff.png", "SponzaColumnCAlbedo");
            pathNamePairs.Add(@"SponzaMaps\sponza_column_c_ddn.png", "SponzaColumnCNormal");
            pathNamePairs.Add(@"SponzaMaps\lion.png", "LionAlbedo");
            pathNamePairs.Add(@"SponzaMaps\lion_ddn.png", "LionNormal");
            pathNamePairs.Add(@"SponzaMaps\sponza_curtain_blue_diff.png", "SponzaCurtainBlueAlbedo");
            pathNamePairs.Add(@"SponzaMaps\sponza_curtain_blue_diff_NRM.png", "SponzaCurtainBlueNormal");
            pathNamePairs.Add(@"SponzaMaps\sponza_curtain_diff.png", "SponzaCurtainRedAlbedo");
            pathNamePairs.Add(@"SponzaMaps\sponza_curtain_green_diff.png", "SponzaCurtainGreenAlbedo");
            pathNamePairs.Add(@"SponzaMaps\sponza_fabric_blue_diff.png", "SponzaFabricBlueAlbedo");
            pathNamePairs.Add(@"SponzaMaps\sponza_fabric_blue_diff_NRM.png", "SponzaFabricBlueNormal");
            pathNamePairs.Add(@"SponzaMaps\sponza_fabric_diff.png", "SponzaFabricRedAlbedo");
            pathNamePairs.Add(@"SponzaMaps\sponza_fabric_green_diff.png", "SponzaFabricGreenAlbedo");
            pathNamePairs.Add(@"SponzaMaps\sponza_arch_diff.png", "SponzaArcAlbedo");
            pathNamePairs.Add(@"SponzaMaps\sponza_arch_diff_NRM.png", "SponzaArcNormal");

            pathNamePairs.Add(@"Textures\MetalMat\oxidized-copper-albedo.png", "CopperAlbedoMap");
            pathNamePairs.Add(@"Textures\MetalMat\oxidized-copper-normal-ue.png", "CopperNormalMap");
            pathNamePairs.Add(@"Textures\MetalMat\oxidized-copper-roughness.png", "CopperRoughnessMap");
            pathNamePairs.Add(@"Textures\MetalMat\oxidized-copper-metal.png", "CopperMetallicMap");
            pathNamePairs.Add(@"Textures\DebugTextureGrid.jpg", "DebugTextureMap");
            pathNamePairs.Add(@"Textures\cow.jpg", "CowAlbedoMap");

            pathNamePairs.Add(@"Textures\MetalMat\metal-splotchy-albedo.png", "MetalSplotchyAlbedoMap");
            pathNamePairs.Add(@"Textures\MetalMat\metal-splotchy-normal-dx.png", "MetalSplotchyNormalMap");
            pathNamePairs.Add(@"Textures\MetalMat\metal-splotchy-rough.png", "MetalSplotchyRoughnessMap");
            pathNamePairs.Add(@"Textures\MetalMat\metal-splotchy-metal.png", "MetalSplotchyMetallicMap");

            pathNamePairs.Add(@"Textures\SnowRock\rock-snow-ice1-2k_Base_Color.png", "SnowRockAlbedoMap");
            pathNamePairs.Add(@"Textures\SnowRock\rock-snow-ice1-2k_Normal-dx.png", "SnowRockNormalMap");
            pathNamePairs.Add(@"Textures\SnowRock\rock-snow-ice1-2k_Roughness.png", "SnowRockRoughnessMap");
            pathNamePairs.Add(@"Textures\SnowRock\rock-snow-ice1-2k_Metallic.png", "SnowRockMetallicMap");
            pathNamePairs.Add(@"Textures\SnowRock\rock-snow-ice1-2k_Ambient_Occlusion.png", "SnowRockOcclusionMap");

            foreach (string path in pathNamePairs.Keys)
            {
                AM.ImportAsset(RawContentPath + path, pathNamePairs[path], true);
            }
        }
コード例 #4
0
        private void Create_Click(object sender, RoutedEventArgs e)
        {
            if (ofDialog == null)
            {
                return;
            }
            AssetsManagerInstance AM = AssetsManagerInstance.GetManager();
            string    assetName      = ofDialog.SafeFileName.Split('.')[0];
            BaseAsset asset;

            if (AM.ImportAsset(ofDialog.FileName, assetName, false, out asset))
            {
                RefreshAssetsTable();
                AssetTypesList.SelectedValue = asset.Type;
                AssetNamesList.SelectedValue = asset.Name;
            }
            else
            {
                System.Windows.MessageBox.Show("Import Failed");
            }
        }
コード例 #5
0
        private static void ImportShaders(AssetsManagerInstance AM)
        {
            AM.ImportAsset(@"Commons\CommonVS.hlsl", "CommonVS", true);

            AM.ImportShaderAsset(@"Deffered\LightVolumes.hlsl", "LightVolumesVS", "LightVolumesVS", true);
            AM.ImportShaderAsset(@"Deffered\LightVolumes.hlsl", "LightVolumesHS", "LightVolumesHS", true);
            AM.ImportShaderAsset(@"Deffered\LightVolumes.hlsl", "PointLightVolumeDS", "LightVolumeDS", "POINT_LIGHT", true);
            AM.ImportShaderAsset(@"Deffered\LightVolumes.hlsl", "SpotLightVolumeDS", "LightVolumeDS", "SPOT_LIGHT", true);
            AM.ImportShaderAsset(@"Deffered\LightVolumes.hlsl", "CapsuleLightVolumeDS", "LightVolumeDS", "CAPSULE_LIGHT", true);

            AM.ImportShaderAsset(@"Deffered\FillGBuffer.hlsl", "FillGBufferVS", "FillGBufferVS", true);
            AM.ImportShaderAsset(@"Deffered\FillGBuffer.hlsl", "FillGBufferPS", "FillGBufferPS", true);
            AM.ImportShaderAsset(@"Deffered\FillGBuffer.hlsl", "FillGBufferSkyboxPS", "FillGBufferPS",
                                 "TEXTURE_CUBE_ALBEDO_MAP", true);
            AM.ImportShaderAsset(@"Deffered\FillGBuffer.hlsl", "FillGBufferMaskedPS", "FillGBufferPS",
                                 "MASKED", true);

            AM.ImportShaderAsset(@"Deffered\LightPass.hlsl", "LightPassVS", "VSMain", true);
            AM.ImportShaderAsset(@"Deffered\LightPass.hlsl", "LightPassPS", "PSMain", true);
            AM.ImportShaderAsset(@"Deffered\LightPass.hlsl", "MSAA_LightPassPS", "PSMain", "MSAA", true);

            AM.ImportShaderAsset(@"Deffered\LightPass.hlsl", "LightPassDirectionalPS", "PSDirectionalLight", true);
            AM.ImportShaderAsset(@"Deffered\LightPass.hlsl", "LightPassDirectionalPS", "PSDirectionalLight", "MSAA", true);
            AM.ImportShaderAsset(@"Deffered\LightPass.hlsl", "LightPassPointPS", "PSPointLight", true);
            AM.ImportShaderAsset(@"Deffered\LightPass.hlsl", "MSAA_LightPassPointPS", "PSPointLight", "MSAA", true);
            AM.ImportShaderAsset(@"Deffered\LightPass.hlsl", "LightPassPointQuadPS", "PSPointLight", "SQUAD", true);
            AM.ImportShaderAsset(@"Deffered\LightPass.hlsl", "MSAA_LightPassPointQuadPS", "PSPointLight", "SQUAD", "MSAA", true);

            AM.ImportShaderAsset(@"Commons\ScreenQuadPS.hlsl", "ScreenQuadPS", "PSMain", true);
            AM.ImportShaderAsset(@"Commons\ScreenQuadPS.hlsl", "MSAA_ScreenQuadPS", "PSMain", "MSAA", true);
            AM.ImportAsset(@"Commons\ScreenQuadVS.hlsl", "ScreenQuadVS", true);

            //Forward
            AM.ImportAsset(@"PBR\PBRForwardPS.hlsl", "PBRForwardPS", true);
            AM.ImportAsset(@"Unlit\FwdSkySpherePS.hlsl", "FwdSkySpherePS", true);
            AM.ImportAsset(@"ForwardPlus\LightCullingCS.hlsl", "LightCullingCS");
            AM.ImportAsset(@"ForwardPlus\ForwardPlusPosOnlyVS.hlsl", "ForwardPlusPosOnlyVS", true);
            AM.ImportAsset(@"ForwardPlus\ForwardPlusPosTexVS.hlsl", "ForwardPlusPosTexVS", true);
            AM.ImportAsset(@"ForwardPlus\ForwardPlusPosTexPS.hlsl", "ForwardPlusPosTexPS", true);
            AM.ImportAsset(@"ForwardPlus\ForwardPlusScenePS.hlsl", "ForwardPlusScenePS", true);

            AM.ImportAsset(@"Unlit\ReflectionSpherePS.hlsl", "ReflectionSpherePS", true);

            AM.ImportAsset(@"Commons\DepthShadowsVS.hlsl", "DepthShadowsVS", true);
            AM.ImportAsset(@"Commons\DepthShadowsPS.hlsl", "DepthShadowsPS", true);
            AM.ImportAsset(@"Commons\DownSamplingPS.hlsl", "DownSamplingPS", true);
            AM.ImportAsset(@"Unlit\VelocityPS.hlsl", "VelocityPS", true);
            AM.ImportAsset(@"Unlit\MaskedVelocityPS.hlsl", "MaskedVelocityPS", true);
        }