Model Boolean operations, improved camera control and many other new features in new major version of Ab3d.PowerToys

by abenedik 4. August 2017 20:41

I am happy to announce that a major new version of Ab3d.PowerToys and a new version of Ab3d.DXEngine have been released today. 

This is by far the biggest update in the history of Ab3d.PowerToys library. It brings many great new features and improvements. The following are some of the main new features:

  • added support to rotate camera around selected 3D position (or around 3D position behind mouse cursor),
  • added zoom to mouse position or custom 3D position,
  • added support for controlling camera with 3D mouse (from 3dconnexion) or game controller,
  • added slice tool to cut 3D models with a plane,
  • added Boolean operations for 3D models,
  • added support for keyframe camera and object animations,
  • added TextBlockVisual3D to easily show text with border on a 3D plane,
  • added support for showing object edge lines instead of triangle wireframe.

 

Let’s describe those features with more details and with some screenshots.

The following image shows a screenshot from a sample that demonstrates camera rotation around custom position:

 

In the previous version of Ab3d.PowerToys it was only possible to rotate around the Viewport3D’s center position. Zooming in and out was also possible only to the center position. With the new version it is very easy to specify custom rotation and zooming position. It is also possible to rotate around or zoom into the position under the mouse cursor. As you can see from the image, it is also possible to show a marker that shows around which position the cameras is rotated. This marker can be fully customized.

Good camera control is at the heart of a good user experience. And to make the camera control great for even the most demanding users, it is now possible to add support for 3D mouse from 3DConnexion. This allows experienced users to be much more productive and to control the camera in the best possible way.

Ab3d.PowerToys now includes two new very powerful utilities to manipulate 3D models.

The first new utility allows slicing 3D models into 2 parts with specifying a custom slice plane. The following image shows a simple robot arm model that was sliced with this tool:

 

Another utility allows creating 3D models with using Boolean operations on 3D models. The following screenshot shows the available operations and their results:

 

The next screenshot shows two sample models created with subtracting various models from a box model:

 

The right object also shows texture on a 3D model. The texture coordinates for that model were calculated with new texture generation algorithms – in this sample a cubic projection was used.

The previous image also shows another new feature of the new library – showing text with border on a 3D plane model. For example the “Subtract” text was created with the following XAML:

<visuals:TextBlockVisual3D Position="-150 -45 100" PositionType="Center"
                           Text="Subtract" Foreground="Yellow" Background="Black" 
                           BorderBrush="White" BorderThickness="1" TextPadding="5 3"
                           Size="80 30" UpDirection="0 0.3 -1"/>

Showing 3D text is now really very easy. The TextBlockVisual3D object provides many options to customize the look of the text and the border. The following image shows a screenshot from a sample that shows usage of many of the TextBlockVisual3D properties: 

 

The new version also adds great support for camera and model animations. This allows creating nice camera transitions from one view to another.

To improve support for CAD like applications, the new version adds support for showing object edge lines. When object wireframe was shown in previous version, it always showed 3D lines for the triangles that define the 3D models. In the new version it is possible to show only 3D lines on the edges of objects. This shows a much better representation of the object to the user. Edge lines support is added to all standard 3D models from the library and also to ReaderObj and Assimp library so the imported 3D models can be also shown with edge lines (if the 3D file format support polygons and not only triangles). The following image shows standard 3D models with edge lines:

 

The samples project has also been improved. It has many very interesting new samples. For example one shows how to create billboards – rectangles with text or images that are always oriented towards the camera. The other shows how to select 3D lines with moving the mouse close to the line (not onto the lines which can be problematic in case of thin lines). 

Also note the NEW and UP icons in the list of samples for new and updated samples. To get a better understanding of the sample, check the sample description and comments in code behind.

There are also many other new features, improvement and bug fixes. For a full list of changes see the version history web page.

 

Some of the new features of Ab3d.PowerToys also require an updated Ab3d.DXEngine. If you want to get full hardware accelerated rendering of edge lines, then you need a new version of Ab3d.DXEngine. 

The new version can also improve sharpness of rendered 3D scene with setting UseLayoutRounding property on DXViewportView to true. This should prevent putting the rendered image to sub-pixel boundaries.

Another change in the new version Ab3d.DXEngine is that it now uses the latest version of SharpDX library – version 4.0.1. This also means that you will need to update the references to SharpDX. You can use the one from NuGet or the dll-s that are supplied with Ab3d.DXEngine. In case you used version 2.6.3 before, you will also need to add reference to SharpDX.Mathematics assembly.

 

