aboutsummaryrefslogtreecommitdiffstatsci
path: root/vke/src/glTFLoader.cs
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2019-04-24 04:17:16 +0200
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2019-04-24 04:17:16 +0200
commit2d2e2ff4038db052d0186645f5afe4ec9daf2505 (patch)
treed8491d9921381ec5d4149fdc014b72e375199dab /vke/src/glTFLoader.cs
parent25fc1c7019142137dc67e4fad0c3088d845ab0a8 (diff)
use boolean for tex0 and tex1 availability tests
Diffstat (limited to 'vke/src/glTFLoader.cs')
-rw-r--r--vke/src/glTFLoader.cs33
1 files changed, 22 insertions, 11 deletions
diff --git a/vke/src/glTFLoader.cs b/vke/src/glTFLoader.cs
index b51cd3c..ce6b8d8 100644
--- a/vke/src/glTFLoader.cs
+++ b/vke/src/glTFLoader.cs
@@ -486,37 +486,48 @@ namespace CVKL {
if (mat.EmissiveTexture != null) {
pbr.emissiveTexture = (uint)mat.EmissiveTexture.Index;
- pbr.texCoordSets.emissive = (byte)mat.EmissiveTexture.TexCoord;
- pbr.availableAttachments |= AttachmentType.Emissive;
+ if (mat.EmissiveTexture.TexCoord == 1)
+ pbr.availableAttachments1 |= AttachmentType.Emissive;
+ else
+ pbr.availableAttachments |= AttachmentType.Emissive;
}
if (mat.NormalTexture != null) {
pbr.normalTexture = (uint)mat.NormalTexture.Index;
- pbr.texCoordSets.normal = (byte)mat.NormalTexture.TexCoord;
- pbr.availableAttachments |= AttachmentType.Normal;
+ if (mat.NormalTexture.TexCoord == 1)
+ pbr.availableAttachments1 |= AttachmentType.Normal;
+ else
+ pbr.availableAttachments |= AttachmentType.Normal;
}
if (mat.OcclusionTexture != null) {
pbr.occlusionTexture = (uint)mat.OcclusionTexture.Index;
- pbr.texCoordSets.occlusion = (byte)mat.OcclusionTexture.TexCoord;
- pbr.availableAttachments |= AttachmentType.AmbientOcclusion;
+ if (mat.OcclusionTexture.TexCoord == 1)
+ pbr.availableAttachments1 |= AttachmentType.AmbientOcclusion;
+ else
+ pbr.availableAttachments |= AttachmentType.AmbientOcclusion;
}
if (mat.PbrMetallicRoughness != null) {
if (mat.PbrMetallicRoughness.BaseColorTexture != null) {
- pbr.texCoordSets.baseColor = (byte)mat.PbrMetallicRoughness.BaseColorTexture.TexCoord;
pbr.baseColorTexture = (uint)mat.PbrMetallicRoughness.BaseColorTexture.Index;
- pbr.availableAttachments |= VK.AttachmentType.Color;
+ if (mat.PbrMetallicRoughness.BaseColorTexture.TexCoord == 1)
+ pbr.availableAttachments1 |= AttachmentType.Color;
+ else
+ pbr.availableAttachments |= AttachmentType.Color;
}
FromFloatArray (ref pbr.baseColorFactor, mat.PbrMetallicRoughness.BaseColorFactor);
if (mat.PbrMetallicRoughness.MetallicRoughnessTexture != null) {
- pbr.texCoordSets.metallicRoughness = (byte)mat.PbrMetallicRoughness.MetallicRoughnessTexture.TexCoord;
pbr.metallicRoughnessTexture = (uint)mat.PbrMetallicRoughness.MetallicRoughnessTexture.Index;
- pbr.availableAttachments |= VK.AttachmentType.MetalRoughness;
-
+ if (mat.PbrMetallicRoughness.MetallicRoughnessTexture.TexCoord == 1)
+ pbr.availableAttachments1 |= AttachmentType.PhysicalProps;
+ else
+ pbr.availableAttachments |= AttachmentType.PhysicalProps;
}
pbr.metallicFactor = mat.PbrMetallicRoughness.MetallicFactor;
pbr.roughnessFactor = mat.PbrMetallicRoughness.RoughnessFactor;
+
+ pbr.workflow = Material.Workflow.PhysicalyBaseRendering;
}
materials.Add (pbr);
/*