Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

Render Mode: Canvas VS WebGL

Discussion in 'Project Tiny' started by De-Panther, Dec 7, 2018.

  1. De-Panther

    De-Panther

    Joined:
    Dec 27, 2009
    Posts:
    499
    So far Project Tiny looks great - I like the implementation of ECS in the Hierarchy.

    But as the Documentation still in progress, I wonder about the Render Modes - Canvas and WebGL.
    What is the different between those two modes?
    They both run using asm.js?

    Does Sprite2DRenderer use Mesh(Quad) on WebGL and CanvasRenderingContext2D.drawImage on Canvas?
    I wonder if we can use the same wrappers as Sprite2DRenderer in the Tiny Package for rendering more complex shapes.
     
  2. sebastianm_unity

    sebastianm_unity

    Unity Technologies

    Joined:
    May 3, 2018
    Posts:
    21
    You are correct, Canvas uses the old HTML5 Canvas API, and should only be used if your target platform does not support WebGL. The both use the same asm ECS.
    The current renderers are monolithic, they do only abstract to the Sprite level and do not expose meshes or shaders to user code. Mainly in order to support the canvas target.
    Future versions of Tiny (with 3D) will support a more scriptable rendering abstraction, but that will not be supported on Canvas targets.
     
  3. De-Panther

    De-Panther

    Joined:
    Dec 27, 2009
    Posts:
    499
    Thanks.
    Theoretically, a developer can edit the Tiny package code and add wrappers for MeshRenderer in the same way that SpriteRenderer is wrapped? Or is it requires also changes on the Unity Editor compiled code?
     
  4. sebastianm_unity

    sebastianm_unity

    Unity Technologies

    Joined:
    May 3, 2018
    Posts:
    21
    Tiny uses it's own custom renderer separate from Big Unity. There is no MeshRenderer involved - the only API for rendering is through the ECS. The editor side maps those components to Big Unity rendering for editing only - at runtime it's completely different.
     
    De-Panther likes this.
unityunity