I really hope that the versions of the libraries will serve you well and allow you to easily add great new features to your applications that will amaze your customers.

Tags: , , , ,

Ab3d.PowerToys | DXEngine

Great new features available with new version of Ab3d.DXEngine

by abenedik 23. February 2017 21:45

A new version of Ab3d.DXEngine library has been published.

Again, I am very excited about the new features in the engine. Just check the images below and you will see that the new Ab3d.DXEngine allows you to create some amazing effects in 3D graphics.

Let's start with added support for rendering 3D models that can have different colors in each vertex (position).

The following screenshot shows a new "heat distribution map" sample:

In the bottom center part of the screenshot you can see two red rays that connect over the 3D model. The position where the rays are connected is used to calculate the 3D position on the teapot - this position is used as ray hit position. Then, for each position in the teapot model, the distance from the position to the ray hit position is calculated. The calculated distance is then converted into specific color that shows the amount of heat (red is hot and blue is cold). This way we get different color values for each positon of the teapot.

After we have the colors for positions, we can use the new VerextColorMaterial to render the 3D model.

This is very useful for showing scientific data on 3D models.

 

Another use of this technique is to render height map with different colors. The color at each height map position is based on the height of the position. To demonstrate that, there is a new "landscape generation" sample:

This sample is also showing how to use Diamond square algorithm (https://en.wikipedia.org/wiki/Diamond-square_algorithm) to generate realistic height maps. This algorithm starts with a few positions and then iteratively adds additional details to the map. To show how this process works, the sample can animate the size of the map from 3x3 to the map with much higher resolution (1025 x 1025 or higher).

Additionally, as you see in the lower right corner, the sample shows a nice legend with linear gradient. The control that shows the legend is also part of the sample and can be easily customized and reused in your own project.

 

If you are using Ab3d.DXEngine to create a CAD like application, you will be happy to hear that the new version allows rendering hidden 3D lines with special line color and line thickness. Hidden 3D lines are lines that are behind other 3D objects - thin yellow line in the following screenshot:

The previous version of Ab3d.DXEngine already supported rendering 3D lines that were visible though 3D objects, but you could not change the appearance of the hidden part of the line. The new version allows using new HiddenLineMaterial that renders only the hidden part of the line (part that is behind other 3D objects) and that allows specifying different color and line thickness for that hidden part.

Another improvement regarding rendered 3D lines is that the new version now automatically renders thin connected 3D lines (PolyLineVisual3D, LineArcVisual3D, TextVisual3D and other lines where line thickness is less or equal then 3) as disconnected 3D lines. This allows full hardware acceleration of connected 3D lines (rendering millions of connected 3D lines instead of thousands).

Connected 3D lines are 3D lines where the end point of one line is the start point of the next line and where the connection between the two lines is "smoothed". In Ab3d.PowerToys library the connected 3D lines are created with the following objects: PolyLineVisual3D, LineArcVisual3D, RectangleVisual3D, MultiPolyLineVisual3D, TextVisual3D, LineWithTextVisual3D, CenteredTextVisual3D. The problem with connected 3D lines is that additional triangle needs to be added to create the smooth connection between the lines. This is quite complicated operation and is not supported in DXEngine's geometry shader that creates 3D lines.

But when the LineThickness is small, then the additional triangle between connected lines is very small and hardly noticeable - in this case the connected lines can be rendered as disconnected 3D lines - without additional triangle to smooth the connection between lines. When the lines are rendered as disconnected lines, the geometry for the lines can be generated in geometry shader and this allows rendering millions of lines.

In the previous version of DXEngine, it was possible to set the RenderConnectedLinesAsDisconnected property on DXScene to true to render all connected lines as disconnected. In the new version it is possible to fine tune that with specifying the LineThickness limit that will define which connected 3D lines will be rendered as disconnected lines - this is done with new RenderConnectedLinesAsDisconnectedLinesThicknessLimit property (by default it is set to 3).

The following screenshot from an updated ConnectedLinesRendering sample shows fully accelerated 3D lines shown in red:

The thick lines (black lines with LineThickness 10 and 20) are still rendered the old way - the geometry for the 3D lines is generated by the code in the Ab3d.PowerToys library. There the smooth connections between line segments is easily seen. On the other hand, the thin lines (red lines with LineThickness 1 and 3) can be safely rendered without smooth connections and can be therefore fully hardware accelerated.

To get better understanding of this please check the ConnectedLinesRendering sample - there you can dynamically adjust the RenderConnectedLinesAsDisconnectedLinesThicknessLimit with a slider and see the results.

3D lines got another improvement - now the actual LineThickness that is used to render the 3D lines also takes the monitor DPI settings into account - 3D line on high DPI monitor will be actually rendered thicker so that for the user they will look the same as on the monitor with standard DPI (96).

 

If you have checked the DXEngine forum, then you know that there is now support for rendering many pixels. The number of pixels that can be rendered by modern graphics card is really amazing. The following screenshot from DXEngine samples is showing 100 million (!) pixels:

Each of the cubes in the screenshot is actually created from 1 million pixels (100 x 100 x 100 pixels). To see interesting patterns (instead of solid red color), each pixel's size is only 0.1.

The easiest way to show many pixels is to use new PixelsVisual3D object. After creating the object, you only need to set the color of the pixels, size of the pixels and an array with pixel locations. There are also other ways to render pixels - see PixelRenderingSample sample for more info.

 

The new version also improves showing VisualBrushes, DrawingImages and other textures that need to be rendered into bitmap to be shown with DXEngine.

In the previous versions, the size of the rendered bitmap was determined by the DXEngine. It was possible to change that by changing the RenderedBrushTextureWidth and RenderedBrushTextureHeight properties on the WpfMaterial object. But this was not very user friendly.

The new version greatly improves that and provides an easy way to set the desired size of rendered bitmap with using the CachedBitmapSize DXAttribute. The following example will set render size to 512 x 512 for the BigPlane's Material:

BigPlane.Material.SetDXAttribute(DXAttributeType.CachedBitmapSize, new SharpDX.Size2(512, 512));

An improved VisualBrush sample shows that in more details. It also demonstrates how to dynamically adjust the rendered bitmap size based on the distance from the camera - so objects that are closer to the camera gets higher resolution rendering (to make text better readable) and objects that are far from the camera can use smaller bitmaps (to save memory).

 

The new version also provides a few improvements for rendering many instances of objects. The first improvement related to this is a new UseAlphaBlend property on InstancedMeshGeometry3DNode - when it is set to true, the InstancedMeshGeometry3DNode will use alpha blending which will allow rendering semi-transparent instances - the actual alpha level is specified with the color that can be set for each instance.

InstancedMeshGeometry3DNode object also get a fix for using IsBackFaceMaterial property which makes rendering back faces of the instances correct. Also, InstancedModelGroupVisual3D now support rendering GeometryModel3D objects that have BackMaterial set.

 

There are also a few other improvements and fixes. The full list of changes is here:

  • Added VertexColorEffect and VertexColorMaterial - this adds support for rendering 3D objects with specifying color for each vertex (position).
  • Added PixelEffect, PixelMaterial and PixelsVisual3D - allows rendering millions of 3D pixels.
  • Added HiddenLineMaterial that can render 3D lines that are behind other 3D objects (should be hidden).
  • Added RenderConnectedLinesAsDisconnectedLinesThicknessLimit property to DXScene and set its default value to 3. This will render connected 3D lines (PolyLines, LineArc, Text3D, ect.) as disconnected 3D lines and therefore provide full hardware acceleration of 3D lines when LineThickness is less or equal then 3.
  • Added scaling LineThickness and PixelSize with current DPI scaling factor.
  • Fixed WpfMaterial.Refresh method to update VisualBrush.
  • Added CachedBitmapSize to DXAttributeType - this simplify setting the size of the rendered bitmap with calling SetDXAttribute extension method on WPF's material (instead of using RenderedBrushTextureWidth and RenderedBrushTextureHeight on WpfMaterial).
  • Added RenderToBitmapOnEveryFrame property to WpfMaterial - this instructs DXEngine to render the WPF material into bitmap before each frame is rendered.
  • Improved using RenderedBrushTextureWidth and RenderedBrushTextureHeight on WpfMaterial object for rendering materials with DrawingImage.
  • Fixed using IsBackFaceMaterial property in InstancedMeshGeometry3DNode.
  • Added rendering BackMaterial for GeometryModel3D objects rendered with InstancedModelGroupVisual3D.
  • Added UseAlphaBlend property to InstancedMeshGeometry3DNode and added support for rendering semi-transparent objects in InstancedModelGroupVisual3D.
  • Added "Get camera info" action to DiagnosticsWindow (and to DXEngineSnoop) to get detailed information about the camera that is currently used.
  • Added a new overload of WpfMaterial.SetUsedDXMaterial method that does not take parentDXDevice as parameter (the existing method that takes parentDXDevice is marked as Obsolete).
  • Fixed problems with showing and updating the 3D Scene that could sometimes occur on monitors with high DPI settings and with high UI thread usage before the first frame is rendered.
  • Added protected virtual Dispose method to SceneNodeVisual3D so that derived classes can dispose their resources in the overridden Dispose method.
  • Added IsDisposing to SharedDXResource (base class to most of the classes in DXEngine).

Tags: , , ,

DXEngine

Maintenance update of Ab2d.ReaderSvg published

by abenedik 24. January 2017 10:09

I would like to inform you that a new maintenance update of Ab2d.ReaderSvg has been published.

The new version adds the following new properties to the ReaderSvg object: IsCorrectingNamesForWpf, MakeNamesUnique and GetCustomSvgElementNameCallback.

They can be used to better control how the names defined in svg file are used on the WPF objects. Before ReaderSvg always corrected the names when they did not fit into WPF’s naming schema. It also made the name unique by adding indexes after duplicated names. But now it is possible to preserve the names as they are in the svg file.

What is more, user now have full control on defining the name with using a custom callback that can be assigned to the new GetCustomSvgElementNameCallback property.

The new version also fixes a rare problem that could occur when an unknow transformation type is defined in svg file.

Also, some users reported that Visual Studio analyzer could in some cases report CA0055 and CA0052 errors when using Ab2d.ReaderSvg library. This has been fixed.

 

The new release also brings a new sample to ZoomPanel project that shows how easy is to use ZoomPanen in WinForms application.

Tags:

ReaderSvg | ZoomPanel

New Oculus Rift support with updated OculusWrap project and full DXEngine support

by abenedik 6. January 2017 00:03

Let's start with a screenshot:

Ab3d.DXEngine rendering for Oculus Rift

This screenshot shows you that the Ab3d.DXEngine now fully supports Oculus Rift. And as you can see from the the window title and Oculus Performance overlay it has no problems with rendering at 90 FPS and still having plently of performance headroom.

What is more, because there were no up-to-date wrapper library for Oculus SKD available (the newest was OculusWrap, but it was discontinued on April 2016), I have decided to update the OculusWrap library to support the latest Oculus SDK (1.10.2) and published the updated library to GitHub to https://github.com/ab4d/Ab3d.OculusWrap.

The previous two paragraphs mean two things:

1) If you would like to use Oculus Rift in .Net and would like a low level access to the native Oculus library, you can do that now with the updated Ab3d.OculusWrap library.

