Code Monkey home page Code Monkey logo

pigs-in-a-blanket's Introduction

Development Halted

Superceded by PVR_PSP2


Original README.md

Development Time

Pigs In A Blanket | OpenGL ES 2.0 on the PS Vita by CBPS

A Piglet/ShaccCg Wrapper Library for OpenGL ES 2.0 Support on the Vita

Now with System App and Experimental MSAAx4 Support!


Compiling

With VDSuite

  • Install VDSuite
  • Install Taihen
  • Run cmake . -Bbuild -G Ninja (Recommend Ninja)
  • cd build and ninja install
  • Link libpib.a in your projects

With VitaSDK

  • Install VitaSDK
  • Run vdpm taihen to install libtaihen_stub
  • Run make -j4 install USE_VITASDK=1
  • Link libpib.a in your projects

Note when building your projects:

ALWAYS COMPILE YOUR PROJECTS WITH UNSAFE. Doing otherwise will result in PIB failing.

With VitaSDK you can specify the SceLibc heap size by defining sceLibcHeapSize in your code:

unsigned int sceLibcHeapSize = 2 * 1024 * 1024;

Piglet needs an SceLibc heap size of at least 2MB to intialize. Without it, the module will fail to start. This heap needs to be larger if using -nostdlib as this becomes your main heap. More info on -nostdlib support in the headers.

You'll need to link your program with:

  • libpib.a
  • liblibScePiglet_stub.a
  • libSceShaccCg_stub.a
  • libtaihen_stub.a
  • libSceAppMgr_stub.a

For DolceSDK, you'll also need:

  • libSceSharedFb_stub.a
  • libSceGxmInternalForVsh_stub.a
  • libSceGxmInternal_stub.a

Check the "Samples" folder for examples of how to use PIB to initialize OpenGLES 2.0 with EGL or GLFW.

Yes. We have a GLFW3 port for the vita. You can use it by simply including it in your project as normal or build it here: https://github.com/SonicMastr/glfw-vita
Note: Button mapping is perfect and there's full touchscreen support.

To install Piglet on your Vita, just use the Pigs in a Blanket Configuration Tool

Documentation Provided in the Headers. I'm clean.

What is Pigs in a Blanket?

This library is a developer focused wrapper which provides easy initialization and expandability, with some quality of life features, including supporting resolutions up to 1920x1080 native on the Playstion TV, and on the Vita with Sharpscale. Developers can choose make their applications with one resolution in mind, as all long as the code is made to scale by dimension, PIB will handle the rest with it's companion app, the Pigs in a Blanket Configuration Tool, which allows the user to specify their own preference of resultion that will automatically override the original settings. For more information aobut Piglet, you can check out our information about it on our forum post.

It library doubles as the heart of Piglet's Shader compiling abilities, removed in the standalone module. I spent the time to rewrite the shader compiler code according to PSM specifications to re-enable the ShaccCg support that was removed. This includes proper return codes and regular log output, so you never have to wonder what's going on with your shaders. Piglet DOES NOT support GLSL shaders though, so you'll need to convert the shaders to CG. Check the resources at the end of this README for converting your shaders.

This library also support EGL 1.5 eglGetProcAddress functionality using the PIB_GET_PROC_ADDR_CORE flag, as the orignal Piglet only returns extensions per EGL 1.4 standard. Thanks to dots-tb we were able to create a simple patch to support returning GLES functions as well.

Custom Extension Support

This library will allow us to add extensions using native functions as we feel fit. We'll accept the requests of any developers who have ideas of what extensions to add utilizing PIB, and they will all be able to be accessed via eglGetProcAddress.

Supported Extensions

GL EGL
GL_EXT_draw_instanced EGL_SCE_piglet_sync
GL_EXT_instanced_arrays EGL_SCE_piglet_vita_pre_swap_callback
GL_SCE_piglet_shader_binary EGL_SCE_piglet_vita_vsync_callback
GL_SCE_texture_resource
GL_OES_texture_npot
GL_OES_rgb8_rgba8
GL_OES_depth_texture
GL_EXT_texture_format_BGRA8888
GL_EXT_read_format_bgra
GL_OES_texture_half_float
GL_OES_texture_half_float_linear
GL_OES_vertex_half_float
GL_OES_element_index_uint
GL_EXT_texture_compression_dxt1
GL_EXT_texture_compression_dxt3
GL_EXT_texture_compression_dxt5
GL_EXT_texture_compression_s3tc
GL_EXT_texture_storage
GL_IMG_texture_compression_pvrtc

Special Thanks

  • GrapheneCt - Finding the Piglet Module and being a main part of the Project in reverse engineering and testing
  • dots-tb - Initial idea of using PSM and efforts in getting all of the names for Piglet, as well as being a main part of the Project in reverse engineering and testing
  • cuevavirus - Help with debugging and sense of direction
  • CreepNT - Help with debugging
  • Princess-of-Sleeping - Dump tool and PrincessLog
  • xyzz - Initial deep dive into how ShaccCg works
  • Zer0xFF and masterzorag - Their amazing work on the PS4 Piglet reverse engineering

GLSL to CG Conversion Resources

Microsoft GLSL to HLSL: https://docs.microsoft.com/en-us/windows/uwp/gaming/glsl-to-hlsl-reference
Nvidia CG Standard Library: http://developer.download.nvidia.com/cg/index_stdlib.html
Nvidia CG GLSL Vert to CG: http://developer.download.nvidia.com/cg/glslv.html
Nvidia CG GLSL Frag to CG: http://developer.download.nvidia.com/cg/glslf.html

This requires both libshacccg.suprx and libScePiglet.suprx to be located in ur0:data/external

pigs-in-a-blanket's People

Contributors

bythos14 avatar cpasjuste avatar fgsfdsfgs avatar fmudanyali avatar sonicmastr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pigs-in-a-blanket's Issues

Possible Source Engine port

Hello there! I dont know how contact you because i dont find an email, so i wrote here. Feel free to delete this if is not relevant.
Recently a user called nillerusr release here on github a working port of source engine to android, making half life 2 and portal working on all android smartphone.
Apparently it can use gles 2.0 or gles 1.0
It will be awesome if someone will port it to ps vita making half life 2 playable in this console and I think that your port of gles for vita can do this job
Here the source of source engine port.
Have a good day :)

Relicense under the LGPL 3.0 and add Classpath exception

Currently, Pigs in a Blanket uses the regular GPL 3.0 license.

However, it would make more sense to use the LGPL 3.0 license.
This would allow more projects, open and closed to use the library, without having to relicense to the GPL.

In addition, vitaGL, a similar library to this, is licensed under the LGPL.

It would also make sense to include the Classpath exception:

Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU Lesser General Public License cover the whole combination.

As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.

This would allow the library to be statically linked to non-(L)GPL projects as long as no modifications where made to the library code itself.

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.