Search Unity

Curved World 2 [WIP]

Discussion in 'Works In Progress - Archive' started by Arkhivrag, Jun 22, 2015.

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

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,981
    CurvedWorld_2_Poster_1.png
    What is Curved World?
    Curved World is shader for creating mesh bending effect know as
    • Horizon bending
    • Exaggerated horizon curve
    • Spherical world
    • Cylindrical roll-off
    This effect is used in games such as Subway Surfers, Minion Rush, Animal Crossing.
    Curved World is already available on the Asset Store: http://u3d.as/awm
    and discussed here: http://goo.gl/BH9b61


    What is new version for?
    Current version is made inside Unity 4, using its features, limitations and bugs(yes Unity 4 is full of bugs and Curved World uses them ;)).
    Most of the features in Unity 5 has been changed, some of them removed and others fixed, and it became absolutely impossible to just update Curved World shaders for new Unity.
    Unity 5 requires completely new bending algorithms using, again, Unity 5's features and limitations.

    Will be upgrade payable?
    Curved World 2 will be free upgrade.


    Is release date available?
    July 28

    One of the main features required by the Curved World is "Shadow Collector" pass allowing real-time shadows for bended meshes.
    In Unity 5 shadows are computed from camera's depth texture and "Shadow Collector" rendering pass is completely removed. Below you can see correct dynamic shadows in Unity 4 and wrong in Unity 5.
    Unity 4 (correct shadow)
    Unity 5 (buggy shadow)
    
    I tried to find the way for fixing shadows and make them work with Unity 5, even find the gap in rendering pipeline but without successes - shadow in Unity 5 is screen space texture and I can not bend 2D texture - Screen space bending is dead!

    Of course I could release Curved World without real-time lightning and shadows, by including only Unlit version, but in this case I would rather refuse releasing Curved World for Unity 5 than making castration to it.

    After trying several techniques the only real possible solution for supporting dynamic shadows was - recreating entire Curved World effect in the world space.
    World space vertex modification does no harm to shadow pass and depth texture and Unity generates correct shadows for them.
    World space bending means that in this case bending effect would be applied among world X, Y and Z axises instead of camera screen coordinates.

    Converting bending to world space was very easy. Shadows are generated correctly. Done :cool:!

    No, not done :(, now another big problem raised - realtime lightning attenuation :mad:
    As now mesh is bending in world space, its vertex position is changed related to light direction but it's normal remains the same.
    
    Fixing light attenuation needs normal rotations for receiving correct lighting.
    One of the main request to the Curved World is - mobile compatibility - so it should be possible to fix normals without using heavy math, specially trigonometrical functions and it should be done inside vertex shader, not pixel shader.

    To make it short - I did it (not as fast as I wanted)
    
    Implementing correct world space bending with proper lighting, attenuation and shadows was the hardest part of the new Curved World. And now it's done.
    But as I wrote above new technique is based on Unity 5's features and limitations.
    Curved World 2 has four bend types:

    1. Classic Runner - has only X and Y axis bend options.

    2. Little Planet - has only X and Z axis bend options.


    3. Universal - has all three X, Y and Z axis bend options.



    In all bend types axis bend options can be used separately or mixed together.
    For example: Cylindrical rolloff effect can be achieved using just one bend axis.


    All three above bend types are world space effects and are camera position/rotation independent. Bend effect has same effect from any world point.
    All of them use pivot point as 'anchor' for bending effect to start.
    For pivot point can be used active camera or any game object.



    4. Perspective 2D - Specially created for 2D sprites. Sprites can be used with any bend types, but this one is only for 2D games. It is camera position dependent and has only X(right) and Y(up) axis bend type support.

    Unity 2D use cameras with orthographic projection. For this effect camera must be set to perspective, otherwise curvature just will not be visible.
    Curved World currently supports Unlit and Forward rendering modes. However in Forward mode can be rendered only one directional light and optionally 4 point lights per vertex. No per pixel lights.

    Unlit


    Forward rendering
    (One Directional Light only, per pixel or per vertex)




    Curved World 2 adds Full Forward and Deferred rendering modes.

    Full Forward Rendering
    (One Directional Light and several point lights per pixel, all others at object vertices or per-object)


    Deferred Shading
    (Unlimited count of lights per pixel)



    Curved World 2 also supports old VertexLit rendering mode, it will be only available as fallback for Forward and Deferred shaders, and not as a custom shader.




    During rendering Curved World modifies mesh vertices to apply bending effect. If after this mesh goes out of cameras field view Unity excludes it from rendering, creating mesh disappearing effect and ruining all bending effect.

    In current Curved World version it is fixed by special script that scales mesh rendering bounding box. Script should be applied manually to all meshes inside scene that have disappearing problem.

    Curved World 2 has a better solution - Eagle eye :cool:
    Just one script that takes care all of meshes and fixes disappearing problem without any CPU cost.

    However in Unity 5 rendering pipeline lights have their own field of view for dynamic shadow rendering and if mesh is not 'visible' for them, it is excluded from shadowing pass.
    As Curved World has no access to the shadow pass Eagle eye is blind and old script should be used on shadow problematic meshes (for scaling bounding box).
    But such meshes may only be just a few inside scene.​



    Curved World 2 is ready to be tested on your device.
    All you need:
    Send your Curved World purchase invoice number and device info you are working on to vacuumshaders@gmail.com
    If I choose you, I'll contact directly via mail.


    Curved World 2 particles calculation is a little bit problematic and in some cases may not work as expected, but mostly they do.
    Reason is particles own render modes (for example Billboard) that are handled by Unity's built-in API and not by shaders.

    Curved World 2 particles rendering need some matrix calculation. It is done only ones per frame on CPU, send to shader and used by all particles in the scene.
    All above calculations are done inside 'Eagle Eye' script that should be attached to the active camera (Eagle Eye script also helps with mesh disappearing).
    Correct particles bending are visible only inside game camera view and not inside Editor.

    Who is using Curved World knows that each shader file contains lots of variations and before building project it is necessary bake used shader, otherwise compiled shader on target device will be huge, from 10mb - 300mb.
    For controlling shader baking I added Scene Materials Manager tool, with ability of monitoring all shaders and materials inside scene.

    Curved World 2 shader files contain even more variations :)


    But now shaders do not require baking. During project building it is done automatically and users will not have to worry about it.

    Shader baking feature is removed.

    Scene Materials Manager is improved. Just one window for monitoring all materials with all type of textures.
    Allows shader changing for materials, keywords removing, copying and some useful features.

    Curved World v2.0 will include 132 shaders with more than 500.000 (half of million) variations (almost killed myself while testing all of them :)).

    Shaders are for all device: from ancient mobiles to the High-end PCs.


    1. Unlit
    2. Matcap (unlit)
    3. One Directional Light (can be calculated per-pixel or per-vertex)
    4. Mobile Terrain (similar as T4M) with max 4 texture blend

    5. Particle
    6. Projector

    7. U5 Standard shaders
    8. U4 Legacy shaders
    9. DX11 Tessellate
    10. Unity Terrain (Diffuse and Standard)
    11. Unity Nature shaders (tree, grass, bark, leaves)
    12 Sprite (Default and Diffuse)

    13. SpeedTree
    14. Unity Water (Includes all effects and parameters except dynamic reflection)
    15. Unity Glass with dynamic refraction

    16. Skybox (2D texture)



    Shader have optional parameters controlled from material editor:
    1. Reflection (simple or fresnel)
    2. Vertex color
    3. Emission
    4. Rim effect
    5. Fog
    6. Image Based Lighting
    7. Bump
    8. Specular
    9. UV Scroll
    10. Texture mix (Decal, Detail, Blend by vertex alpha)

    (For mobile shaders optional parameters are calculated per-vertex)


    WIPI #8 Coming soon




    VacuumShaders - Facebook Twitter YouTube



    [Mod edit: release thread here: http://forum.unity3d.com/threads/curved-world-2.344041/ ]
     
    Last edited by a moderator: Jul 30, 2015
  2. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    so you can turn a plane terrain into a sphere?
     
  3. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,981
    Inside camera view - YES




    VacuumShaders - Facebook Twitter YouTube
     
  4. gterveen

    gterveen

    Joined:
    Dec 17, 2012
    Posts:
    22
    any idea for the ETA?
     
    JohnRossitter likes this.
  5. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
  6. JohnRossitter

    JohnRossitter

    Joined:
    Dec 18, 2013
    Posts:
    1,027
    For those of you who are not following the other thread, this is a new thread for an updated version of the Curved World Shader...this is an existing product in the Asset Store, and this thread is a WIP preview thread for the new version for Unity 5
     
    gterveen likes this.
  7. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,981
    buttmatrix likes this.
  8. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    lena3rika, fidelsoto and Haseeb_BSAA like this.
  9. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,981
    hopeful likes this.
  10. JohnRossitter

    JohnRossitter

    Joined:
    Dec 18, 2013
    Posts:
    1,027
    Update progress is looking great!
    Keep it up!
     
  11. jpatinop80

    jpatinop80

    Joined:
    Jul 29, 2012
    Posts:
    55
    Great!!! If I buy current Curved World it will update to Curve World 2? or you sold separately?
     
  12. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,981
    It will be free update.



    VacuumShaders - Facebook Twitter YouTube
     
    schmosef likes this.
  13. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,981
    hopeful and schmosef like this.
  14. JohnRossitter

    JohnRossitter

    Joined:
    Dec 18, 2013
    Posts:
    1,027
    Rock On!
    These are looking great, can't wait to test it out :)
     
  15. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    This looks quite cool. Has a lot of creative potential.
     
  16. jpatinop80

    jpatinop80

    Joined:
    Jul 29, 2012
    Posts:
    55
    Do you have a Release Date?
     
  17. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,981
    schmosef likes this.
  18. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    Great work Thanks alot for developing this type of asset . My question is same is it safe to buy the asset means does it now supports windows phone platform or it is not and giving same blue textures on windows phone . Waited a lot now at least give me some good news . I am dying to use the asset in my windows phone game .
     
  19. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,981
    Yes, it works with Window Phone.



    VacuumShaders - Facebook Twitter YouTube
     
    schmosef likes this.
  20. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,981
    Finished working on Deferred lighting.
    Added work in progress info - WIPI #3



    VacuumShaders - Facebook Twitter YouTube
     
  21. jpatinop80

    jpatinop80

    Joined:
    Jul 29, 2012
    Posts:
    55
    It is possible to have a beta, I just need Blob shadow and light mapping for my game!!!
     
  22. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    It's hard to tell from the 'Little Planet' example (see above), how the world bending is affecting physics inside Unity; are the balls rolling because of the curvature, or the physics being applied, or both. Either way, world bending is a really incredible achievement and addresses many issues from the previous release.

    Applying the Curved World effect in the initial release was somewhat tedious, although the documentation was very helpful. How have the latest developments affected UX for Curved World 2?
     
  23. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,981
    Not ready for beta.


    That is the point of the Curved World that object appear being bended only during rendering. It does not change or modify physics, path finding, animations - NOTHING. You can develop game 'normally' and Curved World just will render objects 'curved'.


    UX - ?o_O



    VacuumShaders - Facebook Twitter YouTube
     
  24. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    What kind of question is this? Do you think @Arkhivrag is Mordac? Do you think he would make it hard to use on purpose?

    If you have an implementation issue with CW1, post a question in the appropriate thread.

    CW2 isn't even out yet. When it is out, if you have an idea for improving the UX, that would be a good time to post a suggestion.

    Every time @Arkhivrag answers questions like this (and ETAs and betas) it's time wasted. It's time he could have spent working on CW2.

    Can we just leave him alone so he can get on with it?
     
    Last edited: Jul 5, 2015
  25. jpatinop80

    jpatinop80

    Joined:
    Jul 29, 2012
    Posts:
    55
    Shut up, we can ask what we want, this is a free world!!
     
    buttmatrix likes this.
  26. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    Of course it is.

    There is no question of that.

    You are free to ask the same questions over and over despite them having being asked and answered many times already (in this thread and in the CW1 thread).

    And I'm free to point out that the consequence of wasting @Arkhivrag's time is: a) demotivational for him; and b) only delaying the eventual release.
     
    Last edited: Jul 6, 2015
  27. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,981
    Curved-World-2-loading.png
    (Unity Viking Village using Standard shader bended by Curved World 2)



    VacuumShaders - Facebook Twitter YouTube
     
    hopeful and schmosef like this.
  28. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,981
    Last edited: Jul 10, 2015
  29. JohnRossitter

    JohnRossitter

    Joined:
    Dec 18, 2013
    Posts:
    1,027
    That looks amazing! Could be lots of cool effects based on this!
     
    gterveen likes this.
  30. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,981
    Finished working on VertexLit rendering mode.
    Now all rendering paths supported by Unity are supported by Curved World 2.
    Updated WIPI #3
    Added WIPI #4



    VacuumShaders - Facebook Twitter YouTube
     
    hopeful and schmosef like this.
  31. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,981
    I WANT YOU_Small.png
    Help me test Curved World 2 on as much device as possible.

    All you need:
    Send your Curved World purchase invoice number and device info you are working on to vacuumshaders@gmail.com

    If I choose you, I'll contact directly via mail. Starting Monday July 13.



    VacuumShaders - Facebook Twitter YouTube
     
    Last edited: Jul 10, 2015
    JohnRossitter likes this.
  32. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,981
    Thanks every one, received 41 requests for testing new version, just chose several.
    By the end of the week I will have estimate release date available :)




    VacuumShaders - Facebook Twitter YouTube
     
  33. jpatinop80

    jpatinop80

    Joined:
    Jul 29, 2012
    Posts:
    55
    :( I did not receive email... so sad:confused:
     
    buttmatrix likes this.
  34. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,981
    buttmatrix and jpatinop80 like this.
  35. dooub_unity_1

    dooub_unity_1

    Joined:
    Jan 7, 2015
    Posts:
    3
    Hi Arkhivrag, great work so far!
    I've used Curved World in my previous project, and I loved using it so much that I am trying to implement it in my new project. Problem is, our project is using Unity 5, and I am on a very tight schedule. I would really love to be included in your beta if the Curved World 2 is not going to be released within few days. Can you please PLEASE include me in beta?
     
    jpatinop80 likes this.
  36. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,981
  37. jpatinop80

    jpatinop80

    Joined:
    Jul 29, 2012
    Posts:
    55
  38. CptBonex

    CptBonex

    Joined:
    Dec 14, 2013
    Posts:
    15
    I'm thinking about getting this asset for a project I'm working on and I saw that you mentioned it will be a free upgrade for people that bought the first one. But will you increase the cost of the package with this update? The reason why I ask this is because I'm wondering if its worth buying the current version before the release of this update even tho I cant use the current version since its missing a feature that I need for my project.
     
  39. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,981
    jpatinop80 and schmosef like this.
  40. JohnRossitter

    JohnRossitter

    Joined:
    Dec 18, 2013
    Posts:
    1,027
    Very Exciting!
     
  41. SirStompsalot

    SirStompsalot

    Joined:
    Sep 28, 2013
    Posts:
    112
    Dunno how I'd ever use it, but damn that looks phenomenal.
     
    buttmatrix likes this.
  42. lena3rika

    lena3rika

    Joined:
    Jul 22, 2015
    Posts:
    2
    I've had my eye on this asset for the past year && now I finally need it for an Animal Crossing clone I'm working on! Looking forward to the release. :3
     
    theANMATOR2b likes this.
  43. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Would you be able to make an o'neill cylinder with it? (A la Rendevous With Rama, a kind of giant cylindrical space-vessel/colony)
     
    buttmatrix likes this.
  44. JohnRossitter

    JohnRossitter

    Joined:
    Dec 18, 2013
    Posts:
    1,027
    So this probably goes without saying, but am I correct to assume the new version for Unity 5 will work with the Standard Shader out of the box?
     
  45. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,981
    Curved World bends mesh along Parabola not circle:

    shape.png



    You can not achieve closed circle bend effect, but you can achieve 'half closed' by parabola:
    Yes_No.png



    VacuumShaders - Facebook Twitter YouTube
     
  46. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,981
  47. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Is the curvature achieved from the, i suppose you could have a halo or ringworld, without distortion?

    Basically you can author what you wish over a long, thin rectangle, and then curve the walls as the cross section and curve the length at least to a segment of a ring? Kind of like authoring with the ring in mind but flat, and just checking on its function as a (lets say pic on the left) ring every so often with the ring intended as the final shape?

    This may be beyond the scope of your work but i'm considering some exotic scenarios, like being able to curve a voxel terrain created by, say, uterrains, and/or an ocean using a projected grid to render (like the upcoming Ceto) or atmospheric effects like TrueSky. Now all those assets by their nature rely on optimisation and tricks to make sure they run fast based on the fact you probably cant see where the optimisation falls apart, so maybe some mitigating factor like fog or even more trickery like 'Horiz-on for curved worlds' would be in order, it's just i'm quite inspired by the options possibly opened with this when i own or am involved in products that would be rather spectacular when applied to something like this, would they be possible?

    Even if out of the scope of the work of you yourself, is it feasible to approach the developers of other assets asking their thoughts on adapting to this?

    I'm trying to make a point in much of what i do regarding VR and i think making the point has been a bit too terrestrial to be the necessary provocation when i see what has been done by others. As part of the beta i can confirm that looking up a curved world 2 surface with an Oculus is quite amazing (so long as no billboarded effects are used although i will test your latest beta now), and listed above were other rather amazing things ive been using in a vr context, so any thoughts on the matter would be appreciated
     
  48. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    Just to be clear, according to WIP #7, Skyshop shaders will not be supported?
     
  49. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I think a brief guide to converting shaders oneself would be great, if possible!
     
  50. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,981
    Converting your custom shaders to Curved World 2 will be very easy - it's just 3 lines of code to add.
    Almost everything that is on the Asset Store can be made Curved World 'friendly', but it should be done by their authors, not me.



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