Version: 2017.2
Depuración y la resolución de problemas de construcciones WebGL
WebGL Networking (redes)

Gráficas WebGL

WebGL is an API for rendering graphics in web browsers, which is based on the functionality of the OpenGL ES graphics library. WebGL 1.0 roughly matches OpenGL ES 2.0 functionality, and WebGL 2.0 roughly matches OpenGL ES 3.0 functionality.

Deferred Rendering

Unity WebGL only supports Deferred Rendering Path if WebGL2.0 is available. On WebGL1.0, Unity WebGL runtime will fallback to Forward Rendering.

Global Illumination

Unity WebGL solamente soporta baked GI. El GI en tiempo real actualmente no es soportado en WebGL. Adicionalmente solamente los lightmaps No-direccionales son soportados.

Procedural Materials

Unity WebGL no soporta Procedural Materials en tiempo de ejecución. Como en cualquier otra plataforma no soportada, los Procedural Materials serán baked a Materiales común y corrientes durante la construcción.

Linear Rendering

Unity WebGL only supports linear color space rendering with WebGL 2.0. Linear color space rendering doesn’t have fallback support for WebGL 1.0. To build a WebGL player using linear color space rendering, you need to remove WebGL 1.0 API in Player Settings > Other Settings; uncheck Automatic Graphics API.

Some web browsers don’t support sRGB DXT texture compression. This can decrease the quality of rendering performance when using linear rendering, due to runtime decompression of all the DXT textures.

MovieTextures (Texturas de película)

WebGL no soporta actualmente la reproducción de video utilizando la clase MovieTexture. Sin embargo, usted puede eficientemente reproducir video de vuelta en su contenido WebGL utilizando el elemento video de HTML5. Descargue este Asset Store package para un ejemplo de cómo hacerlo.

Restricciones del código Shader de WebGL

La especificación WebGL 1.0 impone algunos limites en el código shader GLSLS, el cual está más restringido que lo que la mayoría de las implementaciones OpenGL ES 2.0 permite. Esto es más relevante cuando usted escribe sus propios shaders.

Específicamente, WebGL tiene restricciones en aquellos valores que serán utilizados como indices de arreglos o matrices: WebGL solamente permite un indexado dinámico con expresiones constantes, indices de bucles o una combinación. La única excepción es para un acceso uniforme en vertex shaders, el cual puede ser indexado utilizando cualquier expresión.

También, las restricciones aplican en el control de estructuras. El único tipo de bucles los cuales son permitidos son los bucles for, dónde el inicializador inicializa una variable a una constante, la actualización agrega una constante o resta una constante de la variable, y la prueba continua compara la variable a la constante. Los bucles for que no coincidan con estos criterios y los bucles while no están permitidos.

Renderización de fuentes

Unity WebGL soporta la renderización dinámica de fuentes como cualquier otra plataforma de Unity. No obstante, no tiene acceso a las fuentes instaladas en la maquina del usuario, por lo que cualquier fuente utilizada debe estar incluida en la carpeta del proyecto (incluyendo cualquier fuente fallback para caracteres internacionales, o versiones itálica/negrilla de las fuentes), y configuradas con nombres de fuentes fallback.

Anti-Aliasing

WebGL supports anti-aliasing on most (but not on all) combinations of browsers and GPUs. To use it, anti-aliasing must be enabled in the default Quality Setting for the WebGL platform.

Note that on WebGL1.0 there are several limitations:

  • Switching quality settings at runtime will not enable or disable anti-aliasing - it has to be set up in the default Quality Setting loaded at player start up.

  • The different multi sampling levels (2x, 4x, etc..) have no effect in WebGL, it’s either on or off.

  • Any post-processing effect applied to the camera disables the built-in Anti-Aliasing.

  • HDR is not compatible with anti-aliasing so make sure “Allow HDR” camera option is disabled.

There are no such limitations on WebGL2.0.

Reflection Probes

Los Reflection probes se soportan en WebGL, pero debido a limitaciones en la especificación de WebGL acerca de rendering a mipmaps específicos, los reflection probes en tiempo real suaves no se soportan (por lo que los reflection probes en tiempo real siempre generan reflexiones agudas, lo cual podría parecer de muy baja resolución). Los Reflection probes en tiempo real suaves requerirán WebGL 2.0.

Soporte a WebGL 2.0 (Experimental)

Unity includes support for the WebGL 2.0 API, which brings OpenGL ES 3.0-level rendering capabilities to the web.

By default, Unity WebGL builds support both WebGL 1.0 and WebGL 2.0 APIs, This can be configured in the WebGL Player Settings > Other Settings; to do this, uncheck Automatic Graphics API.

When WebGL 2.0 is supported in browsers, content can benefit from a better quality in the Standard Shader, GPU Instancing support, directional lightmap support, no restrictions on indexing and loops in shader code, and better performance.


  • 2017–06–19 Page amended with limited editorial review

  • Linear rendering for WebGL 2.0 added in 2017.2 NewIn20172

Depuración y la resolución de problemas de construcciones WebGL
WebGL Networking (redes)