Giter Site home page Giter Site logo

rolandkoenig / seeingsharp2 Goto Github PK

View Code? Open in Web Editor NEW
58.0 5.0 2.0 22.37 MB

Seeing# is a 3D/2D rendering library for C# powered by Direct3D. It is meant for desktop applications (Win.Forms, Wpf, WinUI) or Windows Store Apps

License: Other

C# 98.98% HLSL 0.93% PowerShell 0.09%
3d-engine csharp direct3d direct3d11 directx dotnet winforms winui winui3 wpf

seeingsharp2's Introduction

Hi there πŸ‘‹

  • πŸ”­ I'm Roland KΓΆnig
  • 🏒 I'm working as a freelance software architect and trainer
  • ✏️ I focus on projects based on C# / .NET and TypeScript
  • πŸͺ§ I'm a co-organizer of Digital Craftsmanship Nordoberpfalz
  • πŸ““ I'm writing regularly on my (german) blog about coding topics
  • πŸ“« You can reach me on LinkedIn
  • πŸŒ„ I love hiking
  • ✈️ I love traveling

For open source projects I typically use the following conventions:

  • See my default C# coding conventions here
  • See my default repository conventions here

seeingsharp2's People

Contributors

lucawun avatar mariolung avatar rolandkoenig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

seeingsharp2's Issues

.Net Maui

Will this be able to work on .net maui?

Great project!

UWP issue

Hi.

So I was trying to use the SeeingSharpRenderPanel in a UWP application but nothing comes up. I followed the WinUI getting started guide, I could not find one for UWP but also looked at the UWP sample. I did install the SeeingSharp2 and SeeingSharp2.UWP packages, I also called the GraphicsCore.Loader.SupportUWP() method in the App.cs file but the cube is not showing up.

Am I missing something or could there be an issue?

Renderloop.Register2DDrawingLayerAsync does not response if called from main thread

Hi,
I've wrote a simple helper class to integrate SeeingSharp2 into my WPF application. however the render loop never starts. after debugging my code, I found the loop.Register2DDrawingLayerAsync() does not return.
Thanks for your help.

Init code (MainWindow.xaml.cs)
private void Window_Loaded(object sender, RoutedEventArgs e) { if (DesignerProperties.GetIsInDesignMode(this)) { return; } CtrlRender.RenderLoop.PrepareRender += RenderLoop_PrepareRender; (DataContext as MainViewModel).D2DRenderHelper.Init(CtrlRender.RenderLoop); }

Class definition

`public class D2DRenderHelper where T:RunContext
{
private List<Action> drawCommands = new List<Action>();
private object drawSync = new object();
public async Task Init(RenderLoop loop)
{
drawCommands.Clear();
try
{

            await loop.Register2DDrawingLayerAsync(new Custom2DDrawingLayer(drawInternal));
            Debug.WriteLine("init complete"); // this method was never called
        }
        catch (Exception)
        {

            throw;
        }
        
    }

    private void drawInternal(Graphics2D graphics)
    {
        lock (drawSync)
        {
            foreach (var item in drawCommands)
            {
                item(graphics);
            }
        }
    }

    public void UpdateCommands(T context)
    {
        
    }
}`

WinUI Nupackage is referencing out dated WinUI framework, which prevents latest WinUI3 project to be build

I found the SeeingSharp2.WinUI is referencing ProjectReunion 0.5, seems it's an out dated library and the build template is blocking project build.

Repro Steps:

  1. Create a new WinUI3 project with VS2022(Blank App, Packaged),Target Framework=.NET 6.0
  2. Add nuget package "SeeingSharp2.WinUI" To project
    Expected result:
    Project able to build
    Actual Result:
    Project build fail with error
    "Severity Code Description Project File Line Suppression State
    Error Improper project configuration: WindowsPackageType is set to None, but AppxPackage is set to true. WinUI3_Test1 C:\Users\qijian.nuget\packages\microsoft.projectreunion.winui\0.5.0\buildTransitive\Microsoft.Build.Msix.Packaging.targets 122
    "

    "Severity Code Description Project File Line Suppression State
    Error NETSDK1022 Duplicate 'Page' items were included. The .NET SDK includes 'Page' items from your project directory by default. You can either remove these items from your project file, or set the 'EnableDefaultPageItems' property to 'false' if you want to explicitly include them in your project file. For more information, see https://aka.ms/sdkimplicititems. The duplicate items were: 'MainWindow.xaml' WinUI3_Test1 C:\Users\qijian.nuget\packages\microsoft.windowsappsdk\1.0.0\build\Microsoft.WinUI.targets 60 "

WARP sample?

First, I shall thank you for sharing this.
This library claims to support WARP. However, I failed to find a sample that shows how to generate an image without actually using a device.
Can one actually generate an image from a console application?
All the samples I found seem to rely on render loops and screenshots.

AssimpImporter texture mapping (obj/mtl)

Is this library able to map textures imported by AssimpImporter?
I can't seem to load a model in obj format which has a correctly mapped texture (png).
I already tried multiple different models and file formats but even the sample project (ModelViewer) doesnt respect my textures inside the .mtl file.
I notice that the mtl correctly gets loaded into the render resources (as the #Resources counter goes one up when including the material), but still no image (only the gray model).
β€Ž
This is what my mtl file looks like:

newmtl TextureMaterial
map_Kd skin.png

And im loading my model with this code:

loadedModel = await GraphicsCore.Current.ImportersAndExporters.ImportAsync(modelLink, importOptions);
await renderLoop.Scene.ImportAsync(loadedModel);

β€Ž
Its no problem to texture some custom meshes but how would you texture an entire model?
This is the code I am using to texture a simple cube:

await renderLoop.Scene.ManipulateSceneAsync(manipulator =>
{
    var resTexture = manipulator.AddTextureResource(LoadedTexure);
    var resMaterial = manipulator.AddStandardMaterialResource(resTexture);
    var resGeometry = manipulator.AddResource(d => new GeometryResource(new CubeGeometryFactory()));

    var mesh = new Mesh(resGeometry, resMaterial);
    manipulator.AddObject(mesh);
});

β€Ž
Im sorry if I am missing something or if this is a useless question but Im kinda stuck on this.
Also a quick note: This project is amazing! It runs smooth, has animation support and is quite easy to use. Thank you for your effort.

HoloLens support.

I mentioned this some time ago, I would be interested in adding HoloLens support to your lib. Would this be of interest? There are currently very few options other than Unity for the HoloLens, so I think this could be interesting.

How to import .obj file ?

Hello !

Before update 9.2 I was importing obj file like this :

var importer = new AssimpImporter();
importer.ImportModel("model.obj", new ImportOptions() { });

await BaseScene.ImportAsync(importer);

But since 9.2, the public -> internal change of AssimpImporter break that scenario, and :
await GraphicsCore.Current.ImportersAndExporters.ImportAsync support only stl and ac.

Error message when importing obj : No importer found for file type obj

Also, texture where not mapped to the 3D model.

Is there any way to import .obj file ?

Thank you !

Flickering Refresh Issue

Hello !
I have an issue with the 3D viewer, any time I try to move or rotate in the scene, the whole scene gets updated 1/5 of the time with a lot of lag (the bug still appears for version 0.8 and 0.9 ). I don't manage any event on top or on the 3D viewer itself that could cause that kind of systematic refresh. The way it flickers is whenever I move, the scene gets whipped out and everything appear suddenly after ). I have the latest nvidia graphic driver, rtx 3070 on laptop.

I have a previous version of my software that worked perfectly and suddenly the bug appears with no changes to the program.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.