Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Watch3D nodes to run in software mode #14650

Merged
merged 2 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Linq;
using System.Windows;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Media.Media3D;
using System.Xml;
Expand Down Expand Up @@ -393,12 +394,14 @@ private void LogVisualizationCapabilities()
var pixelShader4Supported = RenderCapability.IsPixelShaderVersionSupported(4, 0);
var softwareEffectSupported = RenderCapability.IsShaderEffectSoftwareRenderingSupported;
var maxTextureSize = RenderCapability.MaxHardwareTextureSize;
var renderMode = RenderOptions.ProcessRenderMode;

logger.Log(string.Format("RENDER : Rendering Tier: {0}", renderingTier));
logger.LogError(string.Format("RENDER : Pixel Shader 3 Supported: {0}", pixelShader3Supported));
logger.Log(string.Format("RENDER : Pixel Shader 4 Supported: {0}", pixelShader4Supported));
logger.Log(string.Format("RENDER : Software Effect Rendering Supported: {0}", softwareEffectSupported));
logger.Log(string.Format("RENDER : Maximum hardware texture size: {0}", maxTextureSize));
logger.Log(string.Format("RENDER : ProcessRenderMode: {0}", renderMode == RenderMode.Default ? "Hardware (with Software fallback)" : "Software" ));
}

private void RegisterModelEventhandlers(IDynamoModel dynamoModel)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
Expand Down Expand Up @@ -48,9 +48,6 @@ public void CustomizeView(Watch3D model, NodeView nodeView)
var dynamoViewModel = nodeView.ViewModel.DynamoViewModel;
watch3dModel = model;

var renderingTier = (RenderCapability.Tier >> 16);
if (renderingTier < 2) return;

var dynamoModel = dynamoViewModel.Model;

var vmParams = new Watch3DViewModelStartupParams(dynamoModel);
Expand Down
8 changes: 1 addition & 7 deletions test/DynamoCoreWpfTests/NodeViewCustomizationTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
Expand Down Expand Up @@ -51,12 +51,6 @@ public void Watch3DHasViewer()
var path = Environment.GetEnvironmentVariable("Path", EnvironmentVariableTarget.Process) + ";" + Model.PathManager.DynamoCoreDirectory;
Environment.SetEnvironmentVariable("Path", path, EnvironmentVariableTarget.Process);

var renderingTier = (System.Windows.Media.RenderCapability.Tier >> 16);
if (renderingTier < 2)
{
Assert.Inconclusive("Hardware rendering is not available. Watch3D is not created.");
}

Open(@"UI\CoreUINodes.dyn");
var nodeView = NodeViewWithGuid("6869c998-b819-4686-8849-6f36162c4182"); // NodeViewOf<Watch3D>();
var watchView = nodeView.ChildrenOfType<Watch3DView>().FirstOrDefault();
Expand Down
Loading