Search Unity

► Curved World 2 ◄

Discussion in 'Assets and Asset Store' started by Arkhivrag, Jul 28, 2015.

  1. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,193
    Check CustomShaders.pdf file inside Doc folder.
    Copy HLSL shader from ShaderGraph into .shader file. Integrate Curved World inside this .shader with one click.



    VacuumShaders - Facebook Twitter YouTube
     
  2. Nixellion

    Nixellion

    Joined:
    Jun 17, 2015
    Posts:
    4
    Thanks for quick reply!

    It would be great to have a one-click option to generate HLSL .shader file with integrated Curved World after clicking on the shadergraph source code file. This would make iterations a lot faster.
     
  3. thund3rmonk3y

    thund3rmonk3y

    Joined:
    Sep 13, 2015
    Posts:
    2
    I'm having a problem with the Unity Terrain clipping when it extends over the horizon. I've tried tweaking the Curvature size, camera distance, FOV, and Clipping Planes. I've included a gif to demonstrate. You can really see it when a mountain appears or disappears on the horizon. It leaves a gap in the mesh. Any suggestions?
     

    Attached Files:

  4. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,193
    Check ReadMe file in the Doc folder. Last page, describing Mesh disappearing or early culling problem.



    VacuumShaders - Facebook Twitter YouTube
     
  5. thund3rmonk3y

    thund3rmonk3y

    Joined:
    Sep 13, 2015
    Posts:
    2
    Yes! That was the solution! Thank you for your quick response!
     
  6. Allen0012

    Allen0012

    Joined:
    Sep 5, 2009
    Posts:
    88
    I cannot get the point light halo shader working.

    I have tried changing the built-in halo shader to the custom Curved Standard which doesn't work at all, and also manually modifying a copy of the Unity's built-in halo shader with addition of CURVED_WORLD_TRANSFORM_POINT with no luck.

    Here's the result I get by editing the built-in shader based on the CustomShaders.pdf doc.

     
  7. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,193
    Update point lights position using Follow script.
    No need to modify halo shaders.



    VacuumShaders - Facebook Twitter YouTube
     
  8. Valera981

    Valera981

    Joined:
    Apr 22, 2014
    Posts:
    5
    Hello. I have problems with Android build. Objects become invisible If I appoint "VacuumShaders\Curved World\Shaders\Standard\Standard.shader" shader to these objects. And Android build gets stuck when I add shader to "Always Include Shaders" list. In PC version and Unity editor everything is ok.
     
  9. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,193
    Standard shader may be too 'heavy' for android and it fails to compile.
    In "Always Include Shaders" array include Fallback shaders, they are defined inside .shader file (check last lines).
    For Standard shader it is VertexLit/Diffuse shader from VacuumShaders\Curved World\Shaders\VertexLit folder.



    VacuumShaders - Facebook Twitter YouTube
     
  10. AxonGenesis

    AxonGenesis

    Joined:
    Jun 24, 2016
    Posts:
    8
    I was wondering if anyone has a version of Unity's Skybox Procedural shader updated to work with Curved World? I've made an attempt but I'm getting weird stretching and anomalies so I must be applying the CW transform functions incorrectly.

    Forum won't let me include the link here, but you can find the shader source code for the unity built-in Skybox Procedural shader on github. I followed the instructions and examples and it runs, but does not curve or change the horizon and introduces gradient artifacts. The shader is fairly complex so maybe not as straightforward to convert as others.

    Alternatively, is there another procedural sky that does work with Curved World?
     
  11. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,193
    Curved World is a mesh vertex transformation shader.
    Skybox is not a mesh.
    I even can not imagine what you expect for example from Spiral bending effect applied to a Skybox. Or what must happen with it if using Runner bending with always 'going down'?

    Depending on your game, you have to design your own Skybox shader to reflect world transformation.



    VacuumShaders - Facebook Twitter YouTube
     
  12. AxonGenesis

    AxonGenesis

    Joined:
    Jun 24, 2016
    Posts:
    8
    Thanks for your response. I can get the effect I need by simply using a texture mapped onto a huge sphere, but I'm not finding any procedural sky solutions that work this way. Perhaps there is a gradient shader that will work, otherwise I will probably have to create my own. If I come up with a good solution I'll post it here.
     
  13. Valera981

    Valera981

    Joined:
    Apr 22, 2014
    Posts:
    5
    Thank you for your answer. I will try.
     
  14. josephsaade

    josephsaade

    Joined:
    Apr 18, 2016
    Posts:
    45
    Hello, I just imported the package into my project hat has Lightweight renderer.
    I opened the ReadMe file and there is no mention of "Lightweight" so I tried to open the Runner Scene like ReadMe says but all materials/shaders are messed up. Anything specific I can do?

    Edit: I re-imported all materials as lightweight and I can at least see the textures now in the tutorial scene but bending is not working.

    Edit 2: I do not see any lightweight shader in the project so While your comment say they are fully supported, they do not seem to be supported.
     
    Last edited: Jul 31, 2019
  15. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,193
    LWRP shaders require Unity 2019.1 (or later version).
    Before importing asset make sure project is fully setup and uses Lightweight RP 5.0 (or later).




    VacuumShaders - Facebook Twitter YouTube
     
    Last edited: Jul 31, 2019
  16. josephsaade

    josephsaade

    Joined:
    Apr 18, 2016
    Posts:
    45
    As I am using 2018 I decided to go back to standard.

    The game + curvature works fine if in my endless runner the player/camera are static and I am just moving the world around them.

    but I I am moving the player, it seems the camera misbehaves at certain angles (when the player curves with the shader). I am doing this with origin reset so I do can have trail renderer. In any case, I will try to find an alternative. Thanks
     
  17. Fyrburn

    Fyrburn

    Joined:
    Aug 30, 2013
    Posts:
    6
    Hey folks, I haven't bought this package yet but it looks really promising for my project. My question, is there any dynamic decal package for the standard render pipeline that plays nice with it?

    I want to place a decal on my "flat" world and have it curve with the world.
     
  18. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    431
    Hi, I was wondering, how would one go about having multiple scenes using varying modes of curved shader? Such as one with little planet and anther scene with cylindrical tower? Thx
     
  19. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,193
    Bend type is defined in CurvedWorld_Base.cginc file and all shaders use it.

    If you need multiple bend types, you have to declare them inside shader using #pragma multi_compile in all passes and sub-shaders.



    VacuumShaders - Facebook Twitter YouTube
     
    Last edited: Aug 20, 2019
  20. Saul15

    Saul15

    Joined:
    Aug 22, 2019
    Posts:
    2
    hi, how can i access to the curvature size of the Curve World_Controller from another script?
    i´m trying to create a smooth transition in the size parameter of a little planet.
     
  21. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,193
    Check API.pdf file inside Doc folder.
    Get scene's current CurvedWorld_Controller.current variable and modify all desired parameters.



    VacuumShaders - Facebook Twitter YouTube
     
  22. Saul15

    Saul15

    Joined:
    Aug 22, 2019
    Posts:
    2
    hi! what im missing here?.
    i get a nullReferenceException.

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using VacuumShaders.CurvedWorld;
    5.  
    6.  
    7. public class unvend : MonoBehaviour
    8. {
    9.     static public CurvedWorld_Controller current;
    10.  
    11.     // Start is called before the first frame update
    12.     void Start()
    13.     {
    14.         current = GetComponent<CurvedWorld_Controller>();
    15.     }
    16.  
    17.     // Update is called once per frame
    18.     void Update()
    19.     {
    20.        current.SetCurvature(.2f);
    21.     }
    22.  
    23. }
     
  23. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,193
    No need in making CurvedWorld_Controller variable.
    Just use CurvedWorld_Controller.current in your script anywhere and you will get reference to the scene's active controller (scene must contain one such controller).



    VacuumShaders - Facebook Twitter YouTube
     
  24. JamesThornton

    JamesThornton

    Joined:
    Jun 26, 2015
    Posts:
    48
    Hello! Does this work with VR?

    Thanks

    Edit: Works great! (runner version) Good asset
     
    Last edited: Aug 31, 2019
  25. magic9cube

    magic9cube

    Joined:
    Jan 30, 2014
    Posts:
    58
    Hi,

    I'm plugging this into some procedural mesh using megasplat and seeing the pink ghost mesh as below;

    curved-world-megasplat-issue-1.png

    Ive also noticed this does not apparently work well with triplanar mapping with megasplat. The textures slide across the mesh. Is there any way to fix that?
     
  26. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,193
    May be it is better to ask this question on MegaSplat forum, because I do not see the problem with Curved World asset here.



    VacuumShaders - Facebook Twitter YouTube
     
  27. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    670
    Just bought the Curved world - Classic Runner and it seems there is something very wrong as I'm following the Tutorial Runner but nothing seems to match up.
    I have a working Android LWRP project in which I imported the LWRP unitypackage of the asset. Looking at even step 1 of the readme pfd does show the correct axis setting but all other settings are marked 'excluded'.
    Trying to add the component 'CurvedWorld_Controller' to the gameobject with the same name in the scene isn't possible as there doesn't seem to be any component with that name.

    Please advice on how to proceed. Working with Unity 2019.2.3f1 on Windows.

    Got it working: please state in your documentation you should search for the component 'controller' or use the menu structure of the component button. Or some friendly advice: call the component as they are available this to avoid end-user confusion.
     
    Last edited: Sep 15, 2019
  28. yucolab

    yucolab

    Joined:
    Nov 28, 2018
    Posts:
    1
    Hello this is a presales question, would like to know how the KvantTunnel works, can we predefine a path for it to curve towards the left or right?
     
  29. daville

    daville

    Joined:
    Aug 5, 2012
    Posts:
    268
    Hi I asked this on the Amplify Shader forum, but they told me to ask here instead.

    I want to use Curved World with LWRP and Amplify Shader... Amplify's guide here doesn't seem to work exaclty with the newest versions of both plugins and LWRP.

    So I made my own template to add the dependency to Curved World ( I couldn't do it with the Canvas Window)



    I also added the custom function but the "V_CW_TransformPointAndNormal()" method doesn't seem to exist anymore, so I looked into the Unlit.shader LWRP example included with Curved World and found this line



    So I added the line 100 to my function "CURVED_WORLD_TRANSFORM_POINT" just replaced the input.positionOS for v.vertex as declared on the struct "GraphVertexInput" by the Amplify Template

    and it "Kinda works" it does in fact bends the vertices but it throws some errors



    This is my Graph



    this is the function



    What could I've been missing? I think I almost got it.
     
  30. summerian

    summerian

    Joined:
    Jul 6, 2014
    Posts:
    131
    Thanks for a great assets!

    I hope this is not a stupid question but:
    I was wondering of there is a way to keep the coordinate system in a flat world and have the view only be curved?
    So if I were to move my camera in a straight line it wouldn't clip through the curved world but instead follow it around the curve.

    Thanks again
     
  31. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,193
    "predefine" is subjective. In KvantTunnel example video is used Classic Runner bend type, it has controls for Up/Down and Left/Right bending.


    What Unity version do you use and LWRP version?


    Try camera as pivot point inside CurvedWorld_Controller script.



    VacuumShaders - Facebook Twitter YouTube
     
    Last edited: Sep 30, 2019
  32. summerian

    summerian

    Joined:
    Jul 6, 2014
    Posts:
    131
    Perfect. Thanks!
     
  33. Damo9000

    Damo9000

    Joined:
    Nov 4, 2015
    Posts:
    6
    Does this plugin support VR?
     
  34. Romaleks360

    Romaleks360

    Joined:
    Sep 9, 2017
    Posts:
    29
    Just to clarify: does Curved World - Classic Runner shader write to the depth buffer, so I can use AO with it? Can it not cast shadows but still write to depth buffer? Which shader do I need exactly for this?
     
  35. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,193
    Yes.


    You can use AO.
    If do not need shadows, then disable it from MeshRenderer.



    VacuumShaders - Facebook Twitter YouTube
     
  36. OTD2-CM

    OTD2-CM

    Joined:
    Aug 26, 2019
    Posts:
    1
    Hi there,

    I think I need help with Vertex shader. Vertex shading is getting distorted right after pivot point.
    Is there a way to fix this?

     
    Last edited: Oct 9, 2019
  37. Romaleks360

    Romaleks360

    Joined:
    Sep 9, 2017
    Posts:
    29
    Seems that AO doesn't work with Unlit shader. Is there a way to fix this?
     
  38. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,193
    Make sure mesh has tangents.



    Inside GraphicsSettings change Depth Normals shader and use included one from Curved World\Shaders\Internal folder.



    VacuumShaders - Facebook Twitter YouTube
     
  39. daville

    daville

    Joined:
    Aug 5, 2012
    Posts:
    268
    For that I was Using

    Unity: 2019.2.5f1
    LWRP: 6.9.0


     
  40. taichis

    taichis

    Joined:
    Nov 14, 2014
    Posts:
    1
    Hello.
    I want to adjust the Render Queue with the VacuumShaders/ Curved World/Standard shader.
    Can you adjust with Inspector?
    Thank you.
     
  41. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,193
    If there is such controller in material editor then yes.
    If no, try modify it from script.



    VacuumShaders - Facebook Twitter YouTube
     
  42. CogStudioAdmin

    CogStudioAdmin

    Joined:
    Dec 12, 2016
    Posts:
    2
    Hi is there any progress on curving text mesh pro (tmp)?
     
  43. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,193
    Import TextMesh Pro shaders from Curved World settings window.



    VacuumShaders - Facebook Twitter YouTube
     
  44. CogStudioAdmin

    CogStudioAdmin

    Joined:
    Dec 12, 2016
    Posts:
    2
    Thanks!, I missed importing that for some reason.
     
  45. stechmann

    stechmann

    Joined:
    Feb 24, 2012
    Posts:
    26
    Will this work with VR?
     
  46. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,193
  47. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,193
    I might find solution.
    Problem is not only with Curved World when using within Amplify Shader Editor but with any custom dependent function.

    Solution is to slightly modify Amplify template file.

    Whenever you add additional directives to Amplify Shader Editor, it adds them before core library files and as a result method and variables used in your custom file and depending on core library become unknown to the final generated shader.
    upload_2019-10-23_15-27-13.png

    In the case of Curved World is the same problem, matrices and variables used there require core library files to be included first.
    You just have to move declaration of CurvedWorld_Base.cginc file below default core files.
    upload_2019-10-23_15-25-56.png


    Or modify Amplify Shader template file and avoid hand modifications.
    Check template shader file and move all /*ase_pragma*/ line below core library files declarations:
    upload_2019-10-23_15-36-38.png

    Note, /*ase_pragma*/ is declared in several places inside file, move them all down!


    Now you can call methods from custom directives:
    upload_2019-10-23_15-41-16.png



    VacuumShaders - Facebook Twitter YouTube
     
    daville likes this.
  48. daville

    daville

    Joined:
    Aug 5, 2012
    Posts:
    268
    Thanks :D
     
  49. ZeroDarkTwenty

    ZeroDarkTwenty

    Joined:
    Dec 10, 2018
    Posts:
    1
    Hi, I just downloaded this asset and from the examples and videos I've seen, it looks like it can accomplish exactly what I'll need for my game. I'm trying to simulate a player moving through a planet that would look similar to the classic runner example. I have several questions that I hope you can answer. I'm almost certain that these are all going to be noob questions but I'm stuck on how to proceed.

    1. When I deploy this game on my iPhone, it seems to be locked in the left direction and I can't change it which I think is because it was designed for the PC. What direction should I be looking in to keep the curve locked center and downwards?

    2. Assuming I'm able to lock the bending to the center and downward, how would I implement a control that stops the scene from moving automatically but only when the user swipes up or down? For example, the curve would move forward if the user swipes upward and backwards if the user swipes downward?

    3. Is there a special way I should design my assets so that they'll bend the right way?

    If none of these questions make sense or are too vague, what I'm trying to do is something like this:


    Does this look like something the asset can do?
     
  50. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,193
    Curved World is not designed for PC, it is a shader bending effect designed for all type of devices.
    Effect from example video can be achieved both with Classic Runner and Little Planet bending styles.
    Curvature strength and directions are controller in run-time using CurvedWorld_Controller script. In example scenes you can check how keyboard is used to send events to the CurvedWorld_Controller script to modify curvature.



    VacuumShaders - Facebook Twitter YouTube