Giter VIP home page Giter VIP logo

Comments (11)

fincs avatar fincs commented on August 10, 2024

So it should be left, top, right, bottom then (assuming Y points down).

from libctru.

Lectem avatar Lectem commented on August 10, 2024

@fincs I'm not sure left,top,right,bottom is right, especially since we're mostly working on sideway buffers.

from libctru.

machinamentum avatar machinamentum commented on August 10, 2024

The command is loosely based on glScissor. x,y specify the lower left corner of the box so 0,0 is the very bottom-right of the screen because of the sideways framebuffer then x1 and y1 specify the upper-right corner (unlike glScissor) of the box. Arguably, you could make it left, bottom, right, top, however, I advise against this as it implies a specific interpretation of how the command is used considering some developers will rotate their scene to accommodate the sideways framebuffer while others may choose to make their game sideways oriented.

from libctru.

fincs avatar fincs commented on August 10, 2024

Please remember that the physical screens are sideways, not the framebuffer. The physical scanlines are vertical instead of horizontal. Note that it is perfectly possible to use rendered output as a texture - the output should not be tilted.

from libctru.

machinamentum avatar machinamentum commented on August 10, 2024

Ah I see, then I'd agree to left, bottom, right, top as the parameters.

from libctru.

fincs avatar fincs commented on August 10, 2024

Is it confirmed that Y points up, as in the actual behavior of this PICA command?

from libctru.

machinamentum avatar machinamentum commented on August 10, 2024

I can confirm this. Transferring the GPU output directly to the screen gives these results:
GPU_SetScissorTest(GPU_SCISSOR_NORMAL, 120, 200, 240, 400);
Top-left quarter of the screen is visible. top-right, bottom-right, bottom-left are excluded.

GPU_SetScissorTest(GPU_SCISSOR_NORMAL, 0, 0, 120, 200);
Bottom-right quarter of the screen is visible. Bottom-left, top-left, top-right are excluded.

from libctru.

Lectem avatar Lectem commented on August 10, 2024

Those are my notes for the 3DS axes :

LCD :

240
x
^
|
|
|
|
|
+------------------>y 400(320)

(0,0)

displays only with z in [-1.0,0.0]

gpu with setViewPort(0,0,240,400)

(1.0,1.0)             x 
   +   -   -   -   -  ^ 1.0
                      |
   |                  |
                      |
   |                  |
  y<------------------+
 1.0            (-1.0,-1.0)     

Textures :

   (0,0)                1.0
     +------------------>u
     |
     |
     |
     |
     |  
 1.0 V
   v

from libctru.

Lectem avatar Lectem commented on August 10, 2024

@ic3water : this issue has nothing to do with it. If you need help for the IES parser open an issue on the IES parser repo.

from libctru.

uschmann avatar uschmann commented on August 10, 2024

Is this method actually working? I tried to use it in the simple_tri example and it has no effect.
I modified the main loop like this:

while (aptMainLoop())
    {
        gspWaitForVBlank();  // Synchronize with the start of VBlank
        gfxSwapBuffersGpu(); // Swap the framebuffers so that the frame that we rendered last frame is now visible
        hidScanInput();      // Read the user input

        // Respond to user input
        u32 kDown = hidKeysDown();
        if (kDown & KEY_START)
            break; // break in order to return to hbmenu

        // Render the scene
        gpuFrameBegin();
        GPU_SetScissorTest(GPU_SCISSOR_NORMAL, 0, 0, 20, 20);
        sceneRender();
        gpuFrameEnd();
        gpuClearBuffers(CLEAR_COLOR);

        // Flush the framebuffers out of the data cache (not necessary with pure GPU rendering)
        //gfxFlushBuffers();
    }

I expected that only a part of the triangle should be drawn. But in the result the method call has no effect.

from libctru.

uschmann avatar uschmann commented on August 10, 2024

Ignore my last comment. It works in real Hardware. Scissortest is mit yet implemented properly in citra.

from libctru.

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.