Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b0f0e8e

Browse files
committed
Automatic merge of T1.5.1-278-g7f34b56af and 32 pull requests
- Pull request #570 at 8be57e8: Experimental glTF 2.0 support with PBR lighting - Pull request #722 at fb9079e: Fix Windows Forms deprecations in ActivityEditor - Pull request #732 at 1edb2e5: Improvements for air brakes - Pull request #751 at 00981a2: Web interface to control cab controls with external hardware - Pull request #767 at 4cb5c77: Refine sunrise and sunset - Pull request #769 at 1a99f43: Partial turntables https://blueprints.launchpad.net/or/+spec/partial-turntable - Pull request #771 at c380043: Action on Hold Signal is no longer invalidated if train is not stoppe… - Pull request #772 at 36c3662: Update tt train - Pull request #774 at d3f8c2e: Use variable OrgAINumber for all train to train references - Pull request #775 at d84c8d8: Update turntable pools - Pull request #776 at 7b6af67: Update Receivers in Viewer.cs - Pull request #777 at 7724f2b: Save and restore ClearMovingTable action (for timetables) - Pull request #778 at 779a819: Correction for player locomotive on turntable - Pull request #779 at 87c34a7: Remove forced processed ClearSection actions - Pull request #780 at 5b3f246: Process passing time - Pull request #781 at 4d9c3fb: Correct update of pending speed limits for timetable mode - Pull request #782 at 23c41b5: Nu full physics update is required for trains in state AIStatic - Pull request #783 at 083bc6c: Move CreateInPool from AI to Pools - Pull request #784 at 1c37be3: Incorrect distance along track - Pull request #785 at fd121be: Incorrect calculation of distance to train ahead - Pull request #786 at f2c5d2d: Improve syntax check on timetable files - Pull request #787 at e0ad658: Improve debug output for turntable pools - Pull request #788 at 94a73d5: Improve Debug Outputs for TTTrain.cs - Pull request #789 at 81b11f7: Avoid error on inserting train without start time - Pull request #790 at 36a9921: Correct crash in TrainCar.cs - Pull request #791 at 5bc890b: Correct update for Switchstand signalscript function - Pull request #792 at f6c16fb: Correct required actions - Pull request #793 at 8897021: Correct errors in Turntables.cs - Pull request #794 at 6d2bf04: Use reverse path in TT Pool - Pull request #795 at 79979e2: Accept SpeedMPS as dimension for Approach Control Speed definition - Pull request #797 at 7ced1fe: To use enum for ControlGearBoxType - Pull request #803 at 7157e08: Various adjustments to steam adhesion

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Source/RunActivity/Viewer3D/GltfShape.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public class GltfShape : SharedShape
4646
"KHR_lights_punctual",
4747
"KHR_materials_unlit",
4848
"KHR_materials_clearcoat",
49+
"KHR_materials_emissive_strength",
4950
"MSFT_lod",
5051
"MSFT_texture_dds",
5152
"MSFT_packing_normalRoughnessMetallic",
@@ -1092,6 +1093,10 @@ public GltfSubObject(MeshPrimitive meshPrimitive, string name, int hierarchyInde
10921093
if (material.Extensions?.TryGetValue("KHR_materials_clearcoat", out extension) ?? false)
10931094
clearcoat = Newtonsoft.Json.JsonConvert.DeserializeObject<KHR_materials_clearcoat>(extension.ToString());
10941095

1096+
var emissiveStrength = 1f;
1097+
if (material.Extensions?.TryGetValue("KHR_materials_emissive_strength", out extension) ?? false)
1098+
emissiveStrength = Newtonsoft.Json.JsonConvert.DeserializeObject<KHR_materials_emissive_strength>(extension.ToString())?.EmissiveStrength ?? 1;
1099+
10951100
(texCoords1.X, baseColorTexture, baseColorSamplerState) = distanceLevel.GetTextureInfo(gltfFile, material.PbrMetallicRoughness?.BaseColorTexture, SharedMaterialManager.WhiteTexture);
10961101
(texCoords1.Y, metallicRoughnessTexture, metallicRoughnessSamplerState) = distanceLevel.GetTextureInfo(gltfFile, msftRmoInfo ?? msftOrmInfo ?? material.PbrMetallicRoughness?.MetallicRoughnessTexture, SharedMaterialManager.WhiteTexture);
10971102
(texCoords1.Z, normalTexture, normalSamplerState) = distanceLevel.GetTextureInfo(gltfFile, msftNormalInfo ?? material.NormalTexture, SharedMaterialManager.WhiteTexture);
@@ -1108,7 +1113,7 @@ public GltfSubObject(MeshPrimitive meshPrimitive, string name, int hierarchyInde
11081113
var roughtnessFactor = material.PbrMetallicRoughness?.RoughnessFactor ?? 1f;
11091114
var normalScale = material.NormalTexture?.Scale ?? 0; // Must be 0 only if the textureInfo is missing, otherwise it must have the default value 1.
11101115
var occlusionStrength = material.OcclusionTexture?.Strength ?? 0; // Must be 0 only if the textureInfo is missing, otherwise it must have the default value 1.
1111-
var emissiveFactor = MemoryMarshal.Cast<float, Vector3>(material.EmissiveFactor ?? new[] { 0f, 0f, 0f })[0];
1116+
var emissiveFactor = MemoryMarshal.Cast<float, Vector3>(material.EmissiveFactor ?? new[] { 0f, 0f, 0f })[0] * emissiveStrength;
11121117
var clearcoatFactor = clearcoat?.ClearcoatFactor ?? 0;
11131118
var clearcoatRoughnessFactor = clearcoat?.ClearcoatRoughnessFactor ?? 0;
11141119
var clearcoatNormalScale = clearcoat?.ClearcoatNormalTexture?.Scale ?? 1;
@@ -1445,6 +1450,12 @@ public class KHR_materials_clearcoat
14451450
public MaterialNormalTextureInfo ClearcoatNormalTexture { get; set; }
14461451
}
14471452

1453+
public class KHR_materials_emissive_strength
1454+
{
1455+
[DefaultValue(1)]
1456+
public float EmissiveStrength { get; set; }
1457+
}
1458+
14481459
/// <summary>
14491460
/// This method is part of the animation handling. Gets the parent that will be animated, for finding a bogie for wheels.
14501461
/// </summary>

0 commit comments

Comments
 (0)