fix some issues with the webgl renderer
Merge pull request #4999 from gero3/FixRenderer

fix some issues with the webgl renderer