Renderscript is a type of C scripting language on the Android platform. Although Google has been using this technology in the built-in dynamic wallpaper of previous Android versions to implement 3D graphics effects, but it has never been integrated into the public release SDK. As of Android, renderscript technology has been integrated into the SDK. developers can develop 3D applications based on renderscript in eclipse and run them on tablets later than Android.
Renderscript is a 3D runtime framework. It provides APIs for constructing 3D scenarios and optimizes performance to the maximum extent. It also supports platform-independent shade languages. Developers can not only use renderscript technology to develop 3D applications, but also use it for specific high-performance data processing.
For details about renderscript, see SDK:
Http://developer.android.com/guide/topics/renderscript/index.html
Http://developer.android.com/guide/topics/renderscript/graphics.html
Http://developer.android.com/guide/topics/renderscript/compute.html
This article mainly sorts out the features of renderscript In the SDK, and will continue to discuss how to use renderscript for application development in the future.
RenderscriptAdvantages:
(1) Portability: renderscript is designed to run on your types of devices withdifferent CPU and GPU ubuntures. it supports all of thesearchitectures without having to target each device, because thecode is compiled and cached on the device at runtime.
(2) Portability: renderscript is designed to run on your types of devices withdifferent CPU and GPU ubuntures. it supports all of thesearchitectures without having to target each device, because thecode is compiled and cached on the device at runtime.
(3) usability: renderscript simplifies development when possible, such aseliminating JNI glue code and simplifying mesh setup.
RenderscriptLimitations:
(1) Portability: renderscript is designed to run on your types ofdevices with different CPU and GPU ubuntures. it supports Allof these ubuntures without having to target each device, because the code is compiled and cached on the device at runtime.
(2) debugging visibility: renderscript can potentially execute (planned feature for later releases) on processors other than themain CPU (such as the GPU), so if this variable, debugging becomesmore difficult.
(3) less features: renderscript does not provide as your features asopengl such as all the compressed texture formats or GL extensions.
RenderscriptThe application consists of three layers:
(1) Native renderscript Layer
Thenative renderscript layer consists of your renderscript code, whichis compiled and executed in a compact and well defined runtime. yourrenderscript code has access to a limited amount of functions becauseit cannot access the ndk or standard C functions, since they must beguaranteed to run on a standard CPU. the renderscript runtime wasdesigned to run on different types of processors, which may not bethe CPU, so it cannot guarantee support for Standard C libraries. what renderscript does offer is an API that supports intensivecomputation and graphics rendering with a collection of math andgraphics APIs.
(2) reflected Layer
Thereflected layer is a set of classes that the android build toolsgenerate to allow access to the native renderscript code from theandroid VM. this layer defines entry points for renderscriptfunctions and variables, so that you can interact with them with theandroid framework. this layer also provides methods and constructorsthat allow you to allocate memory for pointers that are defined inyour renderscript code.
(3) Android framework layer
Theandroid framework layer consists of the usual Android framework APIs, which include the renderscript APIs inandroid.renderscript. This layer handles things such as the activity lifecycle and memorymanagement of your application. it issues high level commands to thenative renderscript code through the reflected layer and receivesevents from the user such as touch and input events and relays themto your renderscript code, if needed.
RenderscriptInstance:
<sdk_root>/samples/android-11/RenderScript.