diff --git a/libs/rs/rsProgramFragment.cpp b/libs/rs/rsProgramFragment.cpp index 0adce75cb430b..6cf64a4ecf33f 100644 --- a/libs/rs/rsProgramFragment.cpp +++ b/libs/rs/rsProgramFragment.cpp @@ -56,6 +56,11 @@ void ProgramFragment::setupGL(const Context *rsc, ProgramFragmentState *state) glEnable(GL_TEXTURE_2D); if (rsc->checkVersion1_1()) { + if (mPointSpriteEnable) { + glEnable(GL_POINT_SPRITE_OES); + } else { + glDisable(GL_POINT_SPRITE_OES); + } glTexEnvi(GL_POINT_SPRITE_OES, GL_COORD_REPLACE_OES, mPointSpriteEnable); } glBindTexture(GL_TEXTURE_2D, mTextures[ct]->getTextureID()); diff --git a/libs/rs/rsScriptC_Lib.cpp b/libs/rs/rsScriptC_Lib.cpp index 5b19f178db0ae..d10076b2db0ca 100644 --- a/libs/rs/rsScriptC_Lib.cpp +++ b/libs/rs/rsScriptC_Lib.cpp @@ -800,6 +800,12 @@ static void SC_shininess(float s) glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, s); } +static void SC_pointAttenuation(float a, float b, float c) +{ + GLfloat params[] = { a, b, c }; + glPointParameterfv(GL_POINT_DISTANCE_ATTENUATION, params); +} + static void SC_hsbToRgb(float h, float s, float b, float* rgb) { float red = 0.0f; @@ -1185,6 +1191,8 @@ ScriptCState::SymbolTable_t ScriptCState::gSyms[] = { "void", "(float, float, float, float)" }, { "shininess", (void *)&SC_shininess, "void", "(float)" }, + { "pointAttenuation", (void *)&SC_pointAttenuation, + "void", "(float, float, float)" }, { "uploadToTexture", (void *)&SC_uploadToTexture, "void", "(int, int)" },