GithubHelp home page GithubHelp logo

Comments (13)

Vweber73 avatar Vweber73 commented on July 3, 2024 1

I'm sure you will ! You're the man ! :)

from vamigaweb.

mithrendal avatar mithrendal commented on July 3, 2024

@Vweber73

findings...

I have had a very precise picture in GPU renderer (like we see in software renderer) without the distortions seen in the picture above when the texture which is uploaded to the GPU has the same size as the display area i.e. narrow or standard ...

using an exact integer fraction of the shaders texture size also works e.g. texture has 720px width then 320px width display area is ok too but not 322px width ...

solution 1

whenever user changes display area or when borderless or viewport tracking changes display area automatically we may initialize a new texture buffer... currently one very big buffer is initially created and reused and the GPU scales the display area ... but not so precisly ...

solution 2

I bet my shader programming is not so good ... maybe when we use integers instead of floats here ?

vAmigaWeb/mainsdl.cpp

Lines 152 to 177 in 1024a74

void set_texture_display_window(const GLuint program, float hstart, float hstop, float vstart, float vstop)
{
const float x1 = hstart / HPIXELS;
const float x2 = hstop / HPIXELS;
const float y1 = vstart / VPIXELS;
const float y2 = vstop / VPIXELS;
const GLfloat coords[] = {
x1,y1, x2,y1, x1,y2, x2,y2
};
printf("%f %f %f %f\n",x1,x2,y1,y2);
GLuint corBuffer;
glGenBuffers(1, &corBuffer);
glBindBuffer(GL_ARRAY_BUFFER, corBuffer);
glBufferData(GL_ARRAY_BUFFER, sizeof(coords), coords, GL_STATIC_DRAW);
GLint corAttrib = glGetAttribLocation(program, "a_texcoord");
glEnableVertexAttribArray(corAttrib);
glVertexAttribPointer(corAttrib, 2, GL_FLOAT, GL_FALSE, 0, 0);
glUniform2f(glGetUniformLocation(merge, "u_diw_size"), hstop-hstart, vstop-vstart);
printf("w=%f h=%f\n",hstop-hstart,vstop-vstart);
}

from vamigaweb.

Vweber73 avatar Vweber73 commented on July 3, 2024

Great findings ! But although I am proficient in C/C++/Java programming, I lack the video knowledge to help...

from vamigaweb.

mithrendal avatar mithrendal commented on July 3, 2024

I am also not an gpu shader expert only understand the very basics… 😬but I am sure we will solve this, no?

from vamigaweb.

mithrendal avatar mithrendal commented on July 3, 2024

some articles for reference which are describing our problem

https://colececil.io/blog/2017/scaling-pixel-art-without-destroying-it/
https://jorenjoestar.github.io/post/pixel_art_filtering/

from vamigaweb.

mithrendal avatar mithrendal commented on July 3, 2024

more findings
when I use GL_LINEAR filtering then pixels are correct size for all display sizes but it gets blurry

image

maybe still better then current situation ?

from vamigaweb.

Vweber73 avatar Vweber73 commented on July 3, 2024

Well... The ultimate goal is the real thing ! :)

from vamigaweb.

mithrendal avatar mithrendal commented on July 3, 2024

fixed 😎

image

from vamigaweb.

Vweber73 avatar Vweber73 commented on July 3, 2024

Congrats !!
Btw, restoring a snapshot does not restore anything in the parameters - not only the clock, but not the memory settings. Makes it a bit confusing...
Cheers

from vamigaweb.

mithrendal avatar mithrendal commented on July 3, 2024

yes I know ... do you think we should reset the parameters in the settings dialog according to the loaded snapshot ? but then the loaded settings from the snapshot should not be persisted as default values, which are loaded on next cold start of vAmigaWeb right ?

from vamigaweb.

mithrendal avatar mithrendal commented on July 3, 2024

could you make a new issue and describe the concept of how it should be to be less confusing ?

we close this now ok ? If something strange with GPU shader shows up we just reopen ...

from vamigaweb.

Vweber73 avatar Vweber73 commented on July 3, 2024

Yes, just make them the parameters as long as the snapshot leaves, for consistency...
Cheers

from vamigaweb.

Vweber73 avatar Vweber73 commented on July 3, 2024

Yes let's close this one.

from vamigaweb.

Related Issues (20)

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.