6 using namespace System::Collections::Generic;
7 using namespace System::IO;
8 using namespace SiliconStudio::Core::Diagnostics;
9 using namespace SiliconStudio::Core::Mathematics;
10 using namespace SiliconStudio::Core::Serialization;
11 using namespace SiliconStudio::Paradox::Assets::Materials;
12 using namespace SiliconStudio::Paradox::Assets::Materials::Nodes;
13 using namespace SiliconStudio::Paradox::Effects;
14 using namespace SiliconStudio::Paradox::Effects::Data;
15 using namespace SiliconStudio::Paradox::Effects::Modules;
16 using namespace SiliconStudio::Paradox::Engine::Data;
17 using namespace SiliconStudio::Paradox::Graphics;
18 using namespace SiliconStudio::Paradox::Shaders;
20 namespace SiliconStudio {
namespace Paradox {
namespace Importer {
namespace Common {
63 Dictionary<String^, MaterialDescription^>^
Materials;
75 Dictionary<String^, MaterialDescription^>^
Materials;
101 auto url = vfsOutputPath +
"_" + Path::GetFileNameWithoutExtension(sourceTextureFile);
103 texture->Location = url;
106 if (File::Exists(sourceTextureFile))
108 if (logger !=
nullptr)
110 logger->
Warning(
"The texture '{0}' referenced in the mesh material can not be found on the system. Loading will probably fail at run time.", sourceTextureFile,
111 nullptr, CallerInfo::Get(__FILEW__, __FUNCTIONW__, __LINE__));
119 parameterKey = ParameterKeys::IndexedKey(surfaceMaterialKey, textureCount++);
120 String^ uvSetName =
"TEXCOORD";
121 if (textureUVSetIndex != 0)
122 uvSetName += textureUVSetIndex;
124 auto uvScaling = textureUVscaling;
125 auto textureName = parameterKey->
Name;
126 auto needScaling = uvScaling != Vector2::One;
127 auto currentComposition = needScaling
128 ?
gcnew ShaderClassSource(
"ComputeColorTextureRepeat", textureName, uvSetName,
"float2(" + uvScaling[0] +
", " + uvScaling[1] +
")")
129 :
gcnew ShaderClassSource((surfaceMaterialKey == MaterialTexturingKeys::DisplacementTexture0) ?
"ComputeColorTextureDisplacement" :
"ComputeColorTexture", textureName, uvSetName);
131 return currentComposition;
138 auto textureFileName = Path::GetFileNameWithoutExtension(sourceTextureFile);
139 auto url = vfsOutputPath +
"_" + textureFileName;
143 if (File::Exists(sourceTextureFile))
145 if (logger !=
nullptr)
147 logger->
Warning(
"The texture '{0}' referenced in the mesh material can not be found on the system. Loading will probably fail at run time.", sourceTextureFile,
148 nullptr, CallerInfo::Get(__FILEW__, __FUNCTIONW__, __LINE__));
152 auto uvScaling = textureUVscaling;
153 auto textureName = textureFileName;
155 auto currentTexture =
gcnew MaterialTextureNode(textureName, textureUVSetIndex, uvScaling, Vector2::Zero);
156 currentTexture->Sampler->AddressModeU = wrapTextureU ? TextureAddressMode::Wrap : TextureAddressMode::Clamp;
157 currentTexture->Sampler->AddressModeV = wrapTextureV ? TextureAddressMode::Wrap : TextureAddressMode::Clamp;
159 return currentTexture;
Key of an effect parameter.
Represents a two dimensional mathematical vector.
string Name
Gets the name of this key.
Description of a material.
List< MeshParameters^> Models
Represents a three dimensional mathematical vector.
ParameterCollectionData Parameters
Data type for SiliconStudio.Paradox.Effects.ParameterCollection.
List< String^> Parameters
Dictionary< String^, MaterialDescription^> Materials
Base implementation for ILogger.
static MaterialTextureNode GenerateMaterialTextureNode(String^vfsOutputPath, String^sourceTextureFile, int textureUVSetIndex, Vector2 textureUVscaling, bool wrapTextureU, bool wrapTextureV, Logger^logger)
List< CameraInfo^> Cameras
MaterialDescription Material
List< CameraInfo^> Cameras
List< String^> AnimationNodes
abstract string Location
Gets or sets the URL of the referenced data.
Data type for SiliconStudio.Paradox.Effects.Mesh.
List< MeshParameters^> Models
Dictionary< String^, MaterialDescription^> Materials
List< String^> TextureDependencies
void Warning(string message, Exception exception, CallerInfo callerInfo=null)
Logs the specified warning message with an exception.
Data type for SiliconStudio.Paradox.Engine.LightComponent.
Data type for SiliconStudio.Paradox.Engine.CameraComponent.
A shader class used for mixin.
static ShaderClassSource GenerateTextureLayer(String^vfsOutputPath, String^sourceTextureFile, int textureUVSetIndex, Vector2 textureUVscaling, int &textureCount, ParameterKey< Texture^>^surfaceMaterialKey, MeshData^meshData, Logger^logger)