Skip to content

Commit

Permalink
Headlight bound to Camera LookDirection (#10466)
Browse files Browse the repository at this point in the history
* LibG Binaries Update (#10295)

* "LibG/ASM224,7418555f"

* "LibG/ASM224.4,918b3d73"

* "LibG/ASM225,2b68d3dd"

* "LibG/ASM226,2b308956"

* Change mechanism to retreive the certificate from assembly (#10301)

* DYN-2225 - Marshaling Performance optimization - Heap Cleanup (#10026)

* fast path for zero size heap allocation

* Cache mechanism for marshalling lookups

* Do not allocate heap stack values for class properties for CLR objects

* Test removing getter heap interaction for CLR object

* Remove unused Heap Object set

* make variables non-static

* remove GetterFunctionPointer class

Co-authored-by: aparajit-pratap <aparajit.pratap@autodesk.com>

* DYN-2289: Fix crash with NodeToCode (#10305)

* search for property by getter if not found

* add test

* Geometry Color Tests More (#10291)

* Add geometry color check for Display_ByGeometryColor_HasColoredMesh

Add geometry color check for Display_ByGeometryColor_HasColoredMesh

* Test updates

* Add Geometry Transparency Test

* Update test name

* update newly added test (#10313)

* DYN-2286: fix for crash upon unresolved node undo (#10315)

* fix for crash upon unresolved node undo

* override Equals in PortModel

* add recorded test

* DYN-2328 Add test for geometry labeling (#10311)

* DYN-2328 Add test for geometry lablling

* DYN-2328 Add test for geometry labeling

* Removing extra assignments

* updating the test and the test dyn file.

* Removing the extra variable that is not being used

* First Github Action (#10131)

This Github Action will greet Github users who submit a PR or issue first time to our repo

* Removal of PR trigger for now (#10323)

* Analytics Agreement Workflow Update (#10314)

* Initial Commit to Update Analytics Agreement Workflow

* update

* Add unit test for deserializing analytics setting

* Update instrumentation default agreement setting in unit test

* Add more comments

* Add missing resource string (#10329)

* LibG Binaries Update (#10331)

* "LibG/ASM224,7418555f"

* "LibG/ASM224.4,918b3d73"

* "LibG/ASM225,2b68d3dd"

* "LibG/ASM226,5c8f1fdd"

* Fix the library view display issues introduced by MS WebBrowser (#10316)

* Disable the context menu on the library viewer.

* Zoom the libarary view to adapt the current DPI scale.

* Disable the horizontal scroll bar on the bottom of the library view.

* Disable the library view is zoomed by keyboard or mouse wheel.

* Zoom the library bar to adapt the current DPI scale.

* Hide the extra search text bar close button.

* [DYN-2382] LibraryViewExtensionMSWebBrowser does not scale correctly when using display scaling (#10335)

* Disable the context menu on the library viewer.

* Zoom the libarary view to adapt the current DPI scale.

* Disable the horizontal scroll bar on the bottom of the library view.

* Disable the library view is zoomed by keyboard or mouse wheel.

* Zoom the library bar to adapt the current DPI scale.

* Hide the extra search text bar close button.

* Unsubscribing the event handler in dispose method

* working color change on selection for points.

* Skip GA Client Tear Down Process if NOT Necessary (#10340)

* Skip Analytics Client Tear down if it is not needed

* Add unit test covering analytics tear down

* Touch test naming

* [Analytics] Update Tracking Conditions (#10345)

* Update Tracking Conditions

* Add same check to ReportingUsage

* Add properties comments

* PR comment (#10347)

* Code improvements: (#10348)

1. Unsubscribe DpiChanged event handler in the browser Dispose method.
2. Move the overflow-x style setting from script to html to avoid to set it when the script method is called every time.
3. Add necessary comments.

* lots of cleanup work to do but this works
isolate correctly sets all geo to low alpha, and the selected geo sets back to whatever other state it was in without isolate.

* start adding morecolor tests

* fix test

* add more tests
add cleanup to color cache

* fix watch3d background color converter
fix watch3d background color test
fix watch3d image export function

* need to move branches - saving work

* give up on image comparison tests, will file that as followup, resize function in helix does not work.

* break out some util methods
need to rerun tests

* review comments
all tests pass

* review comment

* add show line numbers when watermarkLabel is collapsed (#10362)

* Visual Identifier on Optional Inputs (#10361)

* change port text to italic if using default input

* Update Ports.xaml

* Update README.md (#10387)

* Update README.md

* Update README.md

* Update README.md

* Update DynamoVisualProgramming.Core.nuspec

* Update DynamoVisualProgramming.Core.nuspec

* GA client not launching when terms not agreed (#10407)

* GA client not launching when terms not agreed

* Comments

* Patch 283 (#10421)

* Add WinVerityTrust wrapper

* Utilzie new WinTrustWrapper method for cert verification

* Add negative test

* Add Package with faked certificate

* Create sub namespace for WinVerityInteropp

* Update the WinTrustInterop

* Upate method call name

* Add specific exceptions to the CertificateVerfication class

* formating

* fix summary

* Cover Test for Configuration Folder (#10444)

* Cover Test for Configuration Folder

* Update DynamoCoreTests.csproj

* Added a couple of asserts for the properties. (#10437)

* Add Test for Properties and removed getter and setter from WorkspaceDependencyViewExtension.DependencyView property.

* Update WorkspaceDependencyViewExtension.cs

* this is working to link 2 simple shaders - they are just for testing though. (vertex shaders with lighting)
embed testing shaders
add technique that uses our 2 shaders
add core and node classes for dynamo mesh which will set data on shader based on attached properties.

* Fix for crash while drawing Point manipulator (gizmo) when LibG fails to load (#10148)

* fix for crash in DM when LibG fails to load

* return from recursive loop once we find the first non-null point

* cache enabled flag for manipulator

* more fixes

* add documentation

* add documentation

* update shader names
add handle mesh method to attached properties replacing all the material setting
add code for setting bit flags and setting data on struct that actually makes it to shader
add helix shader structs and functions that we need to compile our shaders
add readme

* fix broken tests dude to bad merge conflict fix

* remove commented out vertex shader code

* fix bug in shader
fix comment and some todos

* remove
tested transofmrable interface

* update comments

* fix binding
add test

* flip normal if back facing tri
update shader

* make sure compiled shader up to date.

Co-authored-by: DynamoEngOps <dynamo.engops@autodesk.com>
Co-authored-by: Craig Long <craig.alan.long@gmail.com>
Co-authored-by: aparajit-pratap <aparajit.pratap@autodesk.com>
Co-authored-by: Aaron (Qilong) <173288704@qq.com>
Co-authored-by: reddyashish <43763136+reddyashish@users.noreply.github.com>
Co-authored-by: StarLee <42235642+CoolStarLee@users.noreply.github.com>
Co-authored-by: Sylvester Knudsen <sylvesterknudsen@gmail.com>
  • Loading branch information
8 people authored Mar 19, 2020
1 parent 65612e0 commit fe42f38
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/DynamoCoreWpf/ViewModels/Watch3D/HelixWatch3DViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1285,12 +1285,10 @@ private void InitializeHelix()
Name = HeadLightName
};

//TODO verify this binding is working.
headLight.SetBinding(
DirectionalLight3D.DirectionProperty,
new Binding("LookDirection") {
Source = this,
Path = new PropertyPath("Camera.LookDirection")
new Binding(nameof(PerspectiveCamera.LookDirection)) {
Source = this.Camera
}
);

Expand Down
Binary file modified src/DynamoCoreWpf/ViewModels/Watch3D/compiledShaders/psDynamoMesh
Binary file not shown.
Binary file modified src/DynamoCoreWpf/ViewModels/Watch3D/compiledShaders/vsDynamoMesh
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ SamplerState LinearSampler
MaxAnisotropy = 16;
};

float4 main(PSInputCustom input) : SV_Target
float4 main(PSInputCustom input, bool isFrontFacing : SV_IsFrontFace) : SV_Target
{
//TODO move to common or pass in from material or the vParams.
float4 vSelectionColor = float4(0.0, 0.62, 1.0, 1.0);
Expand Down Expand Up @@ -61,6 +61,15 @@ float4 main(PSInputCustom input) : SV_Target
// get per pixel vector to eye-position
float3 eye = normalize(vEyePos - input.wp.xyz);

// To support two-sided surface lighting, we flip
// the normal of the surface if it's facing
// away from us. There are many tessellated surfaces that have
// normals that are not as expected.
// SV_IsFrontFace is a system value (GPU sets this for us) you can read about here:
//https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-semantics
input.n = isFrontFacing ? input.n : -input.n;


//we need to support diffuse masps for nodes like Display.BySurfaceColors which use diffuse maps
//instead of vertex colors.
if (bHasDiffuseMap)
Expand Down
17 changes: 17 additions & 0 deletions src/VisualizationTests/HelixWatch3DViewModelTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,23 @@ public void Watch3D_Disconnect_Reconnect_CorrectRenderings()
Assert.AreEqual(5, ((HelixWatch3DViewModel)view.DataContext).Element3DDictionary.Count());
}

[Test]
public void HelixWatch3dViewModel_HeadLight_Camera_HaveSameLookVector()
{
var bPreviewVm = ViewModel.BackgroundPreviewViewModel as HelixWatch3DViewModel;
var camdir = bPreviewVm.Camera.LookDirection;
var headlight = bPreviewVm.SceneItems.Where(x => x.Name.ToLower().Contains("headlight")).FirstOrDefault();
var headlightDir = (headlight as DirectionalLight3D).Direction;
Assert.AreEqual(camdir, headlightDir);

//move the camera
bPreviewVm.Camera.LookDirection = new Vector3D(5,5,5);
//assert they match
headlightDir = (headlight as DirectionalLight3D).Direction;
Assert.AreEqual(new Vector3D(5, 5, 5), headlightDir);

}

[Test]
public void HelixWatch3DViewModel_DisableGrid_GridDoesNotDraw()
{
Expand Down

0 comments on commit fe42f38

Please sign in to comment.