2) If you want to stay in the comfort of using WPF 3D, Ab3d.PowerToys and Ab3d.DXEngine libraries and would like to add Oculus Rift support, you can now do that with adding just a few lines of code.

 

So if you have an Oculus Rift headset, you are most welcome to go to the above GitHub address and enter the VR world generated by .Net code.

Tags: , , , ,

Ab3d.PowerToys | DXEngine

Major new version of DXEngine (DirectX 11 rendering engine) bring many new features including shadow rendering

by abenedik 30. November 2016 22:40

I am really happy to inform you that after many hours of coding that resulted in tons of new features and improvements a major new version of Ab3d.DXEngine is released. Ab3d.DXEngine is a super fast 3D rendering engine that uses DirectX 11 and SharpDX and can be used in .Net Desktop applications.

The biggest new feature is support for shadow rendering. Ab3d.DXEngine uses variance shadow mapping technique that can produce nice soft shadow with little artifacts (based on the article in GPU Gems). The following screenshot shows an example taken from samples that come with the library:

In the lower right corner of the screenshot you can see various shadow settings that allow easy control over shadow resolution and amount of softness.

Another great improvement is a new option that allow rendering 3D lines that are visible through solid objects. This is a great feature for showing selected 3D objects.

The new version also improves handling frozen WPF 3D objects – for example frozen DiffuseMaterial or MeshGeometry3D. Before frozen objects were not very well reused by DXEngine. The new version handles this much better and this can improve initialization time, memory usage and rendering performance.

