Kode / Kha

Ultra-portable, high performance, open source multimedia framework.
http://kha.tech
zlib License
1.48k stars 174 forks source link

Problems with default graphics target on Windows 11 #1380

Closed smallfx closed 2 years ago

smallfx commented 2 years ago

Describe the bug

Example code here: https://github.com/smallfx/kha_issues

I am on Windows 11, and I'm experiencing some weirdness with the default graphics targets when compiling for Windows. Anecdotally this was also observed on Windows 10 after upgrading to a recent version of Kha, although I can't test that anymore because I upgraded to 11.

For the default graphics target, drawing images with g2 is blurry despite bilinear being set to false on the g2. (There is a slight darkening effect which is demonstrated here as a contrast to the OpenGL problem detailed below.)

(It should also be noted that I am using a custom g2 (aptly named CustomG2) to more closely replicate my engine's setup and to have a custom useCanvas function. In my engine it is also used to add additional things to the vertex structure by default, etc.)

To Reproduce Steps to reproduce the behavior:

  1. Be on Windows (I am on Windows 11)
  2. In CMD or Windows Terminal, cd to the kha_issues cloned git repo directory.
  3. Run node <KHA_DIRECTORY>\Tools\khamake\khamake.js --run
  4. Witness the following behavior (bilinear filtering despite bilinear being false in CustomG2 and thus using PointFilter) (NOTE: the darkening effect here is desired. It is related to another issue for which the example kha_issues git repo is also used) スクリーンショット 2021-12-04 160826

Expected behavior It is expected that the image would be rendered with the PointFilter and not be bilinearly-filtered.

Execution Environment:

Build time: 0m 39s Starting Kinc Initializing a new default audio device. Falling back to the system's preferred WASAPI mix format. Starting application


- Application output (if it runs): no output, it just runs.
RobDangerous commented 2 years ago

Hu, can't reproduce that, works fine for me. Why is the build output printing Using Kinc (git-error)?

smallfx commented 2 years ago

@RobDangerous This question made me dig a bit deeper and tl;dr: I fixed the issue by actually properly re-cloning the entire Kha repo.

The git-error is because I was running it from Windows Terminal which doesn't have access to my Windows git stuff. If I run it from the git-bash shell, that line turned into this:

Using Kinc (d5cb7ce4) from C:\Users\jaxyn\Documents\GAMEDEV\Kha\Kinc   

Which I understood is not the version used in the current version of the Kha main branch.

So I spent a little bit of time figuring out why my submodules seemed to be out of sync and... now everything is totally fixed and the point filtering works as expected. Sorry for the entirely-my-fault issues! 😅 Thanks for following up quickly on them regardless!