Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Prefab previews and shaders

Discussion in 'Scripting' started by DryerLint, Jul 30, 2019.

  1. DryerLint

    DryerLint

    Joined:
    Feb 7, 2016
    Posts:
    45
    I've written a custom point cloud shader that requires some uniforms (vectors representing the screen frustum) to be passed to it before a frame can be rendered properly. Typically, I would do this in MonoBehavior.OnPreRender().

    All of the Prefabs that depend on this shader have non-existent preview images. Is there any way I could override the preview rendering with my own custom solution, or at least access the preview camera's equivalent to OnPreRender()?

    I speak of the preview window that usually appears immediately below the Inspector area when examining Prefabs or other Mesh-based objects.

    Thanks!
     
unityunity