Ab3d.DXEngine is using SharpDX library for providing access to native DirectX API. The previous version of Ab3d.DXEngine used SharpDX version 2.6.3. The reason for this was that version 2.6.3 was the latest version that supported .Net 4.0 framework. Later version of SharpDX require .Net 4.5. Because Ab3d.DXEngine comes with build for both .Net 4.0 and .Net 4.5, it was possible to update the .Net 4.5 version so that it now uses the latest SharpDX version 3.1.0. The build for .Net 4.0 still uses SharpDX 2.6.3 - here a slightly updated version is used that supports feature level 11.1 (before 11.0 was supported).

This release also comes with a new diagnostics tool that is called DXEngineSnoop. As the name suggests, the tool can “snoop” (from WPF Snoop) into a running WPF application, finds the DXViewportView and attaches to its events and then provides live diagnostics and performance data. The tool also allows starting many actions that show various details about the rendering process – for example hierarchical view of SceneNodes.

The following screenshot shows the DXEngineSnoop window after it has been attached to a running DXEngine (right side shows context menu that is opened when user click on the menu icon):

This tool can help improve understanding of how Ab3d.DXEngine works behind the scene.

I will write more about that in one of the future articles. Now I can just quickly describe the process: first the DXViewportView converts all the WPF 3D models that are defined in Viewport3D into different SceneNodes. The hierarchical organization of SceneNodes can be seen with clicking on “Dump SceneNodes”. The SceneNodes than create low level objects that are put into various Rendering Queues (for example transparent objects are put into “Transparent RenderingQueue”). Those two steps are done in the Update part of the rendering (on the left side seen as UpdateTime). Then rendering of objects in Rendering Queues begin. The operations that happen there are defined in the RenderingSteps collection (can be seen with clicking on “Dump RenderingSteps”). Those steps can change when different rendering modes are used – for example shadow rendering require some additional rendering steps that render shadow map; stereoscopic rendering require a simple loop that repeats some rendering steps for left and for right eye. RenderingSteps collection is fully customizable and provides a great extensibility point for many engine customizations.

