Search Unity

Curved World (OLD) - Screen Space Curvature Shader

Discussion in 'Assets and Asset Store' started by Arkhivrag, Nov 20, 2014.

Thread Status:
Not open for further replies.
  1. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    Last edited: Dec 24, 2014
  2. MinhDao

    MinhDao

    Joined:
    Oct 28, 2013
    Posts:
    155
    Oh my god! I'm late :(
    BTW : Merry Christmas Everyone! :)
     
  3. thoorne

    thoorne

    Joined:
    Jul 22, 2012
    Posts:
    64
    First picture reminds me Inception.
    Amazing work. Purchased and I'm totally satisfied, performance on mobile is excellent.
    However I have one question, how can I manipulate bend size? I tried something like this:
    Code (CSharp):
    1. public VacuumShaders.CurvedWorld.CurvedWorld_GlobalController controller;
    2. ...
    3. controller.xAxisBendSize = 0.1f;
    But aparently xAxisBendSize is not member of that class. Can you help?
     
    Last edited: Dec 27, 2014
  4. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    @thoorne
    Does not Visual Studio or MonoDevelop show public variables ?
    Variables.png


    You can also can get CurvedWorld_GlobalController by static variable ".get"
    Variables_static.png

    Variables inside GlobalController have same names as in shaders but with "_GLOBAL" suffix.



    VacuumShaders - Facebook Twitter YouTube
     
    Last edited: Dec 27, 2014
  5. thoorne

    thoorne

    Joined:
    Jul 22, 2012
    Posts:
    64
    Thanks!
    I'm using Sublime Text so I don't have all those suggestions.
     
  6. Olivierlr

    Olivierlr

    Joined:
    Jul 4, 2014
    Posts:
    14
    I seem to be hitting an issue on iOS (tested on iPad Air2, iPhone6) that I don't face in the Editor: When the world dimension are a bit large (~4000 units), on iOS the curved shader seems to stop curving. The camera far plane is much larger than the world dimensions. I am using the Simple demo project you provided. The issue seems to happen independently of the specific shader chosen from the baked folder or newly baked.

    What I am missing?

    Thanks,



    In the Editor no such issue.
     
  7. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    Last edited: Feb 3, 2015
  8. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    Update v1.1 released
    • Added Image Effects support (restart Unity after importing package)
    • Added mobile terrain shaders (T4M)
    • Added bumped shaders
    • All unlit shaders support IBL, Emission and Lightmapping
    • Baked shaders are about 5x smaller
    • Shaders can be baked on multi-material meshes
    • Fixed mesh bending on iOS
    • Several micro improvements and optimizations




    VacuumShaders - Facebook Twitter YouTube
     
    Last edited: Jan 12, 2015
  9. s_lheureux

    s_lheureux

    Joined:
    Sep 20, 2013
    Posts:
    4
    Great work on the library, it's exactly what we needed on our project and works really well.

    I have a suggestion though. In future releases, it would be useful to have a public API to bake the shaders so we can automate the process. It would make it so we don't miss any shader and accidentally skyrocket memory usage; and it would work nicely with build pipelines.

    I managed to automate it, but my solution is pretty sketchy... An official solution would be much better.

    Thanks!
     
  10. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    Just a little update v1.11
    Added editor API to work with Curved World shaders from custom user scripts. (Info in Readme file)



    VacuumShaders - Facebook Twitter YouTube
     
  11. s_lheureux

    s_lheureux

    Joined:
    Sep 20, 2013
    Posts:
    4
    Wow, that was fast, thanks a lot!

    I noticed a tiny mistake in the doc:
    Where it says "Functions are accessible from VacuumShaders.CurvedWorld", it should be "Functions are accessible from VacuumShaders.CurvedWorld.ShaderBaker".
     
  12. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    wow i wantz it!
     
    Last edited: Jan 9, 2015
  13. coldpizzapunk

    coldpizzapunk

    Joined:
    Aug 20, 2014
    Posts:
    30
    Everything is working great with this asset. Wondering if it works with Lens Flares Components? Since they don't have materials. Or maybe there is a different approach to get the same effect and still work with Curved World. (I'm just trying to add some punch from some of my emissive objects, where bloom isn't cutting it) Thanks so much for a great asset and any assistance!
     
  14. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    @coldpizzapunk
    Thanks for reminding me about lens flares, even they are hardcoded inside Unity engine I have to find some solution to implement them to the Curved World.



    VacuumShaders - Facebook Twitter YouTube
     
  15. vidjo

    vidjo

    Joined:
    Sep 8, 2013
    Posts:
    97
    So how does this work? Can I use other shaders I have to get the look of the model that I want, then use your asset to curve them? Or does the system require me to replace the shaders on my objects with your own shaders?
     
  16. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    For mesh bending Curved World shaders must be used. For custom effects that can not be achieved with included shaders, package contains Curved World shaders templates, which serves as "startup" for desired effect.
    Third part shaders are not supported (it's just imposible).



    VacuumShaders - Facebook Twitter YouTube
     
  17. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    Update v1.12 available
    • Fixed realtime shadows for bumped and terrain shaders



    VacuumShaders - Facebook Twitter YouTube
     
  18. Neiviv

    Neiviv

    Joined:
    Jul 26, 2013
    Posts:
    2
    Hi!

    I just bought your plugin and it works perfectly! Thank you very much for your amazing work!

    I am currently working on an Oculus Rift project, and as you said earlier, your shaders are dependent on camera's orientation.
    As the player can freely look around with an Oculus, it just looks weird to see the level bending.

    Is there a trick to "lock" the bending effect? Or maybe you are working on an update for this? :)

    Best Regards,
    Vivien
     
  19. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    @Neiviv
    Hi, Curved World bends mesh in screen space, it means that bending does not depend on cameras position and rotation in world space - meshes will be bended in any case inside camera view.

    X.png
    Y.png

    What you are asking for "lock bending" and freely observe bend meshes, requires world space mesh bending, Curved World can not handle that.
    The idea of screen space bending is that you have not worry about "world space" game features like: animation, physics, path-finding etc, there work normally and then shader just renders them as bended.



    VacuumShaders - Facebook Twitter YouTube
     
  20. MIK3K

    MIK3K

    Joined:
    Sep 10, 2014
    Posts:
    144
    I've got a quick noobish question (please be gentle, I'm a little slow but trying to learn). When you say that a static mesh needs 8 dead vertices added in a 3D package - I have some meshes made with polyworld inside the Unity editor. Is there a way to do that inside the editor? If not I would just use Blender. The 8 vertices then should be placed at the corners of the bounding box or does their location matter? Thanks.
     
  21. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    @MIK3K
    Curved World package contains script "Bounds corrector" that scales mesh's bounding box to avoid mesh disappearing, but it does not work with static meshes as Unity bakes static meshes into one and script just can not find initial mesh.
    To avoid this you should manually add 8 "dead" vertices to the mesh at the corners of the scaled bounding box. and in Unity mesh optimization should be unchecked (Unity will remove dead/unused vertices).



    VacuumShaders - Facebook Twitter YouTube
     
  22. MIK3K

    MIK3K

    Joined:
    Sep 10, 2014
    Posts:
    144
    Ahh, I think I got it. I will play around with blender. Might even try probuilder inside Unity and see if that can do it because the meshes are all known square sizes. Thank you.

    Edit - I did it in blender but seems to work fine on the same model with or without the 8 vertices with the models marked as static but just adding models in the nav scene. Maybe this is for longer distances or more bending? Anyway, this thing is amazing and very fun!
     
    Last edited: Jan 20, 2015
  23. pepone3d

    pepone3d

    Joined:
    Jul 5, 2012
    Posts:
    27
    Big thanks for the cool shader!

    I run into a problem, cause I have a javascript based project...
    I would like to change the parameters dynamically while playing the game
    (a.e. like X Axis Bend size) so I have to 'talk' to the Curved World_Global Controller...
    which I assume is in Csharp.

    http://www.41post.com/1935/programming/unity3d-js-cs-or-cs-js-access

    So I would move the CurvedWorld_GlobalController Script into the
    StandardAssets or Plugin Folder, so it is 'read' first -
    but how could I access/set the variables I see in the editor from Javacript?

    thanks!
     
  24. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    @pepone3d
    Hi,
    It is not necessary to move Curved World scripts. Inside javascript add "import VacuumShaders.CurvedWorld;" thats all, now you have access to all Curved World scripts and and variables;

    Code (CSharp):
    1. #pragma strict
    2. import VacuumShaders.CurvedWorld;
    3.  
    4. var xValue : float;
    5.  
    6. function Update () {
    7.     CurvedWorld_GlobalController.get._V_CW_X_Bend_Size_GLOBAL = xValue;
    8. }
    Variables inside CurvedWorld_GlobalController have the same name as in shader but with "_GLOBAL" suffix.

    Note: Curved World scripts are highly optimized, so even putting variables update inside Update() function have 0 impact on performance - Curved World updates variables only if they have been changed.



    VacuumShaders - Facebook Twitter YouTube
     
  25. nukeD

    nukeD

    Joined:
    Feb 12, 2009
    Posts:
    411
    Finally bought it!
     
    Arkhivrag likes this.
  26. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    Did it meet your expectations?



    VacuumShaders - Facebook Twitter YouTube
     
  27. nukeD

    nukeD

    Joined:
    Feb 12, 2009
    Posts:
    411
    Havent used it yet, since i'm a version lower, but i'm sure it will. Once i finish my current work, i'm updating unity and will use it. Thanks!
     
  28. pepone3d

    pepone3d

    Joined:
    Jul 5, 2012
    Posts:
    27
    I totally love the shader, thanks for the javascript implementation help...

    One thing: If I want to ship it on mobile and 'bake' the shaders I have to select all
    3D models that use different versions manually each time :cool:
    Is there a possibility to add a feature like "bake everything in the scene"?
    (Or select a dozen assets and "bake selected")?
    Would be a big plus!

    I also can imagine your shader can handle matrix style ripple effects
    (like in shadow gun if something explodes) and it would be cool to have some
    animated texture shader, where the tex is 'scrolling' in x,y, or z or even
    water FX waves? :D:D
     
  29. pepone3d

    pepone3d

    Joined:
    Jul 5, 2012
    Posts:
    27
    hmmm... if I set the resolution to iphone portrait with a 9:16 (a.e. 640x1134) screen rect and bend the world in y-direction, the objects on the left and right side with some offset starts to clip, before they should... If I go for 3:4 everything it is getting better, but objects more far away still gets clipped... looks like the camera is culling the standard viewport and doesn't know there are more shapes 'bended' into the field of view. Can I force them to 'stay' longer or is there an other workaround?
     
  30. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
  31. pepone3d

    pepone3d

    Joined:
    Jul 5, 2012
    Posts:
    27
    Found it, Thanks!
    Any chance to get the "bake all in scene"/ "bake selected" functionality?
     
  32. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    I will try to add it in the next update.




    VacuumShaders - Facebook Twitter YouTube
     
  33. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    Update 1.2
    • Added Scene Material Baker (Menu/Window/VacuumShaders/Curved World/Scene Material Baker)
    • Added UV Scroll shaders.
    • Added FX/Flare shader.
    • Improved shader baking (unlit shaders are 2x smaller).



    VacuumShaders - Facebook Twitter YouTube
     
  34. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
  35. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    Last edited: Feb 4, 2015
  36. JohnRossitter

    JohnRossitter

    Joined:
    Dec 18, 2013
    Posts:
    1,027
    So I just bought this and am quite disappointed.

    You call this a Screen Space shader, but according to your documents, I have to assign this shader to each of the objects in my scene for it to work. How is applying your shaders to each mesh exactly a screen space shader?

    I have have thousands of unique materials in my scene.
    I have my own custom shaders already written.

    Am I missing something here?
     
  37. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    @JohnRossitter
    The very first line which describes the Curved World package is:
    Curved World bends mesh in screen space - not world space. It is per mesh effect - not image effect.

    Assign shader to mesh(material) and it will bended.
    The second line of description:
    Curved World shaders do not modify objects position/rotation/scale in scene - they are just rendered differently.
    Screen space bending means that "bending" of the mesh will occur during rendering it on screen and its position/rotation/scale in your scene (world space) is not changed.

    Custom shaders support is described in doc file inside package.

    You missed reading description before buying?



    VacuumShaders - Facebook Twitter YouTube
     
    Last edited: Feb 4, 2015
  38. JohnRossitter

    JohnRossitter

    Joined:
    Dec 18, 2013
    Posts:
    1,027
    No, In fact I read the description on the Asset Store very carefully before I bought it.

    It does not say that on the description on the asset store at all, which is why I'm bring it up.
    Perhaps the description on your asset store itself is not current, but I purchased this under the impression it was a traditional Screen Space /Post Processing effect. There is nothing on your product description that indicates otherwise.

    It was not until after the fact that I purchased it that I discovered that it has to be applied to each individual material.
    Which in my case makes it un-usable to be because I'm already using custom shaders.

    I'm not saying that it's a bad product, I'm sure it's great for what it does, but you have not done a great job at properly describing it, and because of that, people are going to purchase it based on your description. You need to state that this has to be applied at the object level on something other than the documentation you get after you purchase the package.

    If you market something as a Screenspace shader 99% of developers are going to assume that it's post processing effect. I actually asked 10 of my Unity Developer friends to read your description today and then asked them based on what they read, do they think this is a post processing effect, and all 10 agreed and thought your description here is misleading.



    Screen Shot 2015-02-04 at 1.01.54 PM.png Screen Shot 2015-02-04 at 1.05.41 PM.png
     
  39. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
  40. JohnRossitter

    JohnRossitter

    Joined:
    Dec 18, 2013
    Posts:
    1,027
    Good Deal!

    Like I said, I'm sure it's a fantastic shader framework, Just have to be really careful with how we market things.
    Perhaps I can use it on another project in the future.
     
  41. ixikos

    ixikos

    Joined:
    Jun 21, 2013
    Posts:
    26
    This looks rad!

    I have a question regarding Screenspace vs Worldspace (seems like a few of the other VR guys are similarly curious). I understand the concept of using depth to decide how to bend something. In the shader, is it possible to use a depth that is based off of a vector as opposed to the camera's forward vector? (ie, 0,0,1) and then bend based on that? Or is depth just calculated differently in the shader? I wouldn't mind diving in and trying to do some of the legwork, if this is indeed possible (still rather new ish to shaders).

    cheers!
     
  42. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    Hi,
    Shader does not calculates vertex depth, it is taken from vertex position (z value) from view matrix, far the vertex is from camera more bended it is.
    There is no problem to use different matrices/vectors to calculate bend or other mesh behavior, question is - how acceptable results will be and where/how you will use them.



    VacuumShaders - Facebook Twitter YouTube
     
  43. Elin42

    Elin42

    Joined:
    Oct 21, 2014
    Posts:
    22
    Please ad multi edit for curved world options on shader.
    Or tell me how to set the global contoll on default to on.
    Now i have 75 materials and have to enable global controll in each of them
     
  44. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    @Elin42
    Unfortunately Unity does not support material multi editing. If you select two objects with different materials(even with the same shaders), material editor just disappears. You have to change it's properties separately, one by one.



    VacuumShaders - Facebook Twitter YouTube
     
  45. Elin42

    Elin42

    Joined:
    Oct 21, 2014
    Posts:
    22
    Is it not possible to set as example in the ODL Diffuse shader Global control to on by default?
     
  46. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    Currently no. But for the next update I will try to manage it somehow.



    VacuumShaders - Facebook Twitter YouTube
     
  47. AnimosusIII

    AnimosusIII

    Joined:
    Nov 8, 2012
    Posts:
    18
    Hi guys,

    It looks like example shaders doesn't work in Unity 5 beta . Don't take me wrong I didn't have a time to experiment.
     
  48. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    Last edited: Feb 7, 2015
  49. AnimosusIII

    AnimosusIII

    Joined:
    Nov 8, 2012
    Posts:
    18
    Thanks for reply ,

    Do you have any plans when will be supported ?
     
  50. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,982
    @AnimosusIII
    After final release of Unity 5. Lots of rendering and shading features is still adding/removing/changing and I can not spend time on feature update that Unity can change in the next beta.




    VacuumShaders - Facebook Twitter YouTube
     
Thread Status:
Not open for further replies.