-
Notifications
You must be signed in to change notification settings - Fork 0
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
work in progress for review #2
work in progress for review #2
Conversation
update shaders use the blendFactor prop on pointGeometry to pack our data material classes are not used
src/DynamoCoreWpf/ViewModels/Watch3D/shaderSource/vsDynamoPointLine.hlsl
Show resolved
Hide resolved
/// <summary> | ||
/// Is this model Frozen. | ||
/// </summary> | ||
public bool IsFrozenData { get { return isFrozenData; } internal set { SetAffectsRender(ref isFrozenData, value); } } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there something special about doing SetAffectsRender
? I've seen Set
used in some places and another Set
something method in helix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that you didn't have to override OnUpdateModelStruct
; I remember you mentioned it doesn't get called anyway. Secondly, I'm still a little confused why you didn't need to add the geometry shader to the shader passes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OnUpdateModelStruct
now gets called since the pipeline is setup correctly, unfortunately the point model struct is very small and doesn't have anywhere we can stick our extra data.
it's only 2 bools and a matrix that we need to do the projection - so I just used a value that is set to the PointLine constant buffer, I don't know how to update this otherwise, but it looks like it is somehow hooked into the default material inside the helix implementation ,but fortunately we can access it from the geometryModel object directly, so no need to hook into the render events etc.
I still really want to know how to add arbitrary data instead of reusing these unused variables, hopefully we can get more info from the helix maintainers for the future...
This is brilliant btw! 🚀 |
I think all we need to do to get the points rendering as circles is to add:
to your pixel shader. pfParams[2] or pfParams.z are the same thing and contain the figure type. |
So we need to set On a side note I was curious whether replacing our current implementation of coloring points and lines with shaders (or blending) was even worth doing. I noticed that even with a million points, the current implementation sets their colors almost instantaneously with selection and isolation turned on and off very quickly. I didn't test this with lines though. Maybe the slowness that DYN-2702 refers to is seen with lines? |
On my machine I notice this mostly when drag selecting over the nodes. It's painfully slow, maybe this is a parallels thing? Or just a slow machine thing? (my machine is a few years old) lines will be at least twice as slow as points, as each line contains more than 1 point and each needs to have its vertex color updated separately. I think the worst case scenario to test is to try this with points and lines that are using vertex colors ie - those drawn using Display.ByGeometryColor node. |
@aparajit-pratap giving a shot at a refactor here, lets try to catch up tomorrow. |
@mjkkirschner will these changes affect the performance of |
I think a few subtleties are being confused. We could make even more optimizations as you say, to all shaders to use the first vertex color to display as ALL vertex colors, this would let us only send a single color and have the GPU do the rest for us - but we would need to set it into a buffer somewhere, it would not make sense to have each vertex refer to the first vertex in the shader. This would not work well for custom drawn meshes where users override Thats not something I'm looking into at the moment as I think it's an optimization not a major performance issue. In my mind the biggest issue is the whole requestResetColor event and the fact that is exists at all. |
find same buffer slot for lines and points yay refactor shared data core update tests
@aparajit-pratap - if you have a chance tomorrow I'd like to go over my changes here with you to get your feedback. summary is as follow:
I think all thats left here is implementing the line shader and hooking it up with the correct name. |
/// <param name="state"></param> | ||
internal void SetState(int state) | ||
{ | ||
//TODO should we also use this for points if it works for lines to make them consistent? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this TODO is out of date, already did this.
internal void SetPropertyData(DependencyPropertyChangedEventArgs args, GeometryModel3D geo) | ||
{ | ||
this.dataCore.SetPropertyData(args); | ||
//re reuse blending factor because our shader does not use it and we need space for an int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment is out of date, will remove it.
internal void SetState(int state) | ||
{ | ||
//TODO should we also use this for points if it works for lines to make them consistent? | ||
this.material.FadingNearDistance = state; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you replace this for blendingfactor
as it is common to both point and line and because blendingfactor
is missing for line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep yep.
@@ -13,6 +13,17 @@ protected override SceneNode OnCreateSceneNode() | |||
{ | |||
return new DynamoLineNode(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we have to set { Material = material; }
in the constructor of DynamoLineNode
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, will fix that, thanks for catching it.
@mjkkirschner I think this looks good. Thanks for the hard work on it to bring it to some final shape. It would be interesting to see if there are any perceivable performance improvements in selection/frozen etc. state changes on point as lines as the current performance still doesn't seem all that bad to me. The following is from the build we used for the helix bug bash. The graph has about 50,000 points and 810,000 lines: |
Don't we also have to set pfParams[2] to 1 in CommonBuffers.hlsl for the |
no, pfParams is set by the default point material based on the height, width, figure, and figure ratio properties that the PointGeometryModel have been set to. and we already set the pointFigure to circle when we create DynamoPointGeometryModels |
Ellipse is |
* Initial Commit * Add hosts selections * Add the multi selection * Multiple Host Selection Display * Correct Host Dependencies in Json for publishing and download * Code Clean up * More Cleanup and Comments * Bug fixing - publish version * Workaround to enable publishing from sandbox * Update PublishPackageView.xaml * Updates UI * Adds new resources * Updates UI * Adds new close button icons * Updates UI. Add Markdown selection functionality. * Update AssemblySharedInfo.cs * Adding remaining functionality to publish package view * Updates method names * Update PublishPackageView.xaml * Update PublishPackageView.xaml.cs * Adds ToolTip + Info Icon to Markdown Directory label * Fixes regressions * Responds to comments * Cherry-picks edits from PR DynamoDS#12171 * Undoes whitespace changes * Removes duplicate resources Co-authored-by: tanga <aaron.tang@autodesk.com>
* Python editor visual restyle - initial commit - initial commit for python editor visual restyle - for general idea of the desired scope, visit https://www.figma.com/file/1q7EWQGYO7pPDhyLf8nuwW/Python-node-editor-restyling?node-id=0%3A1&t=QGCSTKllX8Q7OnhK-0 * Icon Update - updated python scrip editor icons * Hover icon update - minor update for one of the icons * Change hyperlink color - due to readability issues, changed the hyperlink text color * Text Folding - first implementation working * Custom indentation strategy added - added custom Python indentation strategy based around line ending with a column * TabFoldingStrategy changes, saves on Esc exist, WIP - WIP code, still playing with the avalon editor visual capabilities - Implemented the 'save on exit' (still missing prompt) - Folding strategy works more or less correctly, except we are not tracking folded states (which we can) - more work needed, but should we? * Undo/Redo, Zoom-in/out buttons added - added buttons for the undo/redo and zoom-in/out functionalities * Keywords color update - updated keywords as per latest Figma color scheme * Warning bar on unsaved changes exit added - added a warning message with controls when user tries to exit the Script interface by pressing the Escape button, but has unsaved changes - made Avalon edit support classes Internal * Fix tab folding - now will correctly continue after ":" not being the end of the text line (no tabbing) * Small icons test - testing screen resolution against 24x24 icons * Back to 48x48 icons - updated icons back to 48x48px * Disable UI when prompt to save changes - will disable any user interaction while in 'warning' mode - forces the user to `keep editing` -> `save` -> `close` * Color brushes replaced with Dynamo brushes where possible - re[placed with dynamo library brushes where possible * Localized unsaved changes prompt texts - unsaved changes prompt title and text localized * Cleaned up tabfoldingstrategy comments - removed old or unnecessary comments - kept comments that help to clarify the logic * Update ScriptEditorWindow.xaml
…vent (DynamoDS#14007) * Create dynamoBinDiff.yml * update nuget step * add bin diff job script * add cache test * fixing cache * test * fixing cache #2 * fixing cache #3 * fixing cache DynamoDS#4 * debug * debug * debug * debug * fixed cache * cleanup step * test cleanup * final version * Update bin_diff.ps1 * remove cleanup step, because failing * add colors * Change hashing algo to SHA256 * add net6 win for bin diff * fix * only status
WIP - definitely cleanup required but this "works", as in we can pass data to the pixelshader this way and points update in response. It needs: