Coder Social home page Coder Social logo

Comments (9)

cursey avatar cursey commented on June 3, 2024

The precision of positioning when using d2d.* is lower than when using draw.*. On videos below the health bar is drawn using draw.world_to_screen(monster.position). Using those coordinates in d2d.fill_rect gives pretty shaky results while draw.filled_rect is drawn smoothly.

This is entirely because d2d updates at a lower rate than the draw API (currently hardcoded to update at 30hz). The rationale for this is simple. Many overlays do quite a bit of work in their draw functions and can cause a non-negligible performance impact for users if ran every single frame.

I plan on making the rate at which d2d updates user configurable, I just didn't get to it in time for first release.

The quality of text is also seems lower.

You're using a different font so I can't tell what you mean. Can you show a clear example of how the quality is lower?

If you want to do a direct comparison, install Roboto Medium on your computer and use that for REFramework-D2D to really compare the results.

from reframework-d2d.

cursey avatar cursey commented on June 3, 2024

The precision of positioning when using d2d.* is lower than when using draw.*. On videos below the health bar is drawn using draw.world_to_screen(monster.position). Using those coordinates in d2d.fill_rect gives pretty shaky results while draw.filled_rect is drawn smoothly.

Fixed in 2da8447. Make sure to copy the new /scripts/autorun/reframework-d2d.lua over so you can configure the max update rate yourself. The default has been increased to 60hz though (instead of 30hz).

(Also maybe rename fill_rect to filled_rect to match one from imgui?)

Fixed in 9a55217

I've also improved error handling and fixed the freezing issue in abfdda2.

Let me know if this addresses all the reported issues for you.

from reframework-d2d.

cursey avatar cursey commented on June 3, 2024

The quality of text is also seems lower.

I think I've probably fixed this in 0edfaf9.

from reframework-d2d.

GreenComfyTea avatar GreenComfyTea commented on June 3, 2024

I see. As always thank you for your hard work. I automatically assumed it is at least 60Hz so didn't think of from that perspective. Allowing user to configure it is a good choice.
Improvement suggestion: maybe add auto refresh rate option: when enabled refresh rate matches the refresh rate of the screen (or the game)?

Font quality (on the old version):
roboto_font = d2d.create_font("Roboto", 13, true):
(should i be passing "Roboto Medium" or "Roboto-Medium" or "RobotoMedium"?)
image
roboto_font = d2d.create_font("Roboto", 13, false):
image

Idk something feels off. For example the top of t is slightly blurred on d2d bold font.

Performance note: Drawing 50-100 small monster UIs caused me 1 fps drop (from 96 to 95) on old version (30Hz) on gtx1070.
https://imgur.com/a/8q8FFzs

from reframework-d2d.

cursey avatar cursey commented on June 3, 2024

Font quality (on the old version): roboto_font = d2d.create_font("Roboto", 13, true): (should i be passing "Roboto Medium" or "Roboto-Medium" or "RobotoMedium"?) image roboto_font = d2d.create_font("Roboto", 13, false): image

Idk something feels off. For example the top of t is slightly blurred on d2d bold font.

I think its user preference at that point. I personally prefer the plugins output in your example (both bold and regular). I'm a big fan of DirectWrite output though so I may be biased.

from reframework-d2d.

GreenComfyTea avatar GreenComfyTea commented on June 3, 2024

I am fan of DirectWrite too. But doesn't imgui uses DirectWrite too? I would have expected same results.

I think its user preference at that point.

You are right about this thou xD

from reframework-d2d.

cursey avatar cursey commented on June 3, 2024

But doesn't imgui uses DirectWrite too? I would have expected same results.

imgui uses stb_truetype which is a very simple (compared to DirectWrite) font rasterizer.

from reframework-d2d.

GreenComfyTea avatar GreenComfyTea commented on June 3, 2024

Fair enough. I have no more complaints xD

from reframework-d2d.

cursey avatar cursey commented on June 3, 2024

Improvement suggestion: maybe add auto refresh rate option: when enabled refresh rate matches the refresh rate of the screen (or the game)?

This can be accomplished by just setting the max update rate to 300 (or any rate higher than their normal framerate). Assuming people don't hit 300 FPS, it will just run as fast as their FPS.

from reframework-d2d.

Related Issues (8)

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.