Code Monkey home page Code Monkey logo

texture2dtest's Introduction

Texture2DTest

Test repo that solves non-blocking loading of large images constructed as Texture2Ds in Unity 3D for Android.

How it works:

  • There is a single scene called Texture2DTest with a single Button for loading and setting the Texture2D on the flat plane.
  • Running the scene and clicking on the “LOAD” text will call a function from the DeviceGallery.cs script.
  • The script grabs the first image it can find on an Android device to create the Texture2D from an Android device, uses the C++ plugin to create the underlying OpenGL texture, then sets it on the flat plane through the “SelectImage” script.
  • A counter on the top left shows the frame-rate, so you can see that it doesn’t really dip during the Loading process.

Note:

  • The project will only build and run correctly on an Android Device (not in the Editor), because we’re making use of a C++ plugin built for Android to solve the problem.
  • Download the free open-source software Blender in order for the the project to build correctly: https://www.blender.org/download/

C++ Plugin:

  • To edit the C++ code first open the CppPlugin folder with Android Studio 2.2, edit the "androidcppnative.cpp" file in the IDE, and then hit the build button at the top. This will create a few shared object files that live in "/Texture2DTest/CppPlugin/app/build/intermediates/cmake/debug/obj”, you can then just copy over the appropriate "libandroidcppnative.so" into the correct folder within "/Texture2DTest/Assets/Plugins/Android/libs".

texture2dtest's People

Contributors

arthur-fox avatar

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.