Giter Club home page Giter Club logo

Comments (13)

hrydgard avatar hrydgard commented on August 20, 2024

Yes, this should absolutely be done. Is there some nice crossplatform way to do it?

from ppsspp.

soywiz avatar soywiz commented on August 20, 2024

I know there is glut. But don't know if it has api for offscreen rendering.
On C# I used OpenTK, that did already all the work. Maybe reading some parts of the source would help.
But I dont think there will be a crossplatform way. But offscreen rendering would be useful just on desktop platforms: mac, linux and windows.
To initializate a context on windows you use wgl api and on linux glx.
http://www.opengl.org/wiki/Programming_OpenGL_in_Linux:_GLX_and_Xlib
http://www.gamedev.net/topic/613994-question-about-opengl-initialization-for-offscreen-rendering/

from ppsspp.

unknownbrackets avatar unknownbrackets commented on August 20, 2024

I took a quick stab at this:

https://github.com/unknownbrackets/ppsspp/compare/headless

But I guess the harder part is comparing the results? I mean, I assume we want to have some acceptable level of variance or something, but maybe not...?

Edit: also, native spits all kinds of stuff out to stdout too, making the python script less than entirely happy.

-[Unknown]

from ppsspp.

unknownbrackets avatar unknownbrackets commented on August 20, 2024

So, what about using ImageMagick's compare? I know it's an external dependency, but it's often available and easy to install on Windows. We could then maybe define in the test (perhaps printf("Allowed variance: X\n"); or something) how correct it must be?

-[Unknown]

from ppsspp.

hrydgard avatar hrydgard commented on August 20, 2024

Sounds good to me, although we could also simply add some basic image comparer to PPSSPP itself, you could send in the picture to compare to as an argument. We can already load PNGs and comparing is just a matter of looping through the pixels and computing some sort of error sum and then thresholding it...

from ppsspp.

unknownbrackets avatar unknownbrackets commented on August 20, 2024

Well, comparing it directly is fine, I'm just worried about the error sum / threshold part.

unknownbrackets/ppsspp@hrydgard:master...screenshot

I took a stab at it, but I'm obviously doing it wrong. Copying the vram gets me black (which is what it does in the emulator), and glReadPixels() didn't work either (but I probably used it wrong, I just used GL_BACK.)

I have verified it's actually drawing... at least, I can see things if I set WINDOW_VISIBLE to true.

-[Unknown]

from ppsspp.

unknownbrackets avatar unknownbrackets commented on August 20, 2024

Have this working now, I just need to clean it up a bit and write a few clean tests to validate it's working properly.

-[Unknown]

from ppsspp.

hrydgard avatar hrydgard commented on August 20, 2024

Cool!

from ppsspp.

hrydgard avatar hrydgard commented on August 20, 2024

Btw, we should add an option in PPSSPP to write the image (and depth buffer etc) back to VRAM properly, it is possible that some game would use the CPU to read the frame or depth buffer, this is especially common with games that want to check if their sun lens flare should be drawn or not by checking the depth buffer at the position of the sun...

Of course this is very expensive so should only be used for games that would really need it.

from ppsspp.

raven02 avatar raven02 commented on August 20, 2024

is it a new feature ? or already implemented but need to toggle for performance wise

from ppsspp.

hrydgard avatar hrydgard commented on August 20, 2024

What we're talking about here is to be able to write GPU test, where we run a little test program on both PSP and PPSSPP and compare the resulting images.

But yes that part (reading back the image from an OpenGL buffer to VRAM) can indeed become a feature with a toggle. I don't know if many games will need it.

from ppsspp.

raven02 avatar raven02 commented on August 20, 2024

I see .thanks for explain it to me . i think you mean to put those depth/color test as an option to toggle .correct me if i'm wrong .

from ppsspp.

Orphis avatar Orphis commented on August 20, 2024

If a game is going to check for the VRAM, they will have to wait that drawing is done and use SIGNAL with SYNC or something similar. We can probably use this at our advantage.

from ppsspp.

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.