Tag Archives: Graphics rendering

How to Solve UE Shader develop error

As far as I can observe, the UE is generally loaded to 39%-45% when the compilation of the Shader will be carried out, but due to our sometimes negligent, often write shader with errors, resulting in the UE directly crash without prompting error messages, given that only the ConsoleVariables.ini file needs to be configured.

original:

[Startup]
; Uncomment to get detailed logs on shader compiles and the opportunity to retry on errors
;r.ShaderDevelopmentMode=1
; Uncomment to dump shaders in the Saved folder
; Warning: leaving this on for a while will fill your hard drive with many small files and ...

After modification:

[Startup]
; Uncomment to get detailed logs on shader compiles and the opportunity to retry on errors
r.ShaderDevelopmentMode=1
; Uncomment to dump shaders in the Saved folder
; Warning: leaving this on for a while will fill your hard drive with many small files and ...

Can’t you see the change? Pay attention

r.ShaderDevelopmentMode=1

Removed the “;” in front, This is the difference. In this way, when we write the shader, it will directly tell us what errors are, which will greatly help us eliminate errors, such as undefined variables (written incorrectly due to negligence).

[Solved] headless pyrender offscreen render Error: OpenGL.error.GLError: GLError(err = 12296,

Error description

When running vibe, the CentOS server without display is used. When using pyrender for off screen rendering, errors are reported OpenGL.error.GLError: GLError(err = 12296), as follows:

Traceback (most recent call last):
  File "demo.py", line 416, in <module>
    main(args)
  File "demo.py", line 278, in main
    renderer = Renderer(resolution=(orig_width, orig_height), orig_img=True, wireframe=args.wireframe)
  File "***/VIBE/lib/utils/renderer.py", line 60, in __init__
    point_size=1.0
  File "***/anaconda3/envs/vibe-env/lib/python3.7/site-packages/pyrender/offscreen.py", line 31, in __init__
    self._create()
  File "***/anaconda3/envs/vibe-env/lib/python3.7/site-packages/pyrender/offscreen.py", line 134, in _create
    self._platform.init_context()
  File "***/anaconda3/envs/vibe-env/lib/python3.7/site-packages/pyrender/platforms/egl.py", line 177, in init_context
    assert eglInitialize(self._egl_display, major, minor)
  File "***/anaconda3/envs/vibe-env/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 409, in __call__
    return self( *args, **named )
  File "***/anaconda3/envs/vibe-env/lib/python3.7/site-packages/OpenGL/error.py", line 232, in glCheckError
    baseOperation = baseOperation,
OpenGL.error.GLError: GLError(
        err = 12296,
        baseOperation = eglInitialize,
        cArguments = (
                <OpenGL._opaque.EGLDisplay_pointer object at 0x7f883a03a170>,
                c_long(0),
                c_long(0),
        ),
        result = 0
)

Solution

Ubuntu: https://pyrender.readthedocs.io/en/latest/install/index.html#installmesa Use OSMesa to offscreen render.

It is more convenient to use · CONDA · to install osmesa as follows:

conda install osmesa

Note: after installing osmesa, reinstall pyopengl, otherwise an error will still be reported, as follows:

pip uninstall pyopengl
git clone https://github.com/mmatl/pyopengl.git
pip install ./pyopengl

Specify PYOPENGL_PLATFORM before running the scriptis osmesa , as follows:

# demp.py
import os
# os.environ['PYOPENGL_PLATFORM'] = 'egl'
os.environ['PYOPENGL_PLATFORM'] = 'osmesa'

Note: os.environ[‘PYOPENGL_PLATFORM’] = ‘osmesa’ should ideally follow import os to ensure that PYOPENGL_PLATFORM is changed to osmesa before using render, or you can explicitly specify os.environ before using render specifically [‘PYOPENGL_PLATFORM’] = ‘osmesa’.