Search Unity

Recorder Writting Exr Files With Time Based Shader Are Wrong

Discussion in 'Cinemachine' started by kFreezer, Apr 15, 2019.

  1. kFreezer

    kFreezer

    Joined:
    Mar 15, 2019
    Posts:
    29
    Hi everyone,

    I'm working on a film project done with unity and I'm investigating into the Unity recorder to do EXR exports and I noticed that my time based water shader was way too fast than it should be.

    In my test I'm rendering an image sequence at 4K 24fps 16:9, which gives me 0.5 fps in the Game View because of the time to write the exr files.

    I assume the rendered water shader is too fast because the game clock is running even if i'm stuck at 0.5 fps. So is there a way to render something like this without a time node but with something that takes in account the framerate I'm rendering at?

    What would be great is that the recorder records the result I get when I'm running the sequence in Game Mode without recording.

    Thanks

    [edit] I'm using the Unity 2018.3.2
     
  2. jasonm_unity3d

    jasonm_unity3d

    Unity Technologies

    Joined:
    Mar 2, 2017
    Posts:
    41
    I've not played with "time based shaders" but here is some info that might help you out.

    When recording, there is a setting that allows yo to state if you want a fixed frame rate, in the output, or not. When you do activate it, Unity's clock gets incremented by 1/fps at each frame.

    for this to work, it means that all simulations must use this adjusted clock as it's source, it cannot use it's own source (say audio DSP for example).

    The time source to use are:
    - Time.time (https://docs.unity3d.com/ScriptReference/Time-time.html)
    - Time.fixedTime (https://docs.unity3d.com/ScriptReference/Time-fixedTime.html)

    using anything else to seed your shader will have time drift for certain.

    hope this helps,
    -J
     
  3. kFreezer

    kFreezer

    Joined:
    Mar 15, 2019
    Posts:
    29
    Hi thanks for the reply,

    Now my problem is that I don't code at all and that I've done the shader with shadergraph. Sadly it seems like there's only the Time node with the following values: upload_2019-4-16_10-27-37.png
    I understand what you mean but I don't see how to achieve this with the shadergraph. Yesterday I fake fixed my issue by reducing the speed of the water but it isn't a good way to work as I must guess the speed

    So I'm going to dig into what you gave me and see if I can achieve this within the shadergraph
     
  4. kFreezer

    kFreezer

    Joined:
    Mar 15, 2019
    Posts:
    29