DXEngineSnoop can be also used to diagnose memory issues with providing simple way to start tracking object creation and to easily show reports of live objects. There is also a new section in the DXEngine help file that describes how to check for memory leaks.

The new version also brings many stability and performance improvements.

For example, when rendering thousands of models with object instancing, it is now possible to do a faster update of data when only a few objects were changed (their color or transformation is changed). For cases when object data are changed often it is now possible to further improve performance with creating a dynamic instance buffer (with UseDynamicInstanceBuffer property).

There are also some other minor performance improvements. But the majority of work was done on improving support for customizing the engine. This means that it will be easier to add new features and extend the engine to provide additional rendering functionality.

Also, users that know how to program with SharpDX and DirectX and would like to include existing SharpDX code into the engine have now more options to do that. There are also a few new samples with extended code comments about that. If you are doing a low-level customization, I would recommend that you contact me and we can discuss the best options for your use case.

To show new functionality, there are also a few new samples. Some older samples were also improved.

What is more, the new version comes with a new WinForms project that shows three different ways how to use DXEngine to easily show great DirectX 11 graphics inside WinForms application. The following screenshot shows one of the samples:

 

I do not want to make this blog post too long. Therefore, I will not publish the huge change log here but would rather invite you to check it on the DXEngines’s web page.

Instead, I would like to conclude with a few future plans.

First, I would like to publish the sample that shows how to use DXEngine with Oculus Rift. Actually, there is already a working sample that brings full Oculus Rift support to WPF and WinForms (and without need to understand the world of DirectX). The samole just need some additional plising before being published. If you cannot wait for an official release, you can contact me and I will send you the current version.

Then I will start working on a new version of Ab3d.PowerToys. I already have many many great ideas. The main focus will be to make the library better suited for CAD like scenarios. As a result, I want to create a big sample that will be a simple CAD like application written in .Net and that will use Ab3d.PowerToys and Ab3d.DXEngine.

Tags: , , ,

DXEngine

Stereoscopic virtual reality rendering, export to Collada and obj files and many other new features available

by abenedik 1. July 2016 23:42

I am very happy that I can present you some great new features of new versions of Ab3d.PowerToys and Ab3d.DXEngine.

The greatest new features of this release are:

- Support for stereoscopic rendering for 3D TV and for red-cyan glasses,
- Ultra-quality settings with new super-sampling mode that improve render quality,
- Improved support for rendering over Remote desktop.,
- Export WPF 3D models to Collada (.dae), obj, ply and stl files (using Assimp exporter).

 

Stereoscopic rendering

Ad3d.DXEngine just got support for split-screen and anaglyph rendering. Those are the first two steps into the virtual reality world.

Split-screen rendering allows viewing the 3D scene on 3D TV screens. The following screenshot shows a simple generated 3D screen:

Split-screen virtual reality with Ab3d.DXEngine rendering

 

The virtual reality 3D effect can be also achieved with using red-cyan (or some other colors) glasses and with using the Anaglyph rendering mode:

Anaglyph virtual reality with Ab3d.DXEngine rendering

 

