Comments (11)
So it should be left, top, right, bottom then (assuming Y points down).
from libctru.
@fincs I'm not sure left,top,right,bottom is right, especially since we're mostly working on sideway buffers.
from libctru.
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.
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.
Ah I see, then I'd agree to left, bottom, right, top as the parameters.
from libctru.
Is it confirmed that Y points up, as in the actual behavior of this PICA command?
from libctru.
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.
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.
@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.
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.
Ignore my last comment. It works in real Hardware. Scissortest is mit yet implemented properly in citra.
from libctru.
Related Issues (20)
- Performance issue in font.c HOT 5
- sys/lock.h: No such file or directory HOT 3
- GDB Debugging Issue: using 'c' and then pressing CTRL + C in GDB points to wrong file HOT 2
- How to easily play sound effects with ndsp?
- romfsMountFromTitle error HOT 1
- nfcCmd21 / nfcCmd22 HOT 2
- Memory access out-of-bounds while using std::cout HOT 1
- MEMREGION_APPLICATION : MemRegionUsed and MemRegionSize return the same value, MemRegionFree returns 0 HOT 1
- If homebrew is launched directly after NSMB 2, GPU commands aren't being executed anymore HOT 1
- Where is sockaddr_in6 defined? HOT 4
- Global macros clash with other things
- Socket connections fail to work if DHCP just assigned IP this boot HOT 3
- Latest libctru makes app crash on exit HOT 1
- shaderInstanceInit doesn't initialize numFloat24Uniforms if no constant table is present
- Document alignment requirements for ndspWaveBuf
- DmaConfig's DmaDeviceConfig flags and structure reversed in terms of src/dst
- PTM:CheckNew3DS is wrong
- NDSP apparently over-reads data on short sound effects
- GPU Command Buffer Causes Crash When Filled/Overran HOT 1
- 1. In included file: 'sys/lock.h' file not found [pp_file_not_found] HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libctru.