4
votes

I'm using ThreeJS for an application I'm developing at work, in particular the WebGL renderer. It was working fine about a week and a half ago, but when I came back to work today I'm getting this error when trying to run my application in Chrome:

Uncaught TypeError: Object # has no method 'getShaderPrecisionFormat'

I debugged my application in Chrome and it looks like the WebGLRenderingContext has no method 'getShaderPrecisionFormat'; any suggestions as to what may have happened to lead to this?

Thanks!

2
Have a look at this thread and see if it helps you see what happened. It lead to some changes in webGLRenderer.js. - WestLangley

2 Answers

1
votes

This should be fixed in r56+. (And possibly in r55, but I don't have a version of it to check)

See https://github.com/mrdoob/three.js/blob/master/src/renderers/WebGLRenderer.js#L7478

        if ( _gl.getShaderPrecisionFormat === undefined ) {

            _gl.getShaderPrecisionFormat = function() { 

                return {
                    "rangeMin"  : 1,
                    "rangeMax"  : 1,
                    "precision" : 1
                };

            }
        }
0
votes

Are you sure that you haven't overwritten renderer.context because else you'll have to show some code because I haven't gotten a single clue for now??