I also checked the requirements for NVIDIA 3D Vision. But unfortunately it requires an exclusive full screen rendering mode and does not work in maximized borderless window mode that is the only full screen mode possible by WPF. But the good news is that it looks like it will be possible to add support for Oculus Rift and Vive. So if you like virtual reality, stay tuned for the future version.

 

Super-sampling mode

DirectX usually uses multi-sampling (MSAA) that improves the quality of the edges with producing nice anti-aliased edges. Instead of using multi-sampling it is also possible to use post-processing techniques (for example FXAA or SMAA) to produce nice soft edges. But neither multi-sampling nor anti-aliasing post processing do not solve the problem where small details are can be lost when objects are rendered far away from the camera.

This problem is visible on the left side of the following screenshot:

Supersampling with DXEngine DirectX rendering

The solution to this problem is to use super-sampling – as shown on the rights side. Super-sampling solves this problem with calculating color (executing pixel shader) for each sample – this means multiple times for each pixel. This effectively gives the same results as if the image would be rendered at a bigger resolution and then scale the image down to the target resolution.

 

Remote desktop

I would also like to mention that the new version of Ab3d.DXEngine library improves support for rendering over remote desktop. Previously the 3D scene was visible through remote desktop only when DirectXOverlay PresentationType way used. But this presentation type has a serious drawback because it does not allow to mix 3D content with other 2D WPF content – for example render 2D controls on top of 3D scene. With the new version, the remote desktop works well also with DirectXImage PresentationType – this allows showing 3D scene that is mixed with other 2D controls. Note that this requires .Net target framework 4.5 or later and using the .net 4.5 build of Ab3d.DXEngine library.

Those three new features were in my opinion the best new features of this release for Ab3d.DXEngine. But as always there are more new features and fixes available. The following is the full list of all other changes:

  • Simplified setting line depth bias with SetDXAttribute(DXAttributeType.LineDepthBias, depthBias) method - this can prevent z-fighting when rendering 3D lines on top of solid objects.
  • Added Ab3d.DirectX.DXDiagnostics.CaptureNextFrame and IsCaptureFrameSupported methods to programmatically captures the next rendered frame with Visual Studio Graphics Debugging (this also allows capturing frames for DirectXImage PresentationType).
  • Added support for Visibility property on objects derived from UIElement3D .
  • Added IsMaterialSortingEnabled property to DXScene to control if sorting objects by their materials is enabled. Enabling sorting improves performance because objects with the same materials are rendered one after another (this reduces the required DirectX state changes), but when you want to have determined order of rendering you can disable the sorting.
  • Improved automatically updating WireframeVisual3D when LineThickenss or LineColor is changed.
  • Improved hardware rendering of 3D lines - depth problems could occur when long lines are crossing the near plane (one end of the line is behind the line).
  • Added Clone method to GraphicsProfile to simplify creating your custom graphic profiles that are based on default graphics profiles.
  • Added ExecutePixelShaderPerSample to DXScene and to GraphicsProfile - this allows turning multisampling into supersampling for better shader quality (used by new UltraQualityHardwareRendering).
  • Prevented throwing exception when ImageBrush uses a texture with relative Uri.
  • Fixed using EmissiveMaterial properties on materials that do not have DiffuseMaterial (under some circumstances).
  • Fixed using Opacity or alpha value for EmissiveMaterial.
  • Changed some properties and methods in RenderingContext class and in some RenderingSteps - if you are an advanced DXEngine user and use custom rendering steps, you can contact us to get a full list of changes.

 

Export 3D models to Collada, obj, ply and stl files

This release also brings many new features to the Ab3d.PowerToys library.

The most important new feature is added ability to export WPF 3D models to Collada (.dae), obj, ply and stl files. This was really a highly requested feature. It allows creation of 3D models with WPF 3D and Ab3d.PowerToys that can be exported and used in some other 3D modelling application.

The code that does the exporting is using the great open source Assimp library. 

