Skip to main content

Ready to market your stellar app?

Samsung Developer Program is your gateway to app monetization success.

Learn More

Samsung Developer Program

Render Data

 The render data component is what makes a scene object visible. It provides both geometry and appearance properties. The geometry is a single GVRMesh object which contains a set of indexed vertices. The appearance is a GVRMaterial object which contains a set of key/value pairs defining the variables to be sent to the shader. The shader is a program that executes on the GPU. During rendering, GearVRf manages data flow between your application and the GPU, sending the meshes and materials to the GPU as they are needed. This may require GearVRf to compile and load a shader into the GPU while your application is running. This may happen when you add something to the scene using GVRScene.addSceneObject. The render data component also controls how your mesh is rendered. You can enable or disable lighting, display an object only on one eye and control the order of rendering using its functions. 


GVRRenderData Function



Enable light sources in the shader


Disable light sources in the shader


Enable / disable alpha blending


Enable / disable alpha to coverage


Enable / disable backface culling


Designate back or front faces for culling


Enable / disable depth testing (Z buffer)


Designate triangles, lines or points


Designate rendering left, right or both eyes


Establish rendering order


Specifies coverage of modification mask


Designates whether modification mask is inverted


Designate the mesh to render


Specify material properties for shader


Establish shading model to use



Render Passes

A render pass lets you render the same scene object multiple times with different settings. This is useful to achieve effects like cartoon rendering or adding glow around an object. The benefit of using a render pass as opposed to duplicating the object is that culling, transformation and skinning are only performed once. A render pass encapsulates the material and rendering properties (but not the mesh).

This example shows how to implement a multi-sided material using render passes. It uses a red material for the front faces and a blue material for the back faces.


GVRSceneObject cube = new GVRCubeSceneObject(gvrContext);

GVRRenderData rdata = cube.getRenderData();

GVRMaterial red = rdata.getMaterial();

GVRMaterial blue = new GVRMaterial(gvrContext);

GVRRenderPass pass = new GVRRenderPass(gvrContext);

red.setDiffuseColor(1, 0, 0, 1);

blue.setDiffuseColor(0, 0, 1, 0);








  • Was this article helpful?