8000 vita2d_set_region_clip: use sceGxmColorSurfaceSetClip instead of sceGxmSetRegionClip to have pixel granularity? · Issue #39 · xerpi/libvita2d · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

vita2d_set_region_clip: use sceGxmColorSurfaceSetClip instead of sceGxmSetRegionClip to have pixel granularity? #39

8000
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Lupo511 opened this issue Jan 3, 2017 · 6 comments

Comments

@Lupo511
Copy link
Lupo511 commented Jan 3, 2017

Why does vita2d_set_region_clip use sceGxmSetRegionClip instead of sceGxmColorSurfaceSetClip?
Currently sceGxmSetRegionClip allignes the region to tiles (unless I'm wrong), while sceGxmColorSurfaceSetClip should actually set a per-pixel region.

@xerpi
Copy link
Owner
xerpi commented Jan 3, 2017

I didn't know sceGxmColorSurfaceSetClip existed, feel free to send a PR.

@Lupo511
Copy link
Author
Lupo511 commented Jan 4, 2017

I found out that sceGxmColorSurfaceSetClip only works before you begin the scene, so it's not as useful as I though. Do you want me to still add it as a separate function, as it might have some use?

By the way what I needed was to change the region clip between different draw calls, do you think that modifying the fragment shaders to implement a custom clipping system (discard pixels outside of a region) would be viable?

@xerpi
Copy link
Owner
xerpi commented Jan 13, 2017

We could cache the set_clip call values and then call sceGxmColorSurfaceSetClip before the beginScene().
Yeah discarding on the fragment shaders would also work, but it's too much work imho.

@Lupo511
Copy link
Author
Lupo511 commented Jan 13, 2017

Caching the set_clip calls still wouldn't allow to change the region clip during a scene tough.

@xerpi
Copy link
Owner
xerpi commented Jan 13, 2017

Yeah.. Another option would be using a stencil buffer, but I have no idea how it works.

@Lupo511
Copy link
Author
Lupo511 commented Jan 14, 2017

That is actually a nice idea and seems t be working. I made a pull request (#40) that adds it, see what you think!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0