Releases: ab4d/Ab4d.SharpEngine.Samples
v3.2.9386
- Significantly improved performance of hit-testing of complex meshes by using octree structures. By default, on the first hit test operation, a MeshOctree object is generated for meshes with more than 512 positions. This increases the mesh initialization time but significantly improves hit testing performance and allows super-fast hit testing of meshes with millions of positions. MeshOctree can be created manually by calling the new CreateOctree method and then assigning it to the new Octree property. It can also be created automatically when hit testing. This is controlled by the MeshPositionsCountForOctreeGeneration, OctreeMaxNodeLevel and GenerateOctreeOnMeshInitialization properties in the HitTestOptions object.
- Added support for volume rendering (for example, CT scans, 3D smoke or clouds, etc.): added VolumeMaterial, VolumeRenderingEffect and CubeSlicer.
- Added IsTwoSided property to VertexColorMaterial. When this is true, the front and back sides of the triangles are rendered with a single draw call.
- Added PrimitiveIdMaterial that can be used to render each triangle of a mesh with a color that is defined by the triangle index. This can be used for super-fast triangle hit testing (checking which triangle on the mesh was hit).
- Improved Triangulator to triangulate some polygons with holes correctly. Also added FailedToFindPolygonEars property that is set to true when the triangulation failed to correctly triangulate the positions so the user knows that the results may not be correct.
- Added optional sourceOffset and destinationOffset parameters to VulkanDevice.CopyBuffer method.
- Added overloads to GpuBuffer.WriteToBuffer and VulkanDevice.CreateBuffer methods that also take a data parameter as a ReadOnlySpan type and not only as a Span and an array.
- Added SetCameraRotation method to SphericalCamera and TargetPositionCamera. It sets the camera's Heading and Attitude and raises the CameraChanged only once (when changing both Heading and Attitude properties then the CameraChanged event is called twice). When RotationCenterPosition is set, the method rotates the camera around RotationCenterPosition. Note that setting Heading and Attitude properties directly does not rotate the camera around the RotationCenterPosition.
- Added DescriptorSetsCache that is used to cache Vulkan's DescriptorSets so they can be reused when the material data block with the same texture image and sampler is used.
- Added new constructors to HeightMapContoursNode and HeightMapWireframeNode that can be used to set all properties that are required to generate the mesh. Before, only a few properties could be set by the constructor. Other properties must be set after that, but setting each property calls UpdateMesh method that regenerates the whole mesh. Using the new constructors significantly improves the time of height map mesh generation.
- Added EngineCreateOptions.EnableNamingVulkanResources property. When set to true, then naming Vulkan resources can be enabled without enabling standard validation.
- Added DescriptorSetsCache class and VulkanDevice.GetOrCreateDescriptorSetsCache method. The DescriptorSetsCache can be used to cache the DescriptorSets so that the same storage buffer and texture image with sampler use the same DescriptorSet.
- Added VulkanDevice.DisableBackgroundUpload and EnableBackgroundUpload methods that can be used to disable background image loading.
- Added IsDisposed to BitmapTextCreator and prevented the class usage after it is disposed.
- Added Dispose method to TextBlockFactory.
- Added DriverInfo property to PhysicalDeviceDetails. It provides the driver name and version of the graphics driver.
- Added EnableBackgroundUpload property to SharpEngineSceneView. By default, it is set to true, but user can set it to false to prevent loading GpuImages and GpuBuffers on a background thread.
- Added HitTestOptions.PreventCallingUpdateBeforeHitTesting to always prevent calling Scene's Update method.
- Added an optional parameter isColorAlphaPremultiplied to some methods in the TextureFactory class. Also prevented changing the order of GradientStop items when sorting the items and two items have the same offset (using Linq OrderBy instead of Array.Sort).
- Added support for 3D images by adding the Depth property to GpuImage.
- Added VulkanDevice.IsLost property and VulkanDevice.DeviceLost event. The user can subscribe to this event and then recreate the Scene or SharpEngineSceneView to restore the rendering.
- Added RandomSamplesRunner to Samples.Common project. It can be used to randomly change the shown sample as fast as possible (on ApplicationIdle).
- Fixed Scene.GetAllHitObjects method that in some cases returned too few hit results.
- Fixed Scene.GetAllHitObjects method that in some cases returned duplicate hit results that lie on the same triangle edge event when ReportAllHitTrianglesWhenEdgeIsHit was set to false.
- Added CreateGradientColors methods with multiple overloads to TextureFactory. They can be used to create an array of colors that define the color gradient.
- Fixed rendering SolidColorMaterial when the mesh is not using PositionNormalTextureVertex format.
- Increased the default size of the staging buffer from 512 KB to 1 MB. This prevents the validation warning that the staging buffer should not be allocated to a dedicated memory block because it is too small.
- When using SharpEngineSceneView for WPF, the DirectX 9 device and DirectX 11 device that are used for sharing the texture are cached. This significantly improves the performance of creating a new SharpEngineSceneView or of showing the content of SharpEngineSceneView after its Visibility was set to Visible (from Hidden or Collapsed).
- Wait until any background queue tasks are finished before calling vkDeviceWaitIdle. This prevents the following error: "vkDeviceWaitIdle(): THREADING ERROR : object of type VkQueue is simultaneously used in current thread 52752 and thread 43220".
- Prevented application crash that could happen when back buffer resources were disposed and quickly recreated again (for example, when SharpEngineSceneView was hidden and shown again). In this case, the new depth buffer can get the same Vulkan handle as the previous back buffer image. Because of reusing the DescriptorSet objects, the source texture image was not reset because the Handle was the same, but this could produce a memory read fault in the fragment shader.
- Prevented possible application deadlock in an Avalonia app with Vulkan backend.
- Prevented calling Scene.Update method before doing hit-testing and after no bigger changes are done to the 3D scene (for example, after only a camera or lights are changed).
- Fixed setting SharpEngineSceneView.MultisampleCount and SupersamplingCount after SceneView was already initialized.
- Change the order of data that is written to the log file. Now the thread id is written after the time and not after the LogArea.
- Changed the default value of IsUsingSharedTextureForIntegratedIntelGpu to true (defined in SharpEngineSceneView for WPF). This usually requires creating an additional DirectX 11 texture because Intel drivers do not allow sharing a Vulkan texture with DirectX 9 (used by WPF). Because an additional texture copy is required, this may be slower than using WritableBitmap (WritableBitmap is used when IsUsingSharedTextureForIntegratedIntelGpu is false).
- Fixed rendering PolyLineNode when IsClosed is set to true and GeometryShader is not supported by the GPU, for example, on MacOS or iOS.
- Fixed recording the command buffers again when the RenderingStepsChanged SceneViewDirtyFlag is set (for example, in MultipleSceneViewsSample when rendering type ComboBox is set to Standard).
- Improved stability when an exception happens during rendering. The error is logged and this does not prevent rendering the next frame.
Samples:
- Samples for Avalonia, WPF and WinUI now have a new "Advanced settings" section in the Settings window. It can be used to change some advanced engine settings and can also add a new TEST button that can be clicked to randomly show samples as fast as possible (on ApplicationIdle).
Ab4d.SharpEngine.glTF:
- Added support for KHR_materials_unlit extension. When it is used, then SolidColorMaterial is used instead of StandardMaterial.
- Fixed reading data in some glTF files with Draco compression.
Breaking change:
A single camera object can no longer be assigned to multiple SceneView objects. If this is done, then an exception is thrown.
There are multiple reasons for that:
- The camera has a SceneView property that specifies only a single SceneView to which the camera is assigned.
- The size of the SceneView determines the aspect ratio of the camera and this is used in the calculation of the perspective matrix.
- Creating CameraLight objects do not work when using multiple SceneViews.
If you were using the same camera object on multiple SceneView objects you can:
- Unassign the camera from the previous SceneView and then assign it to the new SceneView.
- Or create a new camera and assign it to the new SceneView. You can also synchronize it by subscribing to CameraChanged event and then update the values. See Advanced/OutlinesOverObjectsSample.cs for an example.
v3.1.9316
-
Removed "Additional mobile developer license" that needed to be purchased in the previous version to use the SharpEngine on mobile devices. The standard license now also supports mobile development. Users with an existing standard license just need to start using v3.1 to be able to use the library on mobile devices.
-
Improved rendering of semi-transparent objects:
-
When using StandardMaterial or SolidColorMaterial with alpha values between 0 and 1, the objects are now correctly rendered - before, the rendered colors were too dark because the alpha value was applied twice.
-
Added IsPreMultipliedAlphaColor property to VertexColorMaterial, PixelMaterial and PixelsNode (false by default) so the user can decide whether the alpha value is pre-multiplied or not. If it is set to true, then the red, green and blue color values are multiplied by the alpha value.
-
Added IsPreMultipliedAlphaColor property to InstancedMeshNode.
-
Added ModelOptimizer class that can be used to optimize the GroupNode by combining meshes in SceneNodes with the same materials. This can be used on static 3D models and can significantly improve rendering performance by reducing the number of draw calls.
-
Added support for PostProcess effects. The following post-process effects are included in this version: SobelEdgeDetectionPostProcess, BlackAndWhitePostProcess, ToonShadingPostProcess, GammaCorrectionPostProcess, ColorOverlayPostProcess, ExpandPostProcess and GaussianBlurPostProcess. HsvColorPostProcess is available with full source code in the samples project. To add a post-process effect, create an instance of a post-process class and add it to SceneView.PostProcesses collection.
-
Added InstancedTextNode that can render millions of characters by using very efficient mesh instancing.
-
Added support for rendering textures on instanced models. To use texture, call the new SetDiffuseTexture method on InstancedMeshNode.
-
Added support for rendering textures for each pixel that is rendered by PixelsNode. This can be used to render millions of billboards.
-
Added support for rendering object outlines that can be shown over rendered objects. See the new "Advanced / Outlines over objects" sample.
-
Added StlImporter and StlExporter that can import and export .stl files.
-
Added ObjExporter that can export the Scene or individual SceneNodes to .obj file (note: ObjImporter was already available).
-
Added new overloads to GetAllHitObjects method in SceneView and Scene objects. The new overloads take a List of RayHitTestResult as the first parameter. This allows reusing the list and prevents creating a new list on each hit test.
-
Added new overload to Scene.GetHitSceneNodeBounds that takes a List of SceneNode as the first parameter.
-
Improved CircleModelNode: added InnerRadius, StartAngle, HeightScaleFactor and TextureMapping properties and set default values to Normal and UpDirection. Added CreateRectangle method to create a rectangle from CircleModelNode. The InnerRadius can be used to create a circle that is hollow in the center. The StartAngle specified the start angle of the first position. HeightScaleFactor can be used to create an ellipse or rectangle (when Segments = 4) with different widths and heights. The TextureMapping can be changed from the default Rectangular to RadialFromCenter or to RadialFromInnerRadius which can be used to create a radial gradient effect.
-
Added support for rendering wide lines when using macOS. This requires a special build of libMoltenVK.dylib that supports wide lines (see https://github.com/KhronosGroup/MoltenVK#metal_private_api). You can get the precompiled dylib file from the "lib\MoltenVK\macos-arm64_x86_64\widelines-v1.3 folder" in the sample repo.
-
Added DepthOnlyMaterial and DepthOnlyEffect that can be used to create depth pre-pass rendering (can improve performance by reducing the number of fragment shader invocations on 3D scenes with a lot of overdraw). See comments in new Advanced / DepthPrePassSample for more info.
-
Added Color4.SetAlpha overload that also takes premultiplyAlpha parameter and can also pre-multiply red, green and blue color values with the alpha value.
-
Added IsTwoSided property to SolidColorMaterial. When it is true, then the front and the backside of the triangles are rendered with one draw call.
-
Added a default implementation for PngBitmapIO.FileNotFoundResolver that tries to resolve the file name by combining it with the base directory of the application. This can help to load texture from samples if they are specified relative to the output folder and the samples app is not started from the output folder. For example, this can happen when the samples app is started from "dotnet run .". In this case the CurrentDirectory is set to the csproj path and not to the output folder.
-
Added TextureLoader.CreateTextureAsync that takes RawImageData instead of a file name or file stream.
-
Added VulkanDevice.GetDeviceLocalMemoryBudget and GetHostVisibleMemoryBudget to easily query for the available memory.
-
Added CameraController.CustomRotationCenterPositionProvider Func that can be used to provide custom rotation center position and zoom to position when using PointerCameraController. It can be used instead of overriding the virtual GetRotationCenterPositionFromPointerPosition method.
-
Added GpuDevice.OutOfMemoryOccured event. It is triggered when a memory allocation fails with OutOfMemory error. The user can subscribe to this event and manually free the required memory and then set the IsMemoryFreed property in the event args to true. This will try to allocate the memory again.
-
Added SceneView.DisposeBackBuffers method that can be used to dispose the back buffers (GPU images that are used as render targets).
-
Added SharpEngineSceneView.DisposeBackBuffersWhenHidden property that can be used to dispose the back buffers when the control is hidden. This can be used to free memory when the control is not visible. The default value is true.
-
Added PngBitmapIO.FileNotSupportedResolver property that can be assigned to a callback function that replaces the unsupported file (not in .png format) with an alternative file in .png file format.
-
Added MeshUtils.GetStandardVerticesArray method.
-
Added ModelUtils.MakeTwoSidedMaterial and ModelUtils.SetAlphaClipThreshold methods.
-
Added an optional isHorizontal parameter to TextureFactory.CreateGradientTexture. It can be set to false to create a vertical texture (size: 1 x textureSize). This is needed to create a radial gradient effect on CircleModelNode.
-
Added UseTwoSidedMaterials property to ObjImporter.
-
Added static BitmapTextCreator.GetDefaultBitmapFont and BitmapTextCreator.GetDefaultBitmapFontAsync methods.
-
Added BitmapFont.GetFontPageGpuImage and BitmapFont.GetFontPageGpuImageAsync methods that can be used to get the GpuImage for the specified font page.
-
Added PushConstantsBytes to RenderingItem. It can be used to easily assign push constants that can be used in the shader for a custom effect.
-
Added Utilities.GpuSamplerManager.DefaultSampler that can be used to change the default texture sampler (currently, the default sempler is set to Mirror).
-
Added ToRbgaArray, ToBgraArray and ToArgbArray methods to Color4 and Color3 classes. Also added ToRbgArray and ToBgrArray to Color3 class. Those methods return an array of 4 or 3 bytes with red, green, blue and alpha colors.
-
In WPF improved handling situations when the primary monitor is changed (for example, if the external monitor is the primary monitor and it is disconnected). Also, if the primary graphics card is changed, then the SharpEngineSceneView can automatically switch to using WritableBitmap).
-
Improved rendering lines with line caps (e.g. arrows and other line endings): fixed hiding lines with line caps when Visibility is set to Hidden; prevented renderning only line cap when line cap when LineThickness is set to 0; fixed transforming the line with line caps when Transformation is set after the line was already rendered.
-
Removed CommonStatesManager.DepthWrite because depth write without depth read is not supported.
-
Updated StandardEffect and SolidColorEffect by changing many private fields to protected. This simplifies creating derived types, for example, to create an effect with special pipeline settings.
-
By default, the VK_EXT_custom_border_color extension is not enabled (this prevents a performance warning). This may be needed when using ExpandPostProcess and when the SceneView's BackgroundColor is not transparent, white or black but some other custom color. In this case the extension can be enabled by setting the EngineCreateOptions.EnableCustomBorderColors to true.
-
When float color value in Color3 and Color4 is converted into byte values, the byte values are now rounded (using ToArgb, ToBgra, and similar methods). For example, before the 0.25f value was converted into 63 (0.25f * 255f = 63.75f) and now it is converted into 64 (rounded value) - this is closer to 1/4 * 255.
-
Improved VulkanDevice.GetMemoryBudget method to return a list of MemoryHeapBudget records. Each record contains information about the memory heap, its size, used size and available size. The previous method returned the PhysicalDeviceMemoryBudgetPropertiesEXT struct that required unsafe code to be read.
-
Improved PointerCameraController when Orthographic camera is used, ZoomMode is set to PointerPosition and the user zooms to an area without any 3D objects. Now, the PointerCameraController zooms to a 3D point under the mouse instead of zooming to the center.
-
Improved allocating host memory when GPU runs out of device local memory.
-
Improved CreateHeightMapSurfaceMesh method so it correctly defines the Y value for the BoudingBox. Also, the generated mesh is now precisely the required size. Before, the size was smaller for 1 / segments_count.
-
Show an error message with detailed instructions when the Vulkan device is no...
v3.1.9300-rc3
Ab4d.SharpEngine v3.1.9300 (RC3):
- Fixed disposing Vulkan DescriptorSets in PixelEffect when pixels with textures are rendered.
Ab4d.SharpEngine v3.1.9299 (RC2):
-
Fixed applying pre-multiplied alpha value when using StandardEffect. Before the semi-transparent colors may be rendered too dark when using a black background color.
-
Fixed using KeyboardModifiers for Shift and Alt in PointerCameraController. This bug was introduced in v3.1.9287-RC1.
-
Prevented zooming with PointerCameraController when using horizontal scroll wheel.
-
Prevented creating too many Vulkan Semaphore and Fence objects when using Avalonia with Vulkan backend.
-
Fixed rendering rapidly changing texture that is set to a SolidColorMaterial. Before such texture may be blinking.ž
-
By default the VK_EXT_custom_border_color extension is not enabled. This may be needed when using ExpandPostProcess and when the SceneView's BackgroundColor is not transparent, white or black but some other custom color. In this case the extension can be enabled by setting the EngineCreateOptions.EnableCustomBorderColors to true.
-
Added a default implementation for PngBitmapIO.FileNotFoundResolver that tries to resolve the file name by combining it with the base directory of the application. This can help to load texture from samples if they are specified relative to the output folder and the samples app is not started from the output folder, for example from "dotnet run ." that preserves the CurrentDirectory to the csproj path.
-
Improved rendering lines with line caps (e.g. arrows and other line endings): fixed hiding lines with line caps when Visibility is set to Hidden; prevented renderning only line cap when line cap when LineThickness is set to 0; fixed transforming the line with line caps when Transformation is set after the line was already rendered.
-
When float color value in Color3 and Color4 is converted into byte value, the byte value is now rounded (using ToArgb, ToBgra, and similar methods). For example, before the 0.25f value was converted into 63 (0.25f * 255f = 63.75f) and now it is converted into 64 (rounded value); now the 0.25f is converted to 64 which is closer to 1/4 * 255.
-
Fixed rendering pixels with PixelsNode when per-pixel colors with semi-transparent colors are used. The PixelColors should not be alpha pre-multiplied because they are now pre-multiplied in the shader.
-
Improved glTFImporter from Ab4d.SharpEngine.glTF library to support using thrid-party draco compression decoder (for example Openize.Drako). See the updated Importers/GltfImporterExporterSample on how to support Draco compressed glTF files.
Ab4d.SharpEngine v3.1.9287 (RC1):
- Added support for PostProcess effects. The following post-process effects are included in this version: SobelEdgeDetectionPostProcess, BlackAndWhitePostProcess, ToonShadingPostProcess, GammaCorrectionPostProcess, ColorOverlayPostProcess, ExpandPostProcess and GaussianBlurPostProcess. HsvColorPostProcess is available with full source code in the samples project. To add a post-proces effect, create an instance of a post process class and add it to SceneView.PostProcesses collection.
- Added support for rendering object outlines that can be shown over rendered objects. See the new "Advanced / Outlines over objects" sample.
- Added InstancedTextNode that can render millions of characters by using very efficient mesh instancing.
- Added support for rendering textures on instanced models. To use texture, call the new SetDiffuseTexture method on InstancedMeshNode.
- Added support for rendering textures for each pixel that is rendered by PixelsNode. This can be used to render millions of billboards.
- Added StlImporter and StlExporter that can import and export .stl files.
- Added ObjExporter that can export the Scene or individual SceneNodes to .obj file (note: ObjImporter was already available).
- Added new overloads to GetAllHitObjects method in SceneView and Scene objects. The new overloads take a List of RayHitTestResult as the first parameter. This allows reusing the list and prevents creating a new list on each hit test.
- Added new overload to Scene.GetHitSceneNodeBounds that takes a List of SceneNode as the first parameter.
- Added ModelOptimizer class that can be used to optimize the GroupNode by combining meshes in SceneNodes with the same materials. This can significantly reduce the number of draw calls.
- Added support for rendering wide lines when using macOS. This requires a special build of libMoltenVK.dylib that supports wide lines (see https://github.com/KhronosGroup/MoltenVK#metal_private_api). You can get the precompiled dylib file from the "lib\MoltenVK\macos-arm64_x86_64\widelines-v1.3 folder" in the sample repo.
- Improved VulkanDevice.GetMemoryBudget method to return a list of MemoryHeapBudget records. Each record contains information about the memory heap, its size, used size and available size. The previous method returned the PhysicalDeviceMemoryBudgetPropertiesEXT struct that required unsafe code to be read.
- Added VulkanDevice.GetDeviceLocalMemoryBudget and GetHostVisibleMemoryBudget to easily query for the available memory.
- Improved PointerCameraController when Orthographic camera is used, ZoomMode is set to PointerPosition and the user zooms to an area without any 3D object. Now, the PointerCameraController zooms to a 3D point under the mouse instead of zooming to the center.
- Added CameraController.CustomRotationCenterPositionProvider Func that can be used to provide custom rotation center position and zoom to position when using PointerCameraController. It can be used instead of overriding the virtual GetRotationCenterPositionFromPointerPosition method.
- Improved allocating host memory when GPU runs out of device local memory.
- Added TextureLoader.CreateTextureAsync that takes RawImageData instead of a file name or file stream.
- Improved CreateHeightMapSurfaceMesh method so it correctly defines the Y value for the BoudingBox. Also, the generated mesh is now precisely the required size. Before, the size was smaller for 1 / segments_count.
- Show an error message with detailed instructions when the Vulkan device is not available (for example, when MoltenVK is not present on macOS or iOS).
- Added GpuDevice.OutOfMemoryOccured event. It is triggered when a memory allocation fails with OutOfMemory error. The user can subscribe to this event and manually free the required memory and then set the IsMemoryFreed property to true. This will try to allocate the memory again.
- Added SceneView.DisposeBackBuffers method that can be used to dispose the back buffers (GPU images that are used as render targets).
- Added SharpEngineSceneView.DisposeBackBuffersWhenHidden property that can be used to dispose the back buffers when the control is hidden. This can be used to free memory when the control is not visible. The default value is true.
- To improve memory usage, allocate images bigger than 64 MB to a dedicated memory block (instead of using a shared memory block for multiple images - in this case, some memory may be left unused). The default threshold value is 64 MB. This can be adjusted by changing the static EngineRuntimeOptions.ImageDedicatedMemoryAllocationThreshold.
- Removed setter from Transform.Value property. To set the matrix, use the MatrixTransform and its SetMatrix method.
- Added PngBitmapIO.FileNotSupportedResolver property that can be assigned to a callback function that replaces the unsupported file (not in .png format) to an alternative file in .png file format.
- Added MeshUtils.GetStandardVerticesArray method.
- Added ModelUtils.MakeTwoSidedMaterial and ModelUtils.SetAlphaClipThreshold methods.
- Improved CircleModelNode: added InnerRadius, StartAngle, HeightScaleFactor and TextureMapping properties and set default values to Normal and UpDirection. Added CreateRectangle method to create a rectangle from CircleModelNode. The InnerRadius can be used to create a circle that is hollow in the center. The StartAngle specified the start angle of the first position. HeightScaleFactor can be used to create an ellipse or rectangle (when Segments = 4) with different width and height. The TextureMapping can changed from default Rectangular to RadialFromCenter or RadialFromInnerRadius that can be used to create a radial gradient effect.
- Added an optional isHorizontal parameter to TextureFactory.CreateGradientTexture. It can be set to false to create a vertical texture (size: 1 x textureSize). This is needed to create a radial gradient effect on CircleModelNode.
- Improved MeshFactory.CreateCircleMesh methods by adding innerRadius, startAngle, heightScaleFactor and textureMapping properties
- Added UseTwoSidedMaterials property to ObjImporter.
- Improved LineUtils.GetWireframeLinePositions and EdgeLinesFactory to generate line positions also when the mesh does not have TriangleIndices defined.
- Added static BitmapTextCreator.GetDefaultBitmapFont and BitmapTextCreator.GetDefaultBitmapFontAsync methods.
- Added BitmapFont.GetFontPageGpuImage and BitmapFont.GetFontPageGpuImageAsync methods that can be used to get the GpuImage for the specified font page.
- Added PushConstantsBytes to RenderingItem. It can be used to easily assign push constants that can be used in the shader for a custom effect.
- Added Utilities.GpuSamplerManager.DefaultSampler that can be used to change the default texture sampler (the default semper is set to Mirror).
- Added ToRbgaArray, ToBgraArray and ToArgbArray methods to Color4 and Color3 classes. Also added ToRbgArray and ToBgrArray to Color3 class. Those methods return an array of 4 or 3 bytes with red, green, blue and alpha colors.
- Improved RawImageData by adding a constructor that takes a fillColor and creates a RawImageData with the specified color. Also, added a Clear method to clear the RawImageData and DrawImage method that can draw pixels from one RawIma...
v3.1.9287-rc1
-
Added support for PostProcess effects. The following post-process effects are included in this version: SobelEdgeDetectionPostProcess, BlackAndWhitePostProcess, ToonShadingPostProcess, GammaCorrectionPostProcess, ColorOverlayPostProcess, ExpandPostProcess and GaussianBlurPostProcess. HsvColorPostProcess is available with full source code in the samples project. To add a post-proces effect, create an instance of a post process class and add it to SceneView.PostProcesses collection.
-
Added support for rendering object outlines that can be shown over rendered objects. See the new "Advanced / Outlines over objects" sample.
-
Added InstancedTextNode that can render millions of characters by using very efficient mesh instancing.
-
Added support for rendering textures on instanced models. To use texture, call the new SetDiffuseTexture method on InstancedMeshNode.
-
Added support for rendering textures for each pixel that is rendered by PixelsNode. This can be used to render millions of billboards.
-
Added StlImporter and StlExporter that can import and export .stl files.
-
Added ObjExporter that can export the Scene or individual SceneNodes to .obj file (note: ObjImporter was already available).
-
Added new overloads to GetAllHitObjects method in SceneView and Scene objects. The new overloads take a List of RayHitTestResult as the first parameter. This allows reusing the list and prevents creating a new list on each hit test.
-
Added new overload to Scene.GetHitSceneNodeBounds that takes a List of SceneNode as the first parameter.
-
Added ModelOptimizer class that can be used to optimize the GroupNode by combining meshes in SceneNodes with the same materials. This can significantly reduce the number of draw calls.
-
Added support for rendering wide lines when using macOS. This requires a special build of libMoltenVK.dylib that supports wide lines (see https://github.com/KhronosGroup/MoltenVK#metal_private_api). You can get the precompiled dylib file from the "lib\MoltenVK\macos-arm64_x86_64\widelines-v1.3 folder" in the sample repo.
-
Improved VulkanDevice.GetMemoryBudget method to return a list of MemoryHeapBudget records. Each record contains information about the memory heap, its size, used size and available size. The previous method returned the PhysicalDeviceMemoryBudgetPropertiesEXT struct that required unsafe code to be read.
-
Added VulkanDevice.GetDeviceLocalMemoryBudget and GetHostVisibleMemoryBudget to easily query for the available memory.
-
Improved PointerCameraController when Orthographic camera is used, ZoomMode is set to PointerPosition and the user zooms to an area without any 3D object. Now, the PointerCameraController zooms to a 3D point under the mouse instead of zooming to the center.
-
Added CameraController.CustomRotationCenterPositionProvider Func that can be used to provide custom rotation center position and zoom to position when using PointerCameraController. It can be used instead of overriding the virtual GetRotationCenterPositionFromPointerPosition method.
-
Improved allocating host memory when GPU runs out of device local memory.
-
Added TextureLoader.CreateTextureAsync that takes RawImageData instead of a file name or file stream.
-
Improved CreateHeightMapSurfaceMesh method so it correctly defines the Y value for the BoudingBox. Also, the generated mesh is now precisely the required size. Before, the size was smaller for 1 / segments_count.
-
Show an error message with detailed instructions when the Vulkan device is not available (for example, when MoltenVK is not present on macOS or iOS).
-
Added GpuDevice.OutOfMemoryOccured event. It is triggered when a memory allocation fails with OutOfMemory error. The user can subscribe to this event and manually free the required memory and then set the IsMemoryFreed property to true. This will try to allocate the memory again.
-
Added SceneView.DisposeBackBuffers method that can be used to dispose the back buffers (GPU images that are used as render targets).
-
Added SharpEngineSceneView.DisposeBackBuffersWhenHidden property that can be used to dispose the back buffers when the control is hidden. This can be used to free memory when the control is not visible. The default value is true.
-
To improve memory usage, allocate images bigger than 64 MB to a dedicated memory block (instead of using a shared memory block for multiple images - in this case, some memory may be left unused). The default threshold value is 64 MB. This can be adjusted by changing the static EngineRuntimeOptions.ImageDedicatedMemoryAllocationThreshold.
-
Removed setter from Transform.Value property. To set the matrix, use the MatrixTransform and its SetMatrix method.
-
Added PngBitmapIO.FileNotSupportedResolver property that can be assigned to a callback function that replaces the unsupported file (not in .png format) to an alternative file in .png file format.
-
Added MeshUtils.GetStandardVerticesArray method.
-
Added ModelUtils.MakeTwoSidedMaterial and ModelUtils.SetAlphaClipThreshold methods.
-
Improved CircleModelNode: added InnerRadius, StartAngle, HeightScaleFactor and TextureMapping properties and set default values to Normal and UpDirection. Added CreateRectangle method to create a rectangle from CircleModelNode. The InnerRadius can be used to create a circle that is hollow in the center. The StartAngle specified the start angle of the first position. HeightScaleFactor can be used to create an ellipse or rectangle (when Segments = 4) with different width and height. The TextureMapping can changed from default Rectangular to RadialFromCenter or RadialFromInnerRadius that can be used to create a radial gradient effect.
-
Added an optional isHorizontal parameter to TextureFactory.CreateGradientTexture. It can be set to false to create a vertical texture (size: 1 x textureSize). This is needed to create a radial gradient effect on CircleModelNode.
-
Improved MeshFactory.CreateCircleMesh methods by adding innerRadius, startAngle, heightScaleFactor and textureMapping properties
-
Added UseTwoSidedMaterials property to ObjImporter.
-
Improved LineUtils.GetWireframeLinePositions and EdgeLinesFactory to generate line positions also when the mesh does not have TriangleIndices defined.
-
Added static BitmapTextCreator.GetDefaultBitmapFont and BitmapTextCreator.GetDefaultBitmapFontAsync methods.
-
Added BitmapFont.GetFontPageGpuImage and BitmapFont.GetFontPageGpuImageAsync methods that can be used to get the GpuImage for the specified font page.
-
Added PushConstantsBytes to RenderingItem. It can be used to easily assign push constants that can be used in the shader for a custom effect.
-
Added Utilities.GpuSamplerManager.DefaultSampler that can be used to change the default texture sampler (the default semper is set to Mirror).
-
Added ToRbgaArray, ToBgraArray and ToArgbArray methods to Color4 and Color3 classes. Also added ToRbgArray and ToBgrArray to Color3 class. Those methods return an array of 4 or 3 bytes with red, green, blue and alpha colors.
-
Improved RawImageData by adding a constructor that takes a fillColor and creates a RawImageData with the specified color. Also, added a Clear method to clear the RawImageData and DrawImage method that can draw pixels from one RawImageData to another.
-
Improved async methods to run on the UI thread when background upload is not supported (when SynchronizationContext is null).
-
Fixed WireBoxNode, CornerWireBoxNode, WireCrossNode, RectangleNode, CircleLineNode, EllipseLineNode and EllipseArcLineNode when only a constructor was used to create the object (no property was set). In this case, the positions were not defined and no object was rendered.
-
Fixed rendering MultiLineNode that uses PositionColoredLineMaterial with transparent colors.
-
Swap the enum values for the KeyboardModifiers.ShiftKey and KeyboardModifiers.AltKey to match the values in WPF (ModifierKeys) and Avalonia (KeyModifiers). ShiftKey now has a value of 4, and AltKey has a value of 1.
-
Fixed MeshFactory.SetBoxVerticesArray method.
-
When VK_EXT_pageable_device_local_memory extension is available, then the "No compatible memory type" exception was prevented when resizing the SceneView control, and the GPU ran out of the device's local memory.
-
Fixed PngBitmapIO to prevent throwing an exception if there are some invalid chunks present after the "IEND" chunk.
-
Fixed PngBitmapIO.SaveBitmap when saving to a file name of an existing file. The new method always creates a new file and does not overwrite the data in the existing file. This prevents that if the exiting file is longer than the new file, then some data are left from the previous file.
-
Fixed rendering MultiLineNode with PositionColoredLineMaterial that defines transparent line colors.
-
Fixed positioning text when using VectorFontFactory.CreateIndividualTextMeshes and when positionType is not Baseline.
-
Fixed rendering SubMeshes in MultiMaterialModelNode when some of them are removed and then added again.
-
Fixed ReaderObj when the obj file does not define normals. In this case, they are automatically calculated (this prevents showing black models).
-
Fixed setting VertexCount and IndexCount in ModelNode when the positions and triangle indices are defined and not only when the VertexBuffer and IndexBuffer are created.
-
Fixed reporting a duplicate number of draw calls, vertex count and some other statistics in RenderingStatistics when CameraAxisPanel or some other Overlay Panel was rendered.
-
Fixed using SharpEngineSceneView for WPF when PresentationType is set to OverlayTexture and when SharpEngineSceneView's Visibility is set to Collapsed or Hidden and then back to Visible.
-
Prevent "Index out of bounds" exception in EdgeLinesFactory if triangle indices count is not dividable by 3.
-
Removed CameraLight when the camera object that created the CameraLight is removed from the SceneView.Camera.
-
...
v3.0.9208
- Fixed ManualInputEventsManager, where its events were not triggered when no EventsSource was registered. This bug was introduced in v3.0.9175 RC3. The IsProcessingEvents property has also been removed from ManualInputEventsManager.
- Prevented setting NaN values to the camera's position and distance when zooming in and out. This may happen when the camera's near and far planes are far apart.
- When calculating the camera's near and far planes, use the camera's MinNearPlaneDistance and MaxFarPlaneDistance when provided.
- Fixed PositionAndScaleSceneNode method in ModelUtils and TransformMesh method in MeshUtils by normalizing the normals. Before, the normals may not be normalized when scaling the object.
- Improved AndroidBitmapIO when it is used in multiple threads and prevented scaling bitmap images based on screen density. This can be disabled by setting the new PreventAndroidBitmapScale to false.
- Improved AndroidTextureLoader by adding a new optional name property to set the name of the created GpuImage. Also, the LoadTextureAsync method now takes StandardMaterialBase type as a parameter instead of StandardMaterial, so it can also be used to create a SolidColorMaterial.
- Set GpuImage.IsDataWritePostponed when image data is scheduled for background transfer.
- Added GpuDynamicMemoryBlockPool.FreeMaterialMemoryBlocks method that can be used to free the material's memory block in a custom Effect (see Ab4d.SharpEngine.Samples.Common/Advanced/FogEffect.cs DisposeMaterial method)
- VulkanDynamicDescriptorSetFactory is now public instead of internal.
- Improved TriangleMesh for Positions (Vector3[]) and PositionTexture vertex layout. Before, the VertexBufferDescription was not correctly set. Also, CalculateBoundingBox, GetPositions, GetTextureCoordinates and GetVertexDataChannels methods did not work correctly for those two vertex layouts.
- Improved SolidColorEffect to correctly render meshes with only Positions (Vector3[]) and meshes with PositionTexture vertex layout. Before, only meshes with PositionNormalTexture vertex layout were correctly rendered (this layout is also used for StandardMesh).
- Added CreateOutlinePositionsMesh and CreateOutlineStandardMesh to MeshUtils. See the new "Advanced / Mesh outlines" sample.
- Ab4d.SharpEngine, Ab4d.SharpEngine.Assimp, Ab4d.SharpEngine.glTF and Ab4d.SharpEngine.AvaloniaUI assemblies for .Net 8 and .Net 9 are now marked as IsTrimmable and IsAotCompatible (updated code to prevent AOT analyzer warnings).
v3.0.9196
Major changes compared to v2.0.8956:
- Added support for free open-source license. When this license is used, then for the first 1.5 seconds the "POWERED BY SHARP ENGINE" text and the SharpEngine logo is shown. During this period no other 3D objects are rendered. You can check if the logo is shown by checking the new SceneView.IsLicenseLogoShown property. To be informed when the logo is removed and when your 3D objects can be shown (for example to start an animation) use the SceneView.OnLicenseLogoRemoved Action. You can apply for free open-source license on https://ab4d.com/trial.
- Added support for super-sampling anti-aliasing (SSAA) that can significantly improve the quality of rendered 3D lines and 3D text. On SharpEngineSceneView control the super-sampling is defined by the SupersamplingCount property. On SceneView object,the initial multisample count and supersample count is set by calling SceneView.Initialize method. To change the MSAA and SSAA, call SceneView.Resize method. Default value for super-sampling on dedicated desktop devices is 4, on integrated desktop devices is 2, on mobile and low-end devices the default value is 1.
- Added support for hardware accelerated line caps rendering. This allows rendering of millions of lines with line caps. Also, added additional line cap types. Before only Flat and ArrowAnchor were available. Now the following new line caps are supported: WideArrowAnchor, WiderArrowAnchor, ShortArrowAnchor, StealthArrowAnchor, ReverseArrowAnchor, ReverseShortArrowAnchor, BoxAnchor, DiamondAnchor.
- Added support for rendering hidden lines - lines that are rendered only when they are behind 3D objects. This can be used to render doted or thinner hidden lines (compared to visible lines).
- Added support for async image loading and buffer upload. The following new async methods are added: TextureLoader.CreateTextureAsync, GpuImage.CopyDataToImageAsync, GpuBuffer.WriteToBufferAsync, BitmapFont.CreateAsync, BitmapTextCreator.CreateAsync, AndroidTextureLoader.CreateTextureMaterialAsync, AndroidTextureLoader.CreateTextureAsync.
- Added loadInBackground and initialDiffuseColor to StandardMaterial and SolidColorMaterial constructors that also take texture file name or texture stream as parameters. When loadInBackground is true the material is initially set to the initialDiffuseColor. When the texture is loaded, it is shown instead of the initialDiffuseColor.
- Added TrueTypeFontLoader and VectorFontFactory that can show vector text meshes and outlines from the glyph defined in TrueType font files (.ttf).
- Added new SharpEngineSceneView constructors that also take Scene as a parameter. That can be used to create a single Scene object and show it with multiple SharpEngineSceneView objects. See the new "Advanced / Multiple SceneViews" sample.
- Added BackgroundGraphicsQueue and BackgroundTransferQueue to VulkanDevice. They are created when EngineCreateOptions.EnableBackgroundResourceUpload is true (by default) and when GPU device supports more then one Graphics queue and when any Transfer queue is available. Note that when EnableBackgroundResourceUpload is true, the VulkanDevice.TransferQueue is not set (BackgroundTransferQueue is set instead).
- Added MeshTrianglesSorter that can be used to sort triangles by camera distance.
- Added support for rendering to bitmap without multi-sampling (MSAA) even if it is enabled in the SceneView. This is required to correctly render ID bitmap that can be used for hit-testing.
- Significantly improved performance of initializing multiple buffers (for example creating 1000 pyramids each with its own mesh takes now 15ms instead of 200ms). This is implemented by a new GpuStagingBuffer class that can do a batch copy of multiple buffers so we wait only once for multiple buffers copy operations.
- Added initial support for Uno platform.
To see the full change log, check the changes for RC and beta 2.1 versions on the SharpEngine history web page.
v3.0.9175 RC3
This is a release candidate version that uses Ab4d.SharpEngine v3.0.9175-rc3 version with the following new features (compared to v2.1.9118-beta2):
v3.0.9175 RC3:
- Added IsBackgroundImageUploadSupported and IsBackgroundBufferUploadSupported properties to VulkanDevice.
- Fixed using async methods when the GPU device does not support background image creation, buffer upload or when disabled by the user (setting CreateOptions.EnableBackgroundResourceUpload to false).
- Fixed using async methods when the SynchronizationContext.Current is null (in Console app). In this case it is not possible to continue the background task on the main thread.
- When using TextureLoader set GpuImage.Name to only the file name and not to the full path.
- When LineRasterizationMode is set to RectangularSmooth, then enable alpha blending to blend line edges with surrounding.
v3.0.9173 RC2:
- Fixed using SharpEngineSceneView in Avalonia with Vulkan backend on some computers.
v3.0.9169 RC1:
- Added support for async image loading and buffer upload. The following new async methods are added: TextrueLoader.CreateTextureAsync, GpuImage.CopyDataToImageAsync, GpuBuffer.WriteToBufferAsync, BitmapFont.CreateAsync, BitmapTextCreator.CreateAsync, AndroidTextureLoader.CreateTextureMaterialAsync, AndroidTextureLoader.CreateTextureAsync.
- Added loadInBackground and initialDiffuseColor to StandardMaterial and SolidColorMaterial constructors that also take texture file name or texture stream as parameters. When loadInBackground is true the material is initially set to the initialDiffuseColor. When the texture is loaded, it is shown instead of the initialDiffuseColor.
- Added TrueTypeFontLoader and VectorFontFactory that can show vector text meshes and outlines from the glyph defined in TrueType font files (.ttf).
- Added new SharpEngineSceneView constructors that also take Scene as a parameter. That can be used to create a single Scene object and show it with multiple SharpEngineSceneView objects. See the new "Advanced / Multiple SceneViews" sample.
- Added BackgroundGraphicsQueue and BackgroundTransferQueue to VulkanDevice. They are created when EngineCreateOptions.EnableBackgroundResourceUpload is true (by default) and when GPU device supports more then one Graphics queue and when any Transfer queue is available. Note that when EnableBackgroundResourceUpload is true, the VulkanDevice.TransferQueue is not set (BackgroundTransferQueue is set instead).
- Improved CreateExtrudedMesh method in Ab4d.SharpEngine.Meshes.MeshFactory. Now all possible combinations of shape orientation (clockwise, counter-clockwise), simple shape / shape with holes, isYAxisUp, isSmooth, flipNormals and coordinateSystem produce the valid mesh.
- Improved EdgeLinesFactory for some cases when a triangle edge is only partially covered by another triangle.
- Improved Triangulator to correctly triangulate some more complex polygons, for example, those with multiple holes on different shapes, like % char.
- Improved optimizing positions in PolygonAnalyzer - now when more than one consecutive position lies on the same line, then all of those positions are removed.
- Show RotationCenterPosition value in in SceneView.GetCameraInfo. This method is also used by "Dump camera details" menu item in the Diagnostics window.
- Added CustomCamera, CustomAmbientLightColor and CustomViewport to RenderingLayer. When set, then all RenderingItems in the layer will use the specified camera, ambient light color and custom Viewport.
- Added ToCSharpString extension method to int[], Vector2[] and Vector3[] arrays - it produces a c# string that can be used to initialize the specified array.
- Added Convert2DShapeTo3DPositions method to Ab4d.SharpEngine.Utilities.MeshUtils.
- Added DepthBias property to LineBaseNode. This makes it much easier to set DepthBias to all line nodes.
- Fixed calculating BoundingBox when positons to MultiLineNode or PolyLineNode are set in constructor.
- Fixed rendering PolyLineNode when Positions are set to null or empty array after the PolyLineNode was already rendered.
- Set default LogLevel to Warn (changed from None).
- Prevented showing "the name DebuggerDisplay does not exist in the current contex" error in Visual Studio when debugging Ab4d.Vulkan objects.
- Fixed rendering when Scene.IsTransparencySortingEnabled is set to false.
- Added SetCustomVertexBuffer and SetCustomIndexBuffer to MeshModelNode.
- Fixed using CullCounterClockwise and CullClockwise - in the previous version, the culling mode was swapped: CullClockwise culled (removed) counter-clockwise triangles and CullCounterClockwise culled clockwise triangles. Now this is fixed. This also changes the Scene.DefaultRasterizerState from CullCounterClockwise to CullClockwise.
- Make the Dispose method in the SharpEngineSceneView virtual, so derived classes can provide their own disposal logic.
Ab4d.SharpEngine.glTF:
- Prevented throwing an exception when a material does not define pbrMetallicRoughness property.
- Added support for showing a diffuse texture from data in the KHR_materials_pbrSpecularGlossiness extension.
v3.0.9169 RC1
This is a release candidate version that uses Ab4d.SharpEngine v3.0.9169-rc1 with the following new features (compared to v2.1.9118-beta2):
- Added support for async image loading and buffer upload. The following new async methods are added: TextrueLoader.CreateTextureAsync, GpuImage.CopyDataToImageAsync, GpuBuffer.WriteToBufferAsync, BitmapFont.CreateAsync, BitmapTextCreator.CreateAsync, AndroidTextureLoader.CreateTextureMaterialAsync, AndroidTextureLoader.CreateTextureAsync.
- Added loadInBackground and initialDiffuseColor to StandardMaterial and SolidColorMaterial constructors that also take texture file name or texture stream as parameters. When loadInBackground is true the material is initially set to the initialDiffuseColor. When the texture is loaded, it is shown instead of the initialDiffuseColor.
- Added TrueTypeFontLoader and VectorFontFactory that can show vector text meshes and outlines from the glyph defined in TrueType font files (.ttf).
- Added new SharpEngineSceneView constructors that also take Scene as a parameter. That can be used to create a single Scene object and show it with multiple SharpEngineSceneView objects. See the new "Advanced / Multiple SceneViews" sample.
- Added BackgroundGraphicsQueue and BackgroundTransferQueue to VulkanDevice. They are created when EngineCreateOptions.EnableBackgroundResourceUpload is true (by default) and when GPU device supports more then one Graphics queue and when any Transfer queue is available. Note that when EnableBackgroundResourceUpload is true, the VulkanDevice.TransferQueue is not set (BackgroundTransferQueue is set instead).
- Improved CreateExtrudedMesh method in Ab4d.SharpEngine.Meshes.MeshFactory. Now all possible combinations of shape orientation (clockwise, counter-clockwise), simple shape / shape with holes, isYAxisUp, isSmooth, flipNormals and coordinateSystem produce the valid mesh.
- Improved EdgeLinesFactory for some cases when a triangle edge is only partially covered by another triangle.
- Improved Triangulator to correctly triangulate some more complex polygons, for example, those with multiple holes on different shapes, like % char.
- Improved optimizing positions in PolygonAnalyzer - now when more than one consecutive position lies on the same line, then all of those positions are removed.
- Show RotationCenterPosition value in in SceneView.GetCameraInfo. This method is also used by "Dump camera details" menu item in the Diagnostics window.
- Added CustomCamera, CustomAmbientLightColor and CustomViewport to RenderingLayer. When set, then all RenderingItems in the layer will use the specified camera, ambient light color and custom Viewport.
- Added ToCSharpString extension method to int[], Vector2[] and Vector3[] arrays - it produces a c# string that can be used to initialize the specified array.
- Added Convert2DShapeTo3DPositions method to Ab4d.SharpEngine.Utilities.MeshUtils.
- Added DepthBias property to LineBaseNode. This makes it much easier to set DepthBias to all line nodes.
- Fixed calculating BoundingBox when positons to MultiLineNode or PolyLineNode are set in constructor.
- Fixed rendering PolyLineNode when Positions are set to null or empty array after the PolyLineNode was already rendered.
- Set default LogLevel to Warn (changed from None).
- Prevented showing "the name DebuggerDisplay does not exist in the current contex" error in Visual Studio when debugging Ab4d.Vulkan objects.
- Fixed rendering when Scene.IsTransparencySortingEnabled is set to false.
- Added SetCustomVertexBuffer and SetCustomIndexBuffer to MeshModelNode.
- Fixed using CullCounterClockwise and CullClockwise - in the previous version, the culling mode was swapped: CullClockwise culled (removed) counter-clockwise triangles and CullCounterClockwise culled clockwise triangles. Now this is fixed. This also changes the Scene.DefaultRasterizerState from CullCounterClockwise to CullClockwise.
- Make the Dispose method in the SharpEngineSceneView virtual, so derived classes can provide their own disposal logic.
Ab4d.SharpEngine.glTF:
- Prevented throwing an exception when a material does not define pbrMetallicRoughness property.
- Added support for showing a diffuse texture from data in the KHR_materials_pbrSpecularGlossiness extension.
v2.1.9118-beta2
This is an intermediate beta version that uses Ab4d.SharpEngine v2.1.9118-beta2 with the following new features (compared to v2.1.9028-beta1):
-
Added support for super-sampling anti-aliasing (SSAA) that can significantly improve the quality of rendered 3D lines. On SharpEngineSceneView control the super-sampling is defined by the SupersamplingCount property. On SceneView object,the initial multisample count and supersample count is set by calling SceneView.Initialize method. To change the MSAA and SSAA, call SceneView.Resize method. Default value for dedicated desktop devices is 4, for integrated desktop devices is 2, for mobile and low-end devices the default value is 1.
-
Added support for hardware accelerated line caps rendering. Before only Flat and ArrowAnchor were available. Now the following new line caps are supported: WideArrowAnchor, WiderArrowAnchor, ShortArrowAnchor, StealthArrowAnchor, ReverseArrowAnchor, ReverseShortArrowAnchor, BoxAnchor, DiamondAnchor. This allows rendering of millions of lines with line caps.
-
Added support for rendering hidden lines - lines that are rendered only when they are behind 3D objects. This can be used to render doted or thinner hidden lines (compared to visible lines).
-
Added MeshTrianglesSorter that can be used to sort triangles by camera distance.
-
Added support to for rendering to bitmap without multi-sampling (MSAA) even if it is enabled in the SceneView. This is required to render correct ID bitmap that can be used for hit-testing.
-
Added PointerWheelChanged event to ManualInputEventsManager. It can be used to get generic pointer or mouse wheel events.
-
Added VulkanDevice.CopyBuffer and GpuBuffer.CopyToBuffer methods.
-
Added new overloads to VulkanDevice.CreateBuffer method that takes custom bufferSize or Span as parameters.
-
Fixed running on Linux Wayland by enabling VK_KHR_wayland_surface instance extension when supported.
-
Added static GetDpiScale to SharpEngineSceneView.
-
Added optional name parameter to the SharpEngineSceneView constructor.
-
Added virtual GetDefaultMultiSampleCount and GetDefaultSuperSamplingCount methods to SharpEngineSceneView. The methods can be overridden to provide custom multi-sampling and super-sampling based on the used VulkanDevice.
-
Added SetCustomVertexBuffer and SetCustomIndexBuffer to Mesh. They can be used to set custom vertex or index buffer for the Mesh. This allows the buffers to be reused on different Scene objects (but the buffers need to be created by the same VulkanDevice).
-
Added CustomMesh which is defined by custom vertex and index buffers.
-
Added GetViewMatrix and GetInvertedViewMatrix methods to Camera class.
-
Added TorusKnotModelNode class and MeshFactory.CreateTorusKnotMesh method. They can be used to render torus and torus knot 3D objects.
-
Added EngineCreateOptions.Use32BitDepthFormat property (default value is false - this uses D24UnormS8Uint depth-stencil format that is recommended by NVIDIA).
-
Added support for setting memory priority and pagable device-local memory. This helps the engine work in situations where GPU memory is heavily used by many apps in the OS. See VK_EXT_memory_priority and VK_EXT_pageable_device_local_memory Vulkan device extensions for more info. This can disabled by new EnableMemoryPrioritiesFeature and EnablePageableDeviceLocalMemoryFeature properties to EngineCreateOptions. Also added IsMemoryPrioritiesFeatureEnabled and IsPageableDeviceLocalMemoryFeatureEnabled properties to PhysicalDeviceDetails.
-
Renamed CameraAnimatedProperties.CameraWidth enum name to ViewWidth. The ViewWidth is still available but is marked as Obsolete.
-
Fixed processing the change of CustomRenderingLayer property after the SceneNode was already rendered.
-
Fixed rendering poly-lines when VulkanLineRasterizer is used (on older ARM graphics cards that do not support geometry shader). Before, the first and the last positions were not rendered.
-
Added DefaultTransparentDepthStencilState, DefaultOpaqueDepthStencilState, DefaultBlendState and DefaultRasterizerState properties to Scene object. The DefaultTransparentDepthStencilState can be changed from CommonStatesManager.DepthReadWrite to DepthRead to solve problems with transparent objects in some cases.
-
Fixed rendering poly-lines when monitor dpi-scale is more than 1.
-
Added "HitTesting and imput processing / Rectangular Selection" sample.
-
Set BackgroundColor to Transparent by default.
-
Added IsCaptureFrameAvailable method to SceneView. Renamed CaptureNextFrameInRenderDoc method to CaptureNextFrame.
-
Added support for manually capturing a frame with RenderDoc on Linux. Frame capture is initiated by calling SceneView.CaptureNextFrame method.
-
Added RecreateVertexBuffer and RecreateIndexBuffer to TriangleMesh (base class for StandardMesh).
-
Fixed getting the correct value from IsDeviceLUIDValid and IsDeviceUUIDValid properties in PhysicalDeviceDetails.
-
Added support for checking memory budgets before memory allocations (requires API 1.1 and VK_EXT_memory_budget device extension). This can be disabled by setting VulkanMemoryAllocator.CheckMemoryBudget to false.
-
Added GetMemoryBudget and GetMemoryBudgetInfo methods to VulkanDevice. Also, calling Scene.DumpFullMemoryUsage or Scene.GetFullMemoryUsageInfo will get info about the memory budget.
-
SharpEngineSceneView control for WPF, AvaloniaUI and WinForms now implement IDisposable interface (the Dispose method was already available but the IDisposable interface was not specified).
-
Fixed GetAllHitResults that sometimes did not return all the hit results.
-
Added Log.IsLoggingToDiagnosticsTrace property that can enable SharpEngine logs to be written to the trace listeners in the System.Diagnostics.Trace.Listeners collection.
-
Renamed dataLength parameter to dataItemsCount in WriteToBuffer and ReadFromBuffer methods in GpuBuffer.
-
Fixed using EngineCreateOptions.DesiredInstanceExtensionNames.
-
The PreferredMultiSampleCount property on SceneView and SharpEngineSceneView is replaced by a new MultisampleCount property. The old property is marked as obsolete.
-
Marked the SceneView.UsedMultiSampleCount and SceneView.UsedMultiSampleCountFlags properties as obsolete. To set the initial multisample count and the supersample count call SceneView.Initialize method and set multisampleCount and supersamplingCount. To change the MSAA and SSAA, call SceneView.Resize method.
-
Updated the SceneView.Resize method that has all the parameters optional so you can update only the parameters that you want, for example, change multisample could and supersample count.
-
Improved ModelUtils.PositionAndScaleSceneNode method so that it does not produce an invalid transformation when it is called on SceneNode without a valid bounding box.
-
Improved handling of ErrorOutOfDate and ErrorSurfaceLost results that indicate that the current present surface is not valid anymore.
-
Set the default value of WaitForVSync to true.
-
Fixed updating LocalBoundingBox and WorldBoundingBox on MeshModelNode after the mesh is manually updated by calling UpdateMesh method.
-
Improved using BoundingBox.Undefined for BoundingBox when the mesh is empty.
-
Removed adjustForSupersamplingFactor parameter from GetRayFromNearPlane and GetRayFromCamera. This parameter is not needed because the x and y coordinates from SharpEngineSceneView and SceneView are not multiplied by super-sampling factor. Methods with that parameter will still work, but they are marked as obsolete.
-
Added AdditionalInstanceLayers list to EngineCreateOptions. It can be used to enable additional instance layers.
-
Use only 1 SwapChain image (instead of 2) when using SharedTexture or WritableBitmap. When rendering and presenting to a surface, the SwapChain images count is defined from the surface's images count min and max value. This also changes the default value of the EngineCreateOptions.PreferredSwapChainImagesCount to 1.
-
Updated BitmapTextSample by adding an option to align the text to the camera (so the text always faces the camera) and an option to set the text size in screen space coordinates (define how large the text will look on screen regardless of the camera's zoom level).
-
Added IsVulkanBackend property to SharpEngineSceneView in Ab4d.SharpEngine.AvaloniaUI.
-
Added initial support for Uno platform.
v2.1.9028-beta1
This is an intermediate beta version that uses Ab4d.SharpEngine v2.1.9028-beta1 with the following new features (compared to v2.0):
- Added GpuStagingBuffer class that can do a batch copy of multiple buffers so we wait only once for multiple buffers copy operations. This significantly improves performance of buffer initialization (creating 1000 pyramids each with its own mesh takes now 15ms instead of 200ms).
- Added MeshUtils.CreateSmoothShadedMesh and MeshUtils.CreateFlatShadedMesh methods that can convert any mesh to a smooth shaded mesh (without any hard edges) or a flat shaded mesh (all edges are hard).
- Improved generating edge lines - in some cases GetEdgeLines method generated too many edge lines (for example after Boolean operations) or to few edges (for example after slicing the mesh with a plane).
- Fixed copying data to GPU memory on some Android emulators.
- Fixed LineSelectorData that can produce invalid results when some of the lines are completely behind the camera.
- Improved performance of LineSelectorData when the whole line is behind the camera - in this case the screen space positions are not calculated. Also added a new property IsBoundingBoxBehindTheCamera.
- Added a new overload to LineSelectorData.GetClosestPositionOnLine method that takes screenPosition (mouse 2D position) as a parameter.
- Updated setting memory type index when creating shared texture for WPF and Avalonia applications on Windows.
- Added support for devices that use non-coherent memory (some older Android and older iMac devices).
- Added support for VK_EXT_device_fault extension. This can provide some additional information on device lost on devices that support that extension.
- Improved performance of copying rendered texture to CPU (used for PresentationType = WritableBitmap or for SceneView.RenderToGpuImage).