Example #1
0
 public CustomShaderManager(GVRContext gvrContext) {
   final GVRMaterialShaderManager shaderManager = gvrContext.getMaterialShaderManager();
   shaderId = shaderManager.addShader(R.raw.vertex, R.raw.fragment);
   GVRMaterialMap customShader = shaderManager.getShaderMap(shaderId);
   customShader.addUniformVec3Key("u_color", COLOR_KEY);
   customShader.addTextureKey("u_texture", TEXTURE_KEY);
 }
Example #2
0
  public PhongShader2(GVRContext gvrContext) {
    final GVRMaterialShaderManager shaderManager = gvrContext.getMaterialShaderManager();
    mShaderId = shaderManager.addShader(VERTEX_SHADER, FRAGMENT_SHADER);
    mCustomShader = shaderManager.getShaderMap(mShaderId);
    mCustomShader.addUniformVec4Key("u_color", COLOR_KEY);
    mCustomShader.addUniformVec3Key("u_light", LIGHT_KEY);
    mCustomShader.addUniformVec3Key("u_eye", EYE_KEY);
    mCustomShader.addUniformFloatKey("u_radius", RADIUS_KEY);
    mCustomShader.addTextureKey("intexture", TEXTURE_KEY);

    mCustomShader.addUniformVec4Key("u_mat1", MAT1_KEY);
    mCustomShader.addUniformVec4Key("u_mat2", MAT2_KEY);
    mCustomShader.addUniformVec4Key("u_mat3", MAT3_KEY);
    mCustomShader.addUniformVec4Key("u_mat4", MAT4_KEY);
  }
  public TransparentButtonShaderThreeStates(GVRContext gvrContext) {
    final GVRMaterialShaderManager shaderManager = gvrContext.getMaterialShaderManager();
    mShaderId = shaderManager.addShader(VERTEX_SHADER, FRAGMENT_SHADER);
    mCustomShader = shaderManager.getShaderMap(mShaderId);
    mCustomShader.addTextureKey("texture", TEXTURE_KEY);

    mCustomShader.addTextureKey("textureHover", TEXTURE_HOVER_KEY);
    mCustomShader.addTextureKey("textHoverTexture", TEXTURE_TEXT_HOVER_KEY);

    mCustomShader.addTextureKey("textUpperTexture", TEXTURE_TEXT_UPPER_KEY);
    mCustomShader.addTextureKey("textHoverUpperTexture", TEXTURE_TEXT_HOVER_UPPER_KEY);

    mCustomShader.addTextureKey(TEXTURE_TEXT_SPECIAL_KEY, TEXTURE_TEXT_SPECIAL_KEY);
    mCustomShader.addTextureKey(TEXTURE_TEXT_HOVER_SPECIAL_KEY, TEXTURE_TEXT_HOVER_SPECIAL_KEY);

    mCustomShader.addTextureKey("textTexture", TEXTURE_TEXT_KEY);
    mCustomShader.addUniformFloatKey("opacity", OPACITY);
    mCustomShader.addUniformFloatKey("textureSwitch", TEXTURE_SWITCH);
  }