Search Unity

Problem of using multiple scripts attcahed to camera containing OnPostRender()

Discussion in 'Image Effects' started by Ramphic, Nov 16, 2017.

  1. Ramphic

    Ramphic

    Joined:
    Jun 21, 2017
    Posts:
    60
    Hi,
    I am using one free asset in my project which has OnPostRender() function in script attached to camera. I am also using compute shader in my project where I need to pass compute buffer data to material in OnPostRender() in another script attached to camera , and I have another script related to Vive lens which also has OnPostRender() .

    Now the problem is, if asset script component is disabled for the camera, my compute shader vertices are coming at correct positions, vive lens script is also working correct. If asset script component is enabled, compute shader vertices positions are changed , and data is rendered only to one eye related to functionality in vive lens script.

    I am having this problem in my project (of Unity 2017.2.0 version) which is virtual reality enabled, with single pass stereo, and the asset is also upgraded to use with Unity 2017.2.0.

    Will there be any problem in using multiple scripts containing OnPostRender() attached to camera? Does the order of attaching these as components to camera matter, in virtual reality enabled projects.

    Why it's happening, and what is the way to solve it ??