Hi,
uniformname " for the “location” value I pass in.
uniformname " to “glGetUniformLocation”, I get back the exact “location” value.
mkandula2012-08-22 20:32:01
Hi,
can I get some update about this ?
Hi Madan,
Ok I've looked at the code with one of my colleagues, and we came to the
conclusion that the simplest fix is to check if the uniform locations found are
-1, and try again with the value with [0] appended. There's currently no way to
track if a uniform is an array value in the PFX code, but it's something we'll
look into adding specifically for a future release, which will allow us to do
this a bit more selectively.
To do the same fix in the tools on your end, you'll need to look at the file
"PVRTPFXParserAPI.cpp", lines 815 and 518. Add the following code and
it should just work:
// Check for array.
Workaround for some OpenGL:ES implementations which require array element
appended to uniform name
// in order to
return the correct location.
if(nLocation == -1)
{
char szTmpUniformName[2048];
strcpy(szTmpUniformName, pszName);
strcat(szTmpUniformName, "[0]");
nLocation = glGetUniformLocation(m_uiProgram, szTmpUniformName);
}
You’ll
also need to do the same if you choose to get uniform locations manually. Hope
that helps!
Thanks,
Tobias
Hi Tobias,
© Imagination Technologies Limited. All rights reserved.
Privacy Policy – Terms & Conditions – Trademarks – Cookies