As with Ab3d.DXEngine, this release of Ab3d.PowerToys also has quite long list of improvements and fixes – the following is the full list of changes:

  • Added support for texture coordinates generation in extruded mesh - use new ExtrudeTextureCoordinatesGenerationType.
  • Added ConeTubeVisual3D - it can be used to create Visual3D that represents a 3D Tube with different top and bottom radius.
  • Added a new constructor to TubeMesh3D that takes different inner and outer radius of top and bottom of the tube.
  • Added IsXAxisShown, IsYAxisShown and IsZAxisShown properties to ModelMoverVisual3D to allow showing only specifed arrows.
  • Added MeshUtils.GenerateCylindricalTextureCoordinates method that generates TextureCoordinates based on the Cylindrical projection.
  • Added MeshUtils.Project3DPointsTo2DPlane to project 3D positions to a 2D plane.
  • Improved EventManager3D to call MouseLeave, MouseEnter and other events when the camera is changed by MouseWheel.
  • Added UpdateHitObjects method to EventManager3D - it can be used to manually update the current 3D object behind the mouse position - this is useful when camera is changed without changing the mouse position.
  • Improved FreezeMeshGeometry3D property on BoxVisual3D and SphereVisual3D so that they do not to be set before all other properties.
  • Added ModelUtils.HasAnyLight method that checks the Viewport3D, Visual3D or Model and returns true if any light is defined (it is possible to exclude AmbientLight).
  • Changed default AssimpWpfImporter.AssimpPostProcessSteps from PostProcessSteps.FlipUVs | PostProcessSteps.GenerateSmoothNormals | PostProcessSteps.Triangulate to PostProcessSteps.Triangulate.
  • Improved automatically setting shapeYVector in an overload of CreateExtrudedMeshGeometry that does not have the shapeYVector parameter.
  • Fixed problems with ModelMoverVisual3D when it is shown inside DXEngine and AxisLength, AxisRadius or AxisArrowRadius are changed after the ModelMoverVisual3D is already shown.
  • Fixed recreating 3D lines in cases when the parent ModelVisual3D is removed from Viewport3D, then the camera is changed and the parent ModelVisual3D is added to the scene again.

 

I hope that you like the new features and stay tuned for next version. The plan is to add support for shadow mapping and great new ways to animate the camera in 3D space.

Tags: , ,

Ab3d.PowerToys | DXEngine

All AB4D libraries improved with new licensing code and many new features

by abenedik 26. April 2016 21:39

I would like to inform you that today new versions of all the AB4D products have been published.

The main reason for this release is that the evaluation and commercial licensing code that is included in all the products have been greatly improved. What is more, the deployment script that I use to prepare all release version have been improved.

Also, all the products got some additional functionality or fixed bugs. For example, the following image shows new ViewCubeCameraController from Ab3d.PowerToys library:

3D ViewCube in Ab3d.PowerToys library

The main benefits of the new licensing and deployment are:

  • All products are now also compiled for .Net 4.5 target framework. This means that all products are available for .Net 3.5, .Net 4.0 and also .Net 4.5 (an exception is Ab3d.DXEngine that does not support .Net 3.5). This will allow using new language features in the libraries – especially async and await support.
  • New evaluation and commercial licensing code is now faster and required less resources.
  • New evaluation code allows starting ad-hock evaluation on a computer that do not have the evaluation version installed. This means that you will be able to create a sample project with an evaluation version and then just copy your application to another computer. At the first start of your application you will get a dialog to start a new evaluation and then be able to continue running your application. In the previous version you needed to install evaluation version on the other computer too.
  • Improved commercial licensing code that brings new options to embed license key into your project and allows using special license key for application. This simplifies compiling projects on cloud base build servers and allows some other non-standard distributions. More details about that can be found in the new “Using commercial version” help file.

The new version also introduces new directory structure that is created after the libraries are installed. In the previous version the libraries for .Net 3.5 framework were installed into “bin” folder and libraries for .Net 4.0 framework were installed into “bin\.Net 4” folder. Now the organization is much more standard: the .Net 3.5 assemblies are in “bin\net35” folder, .Net 4.0 assemblies are in “bin\net40” folder and .Net 4.5 assemblies are in “bin\net45” folder.

This means that you might need to update your references.

The new .Net 4.5 versions of the libraries will allow using async keywords. Currently this has not yet been added to any of the libraries. But in the near future I plan to add support for async to all of the libraries. For example, async loading of 3D models or svg files. Another possibility is to create async methods to animate camera or ZoomPanel.

 

As mentioned before, this release also brings other improvements and fixes.

Ab3d.PowerToys got some great new features. The most highly anticipated feature is the ability to control the camera with 3D cube. The image with three possible cubes was shown before.

Another great addition to the library are new TubePathVisual3D and TubePathMesh3D that allows creating various tube based objects:

3D tube path in Ab3d.PowerToys library

