Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Feasibility of making a custom renderer to take advantage of special constraints?

Discussion in 'Universal Render Pipeline' started by Creaturtle, Aug 14, 2021.

  1. Creaturtle

    Creaturtle

    Joined:
    Jan 24, 2018
    Posts:
    33
    I'm using URP, and I'm considering looking into making my own renderer (like my own MeshRenderer).

    The motive is that I'm using Tilt Brush art for my VR game, so lots of vertices and strokes with not much GPU left to use, but in the end it's just many long quad strips using small variations of the same material.

    The constraints I have that I think warrant a custom renderer for optimization are:
    • The player can only see within 25 meters using linear fog, and a few pockets of localized regions because I customized my fog formula a bit.
    • The meshes are static, to be baked.
    • Few different materials are used, all unlit, opaque shadergraphs. I'd like to have baked emission in the lightmap if possible
    • All lights are baked, and not too many lights will be used. Depth effects mostly provided by ambient occlusion, while player focus directed with a custom fog system.
    • Everything is a tiltbrush stroke (a quad strip) which should make instancing or batching an option
      • I may be able to reverse-engineer the tilt-brush code (which has been open sourced) to generate the quad sections dynamically
      • LOD could easily be optimized for dynamic vertex generation (done in a compute shader)
    • It is in black and white, so I can pack lots of data into vertex data, and put lots of information in much less data to send to the GPU
    I think I can take advantage of the limited range of stuff I need rendered, the consistent type of meshes rendered, and the consistent tiny pool of materials for some fancy Compute shader-based rendering, with culling, rendering, batching, instancing, and LOD optimizations I couldn't achieve just using the mesh renderer.

    I'd like advice on:

    1. Is this a reasonable task assuming good enough experience in using compute shaders for rendering effects

    2. Could this approach, with the given constraints, theoretically be used for better results than the rendering solutions available