Nice. Thanks for trying it out.
Matt
Nice. Thanks for trying it out.
Matt
Hi @matt
I’ve updated my NVIDIA graphics driver and I have same results. However, I’m noticing the Graphics Demo runs smoother with Direct2D (but I still have better performance with Software render).
This is the report you asked for:
DxDiag.txt (128,6 KB)
Hi @juan1979 -
Thanks for sending the report.
It looks like your computer has two display adapters - an Intel HD Graphics 630 and an GeForce 1050 Ti. I suspect that the Direct2D demo app is using the Intel adapter instead of the GeForce.
Do you have a straightforward way to switch between display adapters? If not, you can go into the Windows Graphics settings and tell Windows to use the GeForce adapter for the Direct2D Demo app.
Let me know how it goes-
Matt
I see, my bad! I switched to the 1050Ti and now my Paint durantion is around 3.3ms, the Paint interval is 17.1 ms with Direct2D ![]()
I’m not sure what they mean, but the Paint duration is now the half using Direct2D. The Paint interval remain the same. Thanks!
Excellent!
The paint interval should stay about the same; that’s just how often the window is repainting.
Paint duration is how long the CPU is taking to paint the frame. Smaller is better.
I’m looking into seeing how the graphics adapter can be set from within the app.
Matt
We’re currently collaborating with Matt to get this new renderer into the JUCE repository.
There are a few changes required on the JUCE side of things to make everything operate as expected, and a few remaining issues with the renderer. At the moment it looks like it should be possible to address all the important problems and we’re working our way through them.
Windows 8.1 is an easier minimum deployment target than Windows 7 SP1 and the first public preview will likely remain incompatible with Windows 7 whilst we experiment.
Brilliant!
This is fantastic news! Thanks Matt for your hard work and the JUCE team for collaborating.
Amazing work and news!
Amazing! I’m experiencing roughly a fourfold performance increase.
This is the feature I’ve been eagerly waiting for, and it’s finally here.
THANKS !
Is anyone else seeing a periodic stutter? The frame rate is stratospheric on my 3070ti with everything butter-smooth but every say 0.8 seconds or so there a visible stutter - most noticeable on the rotating graphic demos. Could it be a vsync thing?
@matt Fantastic work. This is the stuff dreams are made of.
Thanks for the kind words! I’m traveling to ADC 23; I’ll post a response to your question and an update shortly.
Matt
I’m at ADC this week; when I get back home let’s see about capturing an event trace from your machine and see if we can sort out that stutter.
Matt
Hi everyone-
I’ve been working with the JUCE team on Direct2D integration. We’ve made a lot of progress; however, unsurprisingly, there have been a few complications.
The biggest issue so far has been ensuring that GDI-based and OpenGL-based plugins continue to work as expected. Finding a solution that supported alpha-blended, fully transparent windows for Direct2D, GDI, and OpenGL proved to be quite challenging, but I think we’ve finally arrived at an approach that performs well, supports child windows with mixed rendering modes, and provides full support for existing plugins.
We also need a native Direct2D Image class that supported DPI scaled images in VRAM; that’s working, but needs to be integrated with JUCE.
We’re hashing out the remaining issues; we still need to tackle cached geometries, which should be a significant performance boost, along with some other ancillary image handling and DPI scaling problems. I’m not in a position to promise when the integration will be done with any certainty; we’re running into the end-of-year holidays and the JUCE team are grappling with many other challenging problems besides this particular project.
I’ll be at ADC 2023 tomorrow; I’m Matt Gonzalez on the ADC Discord if anyone wants to chat.
Matt
Unrelated - I’ve been trying to think of how to showcase the new renderer. I put together a quick demo showing multiple spectra rendering at 3440x1440 at 60 Hz:
But I know there’s more that could be done. So I figured I’d throw it open the the community - where could we go from here? What can we do with the new renderer?
Matt
I’m sure it could play Crysis! ![]()
![]()
Hmmm…
Hey there, I tried to use Matt’s fork of the JUCE repo, and managed to build my app using it.
First of all, I hit a problem in the juce_Direct2DGraphicsContext_windows.cpp file, precisely in the createFont() function, where the dynamic_cast fails returning a nullptr.
I hacked a quick fix just to get things going:
void createFont()
    {
        if (currentFontFace == nullptr)
        {
            auto typefacePtr = font.getTypefacePtr();
            auto get = typefacePtr.get();
            //cast failing here
            auto* typeface = dynamic_cast<WindowsDirectWriteTypeface*> (get);
            //hack fix
            if (typeface == nullptr) {
                SharedResourcePointer<Direct2DFactories> factories;
                typeface = new WindowsDirectWriteTypeface(font, factories->systemFonts);
            }
            currentFontFace = typeface->getIDWriteFontFace();
            fontHeightToEmSizeFactor = typeface->getUnitsToHeightScaleFactor();
        }
    }
I construct a new typeface and manage to compile but there are few wrong/weird behaviours, first noticeable thing is that the renderer is not capable of rendering gradient fills anymore, but the main important issue is when trying to resize the window, which creates visual artifacts and messes up the whole component resizing,
I tried a mix of settings of the 2 macros described in matt’s repo to see if they would make any change but nothing happened. This is what I have now:
        JUCE_DIRECT2D=1
        JUCE_DIRECT2D_PARTIAL_REPAINT=0
        JUCE_WAIT_FOR_VBLANK=0;
Here are some screenshots of what happens to the app.
If i make the window BIGGER the content is not resized properly and goes out of the window bounds
When shrinking instead the opposite happens, although the repainting is not handled properly thus showing multiple instances of the app UI.
I have set the Direct2d renderer in the mainWindow constructor as instructed in the repo.
Hope this can be of any interest for you, and also hoping to get some feedback as the direct2d rendering is something of great interest for us.
Thanks for trying it out and for reporting your results.
I need to bring that repo up to date; I’ve been working with the JUCE team to finish the remaining work, but of course we’ve run into various issues and use cases I didn’t consider previously.
I just spent the last few days reworking the image caching code, so this might be a good stopping point. Give me a few days to sort that out and I’ll see about updating the public repo.
In the meantime I’ll try to reproduce your issues on my side.
Matt