The following is a full list of new features in Ab3d.PowerToys library

  • Added ViewCubeCameraController.
  • Added TubePathVisual3D and TubePathMesh3D.
  • Added support to create extruded MeshGeometry3D that has custom orientation (not only in the direction of Y axis). This can be achieved with using a new override of CreateExtrudedMeshGeometry that also takes shapeYVector parameter.
  • Added IsStartPositionClosed and IsEndPositionClosed properties to TubeLineVisual3D. Also added additional isStartPositionClosed and isEndPositionClosed constructor parameters to the TubeLineMesh3D.
  • Added FreezeMeshGeometry3D to BoxVisual3D and SphereVisual3D to control if the MeshGeometry3D is frozen.
  • Improved TubeVisual3D that now allows setting Height to 0 - this creates an optimized TubeVisual3D without creating both bottom and top ring - in this case only bottom ring is created.
  • Fixed using adjustmentFactor in FitIntoView method.
  • Fixed using FitIntoView when it is called in Loaded method and the Viewport3D is shown in Ab3d.DXEngine.
  • Fixed type used by ShowMovablePlanes property.
  • Improved MouseCameraController to capture the mouse only when the mouse rotation / movement is bigger than a few pixels. This prevents "swallowing" MouseUp event for processing mouse click in EventManager3D.
  • Added UsePreviewEvents property to EventManager3D – when set to true the EventManager3D subscribes to Preview mouse and touch events instead of standard events - for example PreviewMouseUp event instead of MouseUp event. This can be used to use left mouse button for camera rotation and also for click events.
  • Added TurnTo method to FirstPersonCamera - this turns the camera towards the specified position or to the specified direction vector.
  • CameraControlPanel now moves the FirstPersonCamera forward or backwards when ZoomIn or ZoomOut buttons are clicked.
  • When MouseCameraController is used for FirstPersonCamera the mouse wheel now moves camera forward and backwards.

The library also got a few new samples. Two are to demonstrate the ViewCubeCameraController and TubePathVisual3D. There is also a greatly improved FirstPersonCamera sample that also shows how to turn the camera toward the clicked object. Another new sample shows how to create an application where user can draw to a 3D texture – for example to write annotation to a 3D height map.

 

Ab2d.ReaderSvg library that can read svg files also got many new features. 

The new version now supports textPath element that can render text on a path:

Support for svg textPath element in Ab2d.ReaderSvg

Another very interesting new feature is the new GetElementSvgText method that returns the outer xml text of the specified element. This can be very useful when you add some special attributes or elements to the svg elements. If those elements are not standard svg elements, then ReaderSvg cannot read them. But with using GetElementSvgText you can get the xml text from the specified element and then parse the data out of the xml.

The following is a list of all new features:

  • Added support for textPath elements (positioning text on a path).
  • Added GetElementSvgText to get the svg text of the element with the specified id (can be used to read some additional svg properties that are not read by ReaderSvg).
  • Added support for dx and dy properties on the text element.
  • Fixed writing new line characters in XAML.
  • Added support for vertical text (glyph-orientation-vertical svg property).
  • Improved writing images in XAML that are now written in more clear XAML. Also fixed setting Source for images that are created from foreign objects.
  • Added support for reading number lists that end with comma - for example "12, 34, 56," - this prevented reading svg file in the previous version.
  • Improved support for rounder corners on rectangles in case when only rx or only ry is specified - in this case the other value is set to the same value.

 

Other libraries got only a few updates.

For example, the Ab3d.DXEngine library does not have any new feature in the core libraries but there are three new samples that show how to use standard DirectX rendering code inside DXEngine. The samples show how to render 3D cube with SharpDX code, use the camera and camera controller from Ab3d.PowerToys and mix the rendered 3D cube with other 3D objects from Ab3d.PowerToys library.

Ab2d.ReaderWmf got the following new features:

  • Improved reading images with negative scale transformations.
  • Improved positioning text for some special use cases (correctly position text based on the TextAlign mode).
  • Fixed ResourceDictionaryWriter so that the ResolveResourceKeyCallback is called also for root keys.

 

ZoomPanel library was only slightly improved – the number of history items was increased to 100.

Also Ab3d.Reader3ds got only one improvement. The support for reading broken 3ds files has been improved so that some invalid positions that are not used in TriangleIndices are fixed. This prevents creating too big bounds value that is usually used to position the camera after the model is loaded. 

 

I am really excited about this release. It improves many aspects of the libraries that are not related to the core functionality but are needed because of licensing. It also enables many new features that are possible with .Net 4.5 and allows creating more user friendly APIs with async methods.

Tags: , , , , ,

Ab3d.PowerToys | DXEngine | Reader3ds | ReaderSvg | ReaderWmf | ZoomPanel