Search Unity

  1. 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

[RELEASED] Camera Projection Rendering Toolkit (Non-linear perspectives, oblique projections, SSAA)

Discussion in 'Assets and Asset Store' started by Melcx, Jul 14, 2017.

  1. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,286
    Hey @Melcx ,

    I'm absolutely loving the tool. It's working great.

    One thing I'm getting in Unity 2017.3.1f1 is a warning when CPRT is enabled:
    OnRenderImage() possibly didn't write anything to the destination texture!

    When I disable CPRT, the warning stops. Any idea how to stop this from generating each frame?

    Thanks!
     
  2. Melcx

    Melcx

    Joined:
    Mar 22, 2016
    Posts:
    31
    Hi @Tryz,

    Sorry for the late reply.
    This warning is a known issue and has no real impact on the released game (it is just logged in the editor and in Debug builds).
    The problem is I don't use a classic rendering method (I'm "redirecting" the rendering from one buffer to another to have access to higher resolution), and Unity think nothing seems to be drawn on the render texture. I've not found a way to remove this warning yet.
    However, it is only logged a few times in my test scenes. I'm not sure how you end up getting this warning every single frame. Could give me more details about your implementation please ? (this might be related to repeated enabling/disabling of a camera or RenderTexture / resolution changes).

    Best regards
     
  3. sasob8

    sasob8

    Joined:
    Jul 11, 2017
    Posts:
    8
    Hey @Melcx,

    Your script is limited to 160 fov? I need a solution for about 240 fov.
    For now i made camera rig with 5 cameras (45 fov, 1920x1200) with overlapping, so final resolution will be 6000x1200 (panorama style - cylindrical). I render to a texture with a recorder, so i don't need real time performance.
    It would be so much easier if i could do it with one camera. Especaially cause of post effect (some of them are repeating, cause of 5 cameras).

    Can it be done with your tool? If not, do you plan to update?

    Thank you
     
  4. Melcx

    Melcx

    Joined:
    Mar 22, 2016
    Posts:
    31
    Hello @sasob8,

    Sorry to disappoint but you wont be able to achieve that with CPRT. It is limited to 160 FOV because you get an anomaly around 180, and the way it works, it can't technically go over 180 with a single camera (it just wouldn't work because that's a limitation of the classic 3D APIs). Trying to go over 180, FOV would require an entirely different technique and it would probably be a terrible idea to base it on CPRT. That would strictly be a different plugin, which couldn't even be used on the Unity rendering engine.

    About your issue at hand, the way you're approaching it is good. Maybe you should try to split your post fx ? You could keep applying the ones not causing issue as you're doing right now, and try to delay the problematic ones to a later stage, on the final composing rendering (ie : bloom can be done that way if you keep the HDR format). I don't know if that's going to help you out but I don't have any other idea at the moment.

    Best of luck with your project,
    Regards
     
    Last edited: Aug 28, 2018
  5. skyecrack

    skyecrack

    Joined:
    Jan 5, 2018
    Posts:
    29
    Hey @Melcx have you taken a look at this?

    Also example
    Just stumbled upon it, looks like it would be really easy to implement, with only drawback being either having to write custom tessellation shaders or just increasing polygon count on all of the meshes from the start, but even with that the performance gain would be massive over what we currently have here. Moreover, combine that with SSAA and voila, you actually benefit from supersampling under 2x :D
     
    AlanMattano likes this.
  6. Melcx

    Melcx

    Joined:
    Mar 22, 2016
    Posts:
    31
    As you said, Vertex Displacement for linear projection is an option and could give pretty good results on screen with not too shabby performances (of course, it would vary depending on the project)

    That said, doing so wouldn't be about helping configure camera and rendering, but about applying vertex shaders for every single 3D object.
    On my side I'd have to create shaders for every custom projection and replace all the corresponding unity standard shaders, and on the user side, if a single object doesn't have that new shader type, the rendering would lose its coherence (that would make using external plugins very tedious). Moreover, you'd have multiple technical issues : ie Surface Shaders and Unity Shadows which aren't meant to work in that way.

    Again, thank you for showing such an interest in the development of this plugin, but this is way out of scope for what I intended to do at the beginning, and would require too much time and effort on my part for it to be worthwhile.
     
  7. Yumby

    Yumby

    Joined:
    Aug 17, 2012
    Posts:
    13
    I'm getting a strange linker error with CPRT when compiling in XCode using Unity 2018.2.14f1. If I don't include CPRT.cs, CPRTFrustrumUpdater.cs and CPRTHelper.cs, everything builds fine. With those files included, everything runs fine in the editor but when trying to compile in XCode, I'm getting:

    ld: symbol(s) not found for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    Odd since this plugin is provided as source code.
     
    Last edited: Mar 1, 2019
  8. Melcx

    Melcx

    Joined:
    Mar 22, 2016
    Posts:
    31
    Sorry, I don't have an Apple setting to test that precise use case.
    That said, from what I can see, this error shows up because the compiler doesn't find a "static extern function", which is strange since I didn't use any in my plugin. It must be used indirectly by something outside of CPRT.
    Could you give me more information on this error ? If you look in the log, you should find a line which would tell me which function isn't supported. Something like : << Symbol: _OBJC_CLASS_$_[AnyFunctionName] >> or << "_OBJC_CLASS_$_[AnyFunctionName]" referenced from : >>

    Also, while I was checking online to see if someone else had had a similar issue, I found that some of them solved their problems by upgrading their 3rd party frameworks, so you may want to try this.

    Finally, could you try to test this with an updated version of Unity ? The current version is 2018.3.f6. You could even try 2018.2.20 if you want to stay on the ".2 series" for whatever reason.

    Cheers.
     
  9. philspitlerSF

    philspitlerSF

    Joined:
    Oct 10, 2018
    Posts:
    30
    Hi, does this plugin work on iOS ?

    I have a new iPad and would love to use this plug on my 360 video in Unity

    Cheers

    Phil
     
  10. Melcx

    Melcx

    Joined:
    Mar 22, 2016
    Posts:
    31
    Hello @philspitlerSF

    As mentioned in my previous answer, I don't have any apple device to test this so I can't say for sure. However what I can do is refund you if you find out that the plugin doesn't work at all for you. Just let me know by mail.

    Cheers and a happy new year to all of you :)
     
    Last edited: Jan 6, 2020
  11. philspitlerSF

    philspitlerSF

    Joined:
    Oct 10, 2018
    Posts:
    30
    I will answer my own question here in case others are curious.

    It works great so far in iOS.
     
    AlanMattano likes this.
unityunity