Search Unity

► Curved World ◄

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

  1. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    In your case you need to modify CharaOutline.cg and CharaMain.cg files, vertex shader functions are described there.



    VacuumShaders - Facebook Twitter YouTube
     
  2. Brainversation01

    Brainversation01

    Joined:
    May 25, 2015
    Posts:
    16
    Does this work in VR???
     
  3. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
  4. Gnimmel

    Gnimmel

    Joined:
    Apr 21, 2010
    Posts:
    358
    and mobile VR as well. I recently used it in Jogger for the Gear VR.

    I just updated to unity 5.6 and got some errors and a crash on a new Oculus Rift game. There was something in the log about a vertex shader error in curved world. After messing with it for a while I decided to go back to unity 5.5, but I didn't notice the last build error I had wiped the error log, so I don't know the exact error now.

    Are there any known problems with 5.6 or will I have to install it again to create a new error log?
     
  5. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    It is not fully compatible with Unity 5.6
    Already working on it.



    VacuumShaders - Facebook Twitter YouTube
     
  6. Gnimmel

    Gnimmel

    Joined:
    Apr 21, 2010
    Posts:
    358
    Thanks for the update. It's good to know it will be working soon.
     
  7. Brainversation01

    Brainversation01

    Joined:
    May 25, 2015
    Posts:
    16
  8. naked_chicken

    naked_chicken

    Joined:
    Sep 10, 2012
    Posts:
    186
    Has anyone here tried making a billboard shader with this plugin? We've been using it and I love it, but just recently wanted to try using billboards for a particular mesh effect and ran into issues. I can get billboard working, but it blows away the vert offset in the vert shader.

    Here's my full vert shader:

    Code (CSharp):
    1. v2f vert (appdata_t v) {
    2.          v2f o;
    3.          UNITY_SETUP_INSTANCE_ID (v);
    4.          UNITY_TRANSFER_INSTANCE_ID (v, o);
    5.  
    6.          V_CW_TransformBillboardPoint(v.vertex);
    7.          o.vertex = mul(UNITY_MATRIX_P, mul(UNITY_MATRIX_MV, float4(0.0, 0.0, 0.0, 1.0)) - float4(v.vertex.x * _Scale, v.vertex.y * _Scale, 0.0, 0.0));
    8.  
    9.          o.color = v.color;
    10.  
    11.          fixed4 randomOffset = UNITY_ACCESS_INSTANCED_PROP (_RandomOffset);
    12.  
    13.          o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
    14.          o.warpcoords = TRANSFORM_TEX(v.texcoord, _WarpTex) + _WarpProps.zw * _Time.y + randomOffset.xy;
    15.  
    16.          fixed depth = 1.0 - clamp(mul(UNITY_MATRIX_MVP, v.vertex).z / _DistFade, 0.0, 1.0);
    17.          depth *= depth * depth;
    18.          o.color.a *= clamp(depth, _DistFadeMin, 1.0);
    19.  
    20.          UNITY_TRANSFER_FOG(o, o.vertex);
    21.          return o;
    22.        }
    I've tried a few different combinations but I'm butting up agains the limits of my matrix math knowledge so I'm hoping someone here can help me out.
     
  9. naked_chicken

    naked_chicken

    Joined:
    Sep 10, 2012
    Posts:
    186
    so I found a "solution". Turns out I was messed up because my transform on my card had rotation and scale on it. The problem was that I was doing the curveworld TransformPoint based on the object space, then translating to billboard and that messed it all up.
    Taking out the rotation and scale on the object make it work fine.
     
  10. humpbackgames

    humpbackgames

    Joined:
    Dec 21, 2016
    Posts:
    2
    Hello!

    I am having a little problem! I just used One Directional Shader on post of my materials, after which I created a mobile build. The problem is, everything is now purple! Can anyone help me solve this issue?
     
  11. Zilk

    Zilk

    Joined:
    May 10, 2014
    Posts:
    333
    Something that would be quite useful is having a Shader Forge/Amplify Shader Editor created standard curved world shader. Then one could use that as base to build own variations.

    For instance I would like to create a variation of the curved world shader that has an extra offset to animate on props based on a distance and I'm not much for writing shaders.
     
  12. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    For that issue use support vacuumshaders@gmail.com e-mail and include asset purchase invoice file from the Asset Store.



    VacuumShaders - Facebook Twitter YouTube
     
  13. UrsHanselmann

    UrsHanselmann

    Joined:
    Jan 28, 2014
    Posts:
    13
    Did anyone manage to use the built-in light Halo component with Curved World?

    I already replaced the built-in shader with this one:
    Code (csharp):
    1.  
    2. Shader "Hidden/Internal-Halo" {
    3.     SubShader {
    4.         Tags {
    5.             "RenderType"="Overlay"
    6.         }
    7.         ZWrite off Cull off // NOTE: 'Cull off' is important as the halo meshes flip handedness each time... BUG: #1220
    8.         Blend OneMinusDstColor One
    9.         AlphaTest Greater 0
    10.         ColorMask RGB
    11.         Pass {
    12.             CGPROGRAM
    13.             #pragma vertex vert
    14.             #pragma fragment frag
    15.             #pragma multi_compile_fog
    16.             #include "UnityCG.cginc"
    17.             #include "Assets/VacuumShaders/Curved World/Shaders/cginc/CurvedWorld_Base.cginc"
    18.             sampler2D _HaloFalloff;
    19.             struct appdata_t {
    20.                 float4 vertex : POSITION;
    21.                 fixed4 color : COLOR;
    22.                 float2 texcoord : TEXCOORD0;
    23.             };
    24.             struct v2f {
    25.                 float4 vertex : SV_POSITION;
    26.                 fixed4 color : COLOR;
    27.                 float2 texcoord : TEXCOORD0;
    28.                 UNITY_FOG_COORDS(1)
    29.             };
    30.             float4 _HaloFalloff_ST;
    31.             v2f vert (appdata_t v)
    32.             {
    33.                 v2f o;
    34.                 V_CW_TransformPoint(v.vertex);
    35.                 o.vertex = mul(UNITY_MATRIX_MVP, v.vertex);
    36.                 o.color = v.color;
    37.                 o.texcoord = TRANSFORM_TEX(v.texcoord,_HaloFalloff);
    38.                 UNITY_TRANSFER_FOG(o,o.vertex);
    39.                 return o;
    40.             }
    41.             fixed4 frag (v2f i) : SV_Target
    42.             {
    43.                 fixed a = tex2D(_HaloFalloff, i.texcoord).a;
    44.                 fixed4 col = fixed4 (i.color.rgb * a, a);
    45.                 UNITY_APPLY_FOG_COLOR(i.fogCoord, col, fixed4(0,0,0,0)); // fog towards black due to our blend mode
    46.                 return col;
    47.             }
    48.             ENDCG  
    49.         }  
    50.     }
    51. }
    52.  
    But somehow the curvature seems to just be ignored...
     
  14. MrFigment

    MrFigment

    Joined:
    Jan 5, 2017
    Posts:
    27
    If i use a lot of particle systems in my game, is it easy to implement the curved world in it?
     
  15. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Curved World version of the Unity built-in particle shaders are included.
    Changing materials on multiple objects can easily be done by included Scene Shader Overview tool.



    VacuumShaders - Facebook Twitter YouTube
     
  16. MrFigment

    MrFigment

    Joined:
    Jan 5, 2017
    Posts:
    27
    Thanks!
     
  17. Beloudest

    Beloudest

    Joined:
    Mar 13, 2015
    Posts:
    247
    I've just tried to use the UNET Multiplayer components with CW and noticed the curved collisions don't work as expected when using the Network Transform component. Essentially the collisions will occur in the position you would expect when the CW Controller is disabled. Have you any suggestions on how this could be resolved or what is happening?

    I assume the transform from the server needs to be distorted to match the curve, maybe there is a formula to follow.
     
  18. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Vector3 value modified by TransformPoint() function can be used to update any kind of type (include collider position), but how you manage that data with UNET is up to you.
    I have no any suggestions except to understand how physics work with UNET.



    VacuumShaders - Facebook Twitter YouTube
     
  19. foyleman

    foyleman

    Joined:
    Feb 19, 2009
    Posts:
    116
    Is it possible to display the materials as double sided?
    I'm applying this shader to trees and leaves and I would like to be able to show the texture through on both sides.
    I tried various settings and was unable to trial/error my way to getting it to work.
     
  20. wisarut

    wisarut

    Joined:
    Mar 27, 2013
    Posts:
    3
    How can I turn on/off "Rim Effect" at runtime?
     
  21. cmos

    cmos

    Joined:
    Aug 6, 2012
    Posts:
    10
    I get the following error... any ideas?:

    Shader error in 'VacuumShaders/Curved World/U5 Standard/Standard (Specular setup)': 'boxMax' : no such field in structure; 'd' : left of '[' is not of type array, matrix, or vector; '' : unsupported construction; 'assign' : cannot convert from 'uniform vec4' to 'structure' at Assets/VacuumShaders/Curved World/Shaders/cginc/CurvedWorld_UnityStandardCore.cginc(266) (on gles)

    Compiling Vertex program
    Platform defines: UNITY_NO_DXT5nm UNITY_NO_RGBM UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 SHADER_API_MOBILE UNITY_HARDWARE_TIER2 UNITY_COLORSPACE_GAMMA
     
  22. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Is it possible but included shaders have no such feature.
    You can try manually add Cull Off/Back/Front instruction to the shader.


    To enable - targetmaterial.EnableKeyword("V_CW_RIM")
    To disable - targetmaterial.DisableKeyword("V_CW_RIM")

    For build you will have to manually change shader file:
    1) Open required .shader file
    2) Find line with #pragma shader_feature V_CW_RIM_OFF V_CW_RIM
    3) In above line change shader_feature to multi_compile
    4) Save file.


    Please use support E-mail vacuumshaders@gmail.com and you will need asset purchase invoice.



    VacuumShaders - Facebook Twitter YouTube
     
    wisarut likes this.
  23. RakshithAnand

    RakshithAnand

    Joined:
    Jun 30, 2013
    Posts:
    56
    Hi,

    I am using your Curved world asset's Standard Shader.
    But it does not get Global illumination on it. So certain parts where light is not there it looks dark unlike Standard Unity shader.

    Please help. Thanks!
     
  24. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Included Standard shaders are exactly the same as Unity built-in but with Curved World vertex transformation.
    There are several Curved World packages on the store for different Unity versions. Use proper asset package based on Unity version.



    VacuumShaders - Facebook Twitter YouTube
     
  25. blitzcloud

    blitzcloud

    Joined:
    Aug 18, 2015
    Posts:
    27
    unlit shader, one directional,particle shaders are throwing me this exception on 2017.1.

    MissingMethodException: Method not found: 'UnityEngine.Texture2D.LoadImage'.
    VacuumShaders.CurvedWorld.CurvedWorldGearMenuDrawer.GetIconSettings ()
    VacuumShaders.CurvedWorld.CurvedWorldGearMenuDrawer.OnGUI (Rect position, UnityEditor.MaterialProperty prop, System.String label, UnityEditor.MaterialEditor editor)
    UnityEditor.MaterialPropertyDrawer.OnGUI (Rect position, UnityEditor.MaterialProperty prop, UnityEngine.GUIContent label, UnityEditor.MaterialEditor editor) (at C:/buildslave/unity/build/Editor/Mono/Inspector/MaterialPropertyDrawer.cs:224)
    UnityEditor.MaterialPropertyHandler.OnGUI (UnityEngine.Rect& position, UnityEditor.MaterialProperty prop, UnityEngine.GUIContent label, UnityEditor.MaterialEditor editor) (at C:/buildslave/unity/build/Editor/Mono/Inspector/MaterialPropertyDrawer.cs:49)
    UnityEditor.MaterialEditor.ShaderPropertyInternal (Rect position, UnityEditor.MaterialProperty prop, UnityEngine.GUIContent label) (at C:/buildslave/unity/build/Editor/Mono/Inspector/MaterialEditor.cs:1190)
    UnityEditor.MaterialEditor.ShaderProperty (Rect position, UnityEditor.MaterialProperty prop, UnityEngine.GUIContent label, Int32 labelIndent) (at C:/buildslave/unity/build/Editor/Mono/Inspector/MaterialEditor.cs:1027)
    UnityEditor.MaterialEditor.ShaderProperty (Rect position, UnityEditor.MaterialProperty prop, UnityEngine.GUIContent label) (at C:/buildslave/unity/build/Editor/Mono/Inspector/MaterialEditor.cs:1014)
    UnityEditor.MaterialEditor.ShaderProperty (Rect position, UnityEditor.MaterialProperty prop, System.String label) (at C:/buildslave/unity/build/Editor/Mono/Inspector/MaterialEditor.cs:1009)
    UnityEditor.MaterialEditor.PropertiesDefaultGUI (UnityEditor.MaterialProperty[] props) (at C:/buildslave/unity/build/Editor/Mono/Inspector/MaterialEditor.cs:1510)
    UnityEditor.MaterialEditor.PropertiesGUI () (at C:/buildslave/unity/build/Editor/Mono/Inspector/MaterialEditor.cs:1461)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    The inspector shows zero properties for the shader
     
  26. DBDBDDBDBD

    DBDBDDBDBD

    Joined:
    Jan 18, 2017
    Posts:
    10
    i want to ask some question .
    i don't understand how it work.
    i want a curved plane, how do i do?
    create empty then put controller on it?
    then i need to modify something?
     
  27. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    UnityEngine.Texture2D.LoadImage method is inside Unity engine and 2017.1 editor should have updated plugin files. Strange that it does not happen for you.
    Note, I am not able to reconstruct your issue and there is nothing from my side to change inside scripts.
    Solution: Remove CW from the project and clear Asset Store cache, then download plugin from the store.
    If still have problems use support E-mail vacuumshaders@gmail.com (purchase invoice is required)



    VacuumShaders - Facebook Twitter YouTube
     
  28. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    It is very simple.
    1) On all objects (mesh, terrain, particle, flare, etc) use included CurvedWorld shaders.
    2) Control bending from one controller script (check example scenes).
    3) That's all.



    VacuumShaders - Facebook Twitter YouTube
     
    Last edited: Jul 14, 2017
  29. blitzcloud

    blitzcloud

    Joined:
    Aug 18, 2015
    Posts:
    27
    deleting them worked just right. Thanks!
     
  30. DBDBDDBDBD

    DBDBDDBDBD

    Joined:
    Jan 18, 2017
    Posts:
    10
    I success. thank you a lot !

    Curved World and Curved World - Little Planet is different function?
    i want to make a game . it's feel like planet.
    so i need to use Curved World - Little Planet or Curved World ?
     
  31. blitzcloud

    blitzcloud

    Joined:
    Aug 18, 2015
    Posts:
    27
    The curved world shaders don't look right. Something's going on. They are completely off on android (they look much brighter, for example with the unlit one). It's like it's doing something wrong regarding the simple cubemap reflection/matcap. Instead of glowing gold yellow, they start yellow where the fog is then they turn white.
     
  32. zero_null

    zero_null

    Joined:
    Mar 11, 2014
    Posts:
    159
    Hello @Arkhivrag
    Talking Classic runner. Is there a way I can move both my player and camera should follow it ? Currently the player and camera doesn't move. I just need a clue if it's possible to do ? As with my current implementation I want to move my player and camera is following it.
    Please if you can help.
     
  33. blitzcloud

    blitzcloud

    Joined:
    Aug 18, 2015
    Posts:
    27
    @Arkhivrag located the issue with the shaders. Despite emission checkbox being off, it still goes through on android build. My temp solution was turning emissions (on unlit material) black.
     
  34. Sudarmin-Then

    Sudarmin-Then

    Joined:
    Nov 27, 2014
    Posts:
    27
    Will this work on side-scrolling 2D? right now I have a 2D game with flat linear ground sprite, can this make my ground sprite curved?
     
  35. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Includes sprite shaders and special bend type Perspective2D.




    VacuumShaders - Facebook Twitter YouTube
     
  36. Sudarmin-Then

    Sudarmin-Then

    Joined:
    Nov 27, 2014
    Posts:
    27
    Hi, out of curiosity I bought the package, and it almost gave what I want.
    using the Perspective2D bend type, I could not bend it in Z axis, so I use the Universal bend type instead.

    As you can see in the pictures below, it got bent the way I want it to bent, which is spherical, but the image got distorted on the edges (left and right) eventhough I only bend it a little, can you tell me how to fix this distorted issue? upload_2017-7-27_17-3-4.png upload_2017-7-27_17-3-49.png

    And one more thing, do you have any curved world 2d sprite vertex lit shader?
     
    Last edited: Jul 27, 2017
  37. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Bend effects are applied per-vertex and if mesh uses just a few vertices offsetting them may cause UV distortion. Try increasing mesh vertex count, it will not effect performance at all.



    VacuumShaders - Facebook Twitter YouTube
     
    Last edited: Jul 27, 2017
  38. Sudarmin-Then

    Sudarmin-Then

    Joined:
    Nov 27, 2014
    Posts:
    27
    But how? I'm using sprite renderer, I searched through the import setting there is no mesh that I can change
     
  39. Sudarmin-Then

    Sudarmin-Then

    Joined:
    Nov 27, 2014
    Posts:
    27
    Solved the problem by putting the sprite as Sliced instead of Simple.
    Now the character seems to distort on the edges, is there a way to keep the rotation and not distort the image?
     
    Last edited: Jul 27, 2017
  40. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    My mistake, I thought about 2D side scroll games using simple meshes.
    For sprite use there is special bend type Perpective2D. It handles sprite rendering in camera view.
    All other bend types are 'world space' modifiers and they are designed to work with meshes (has never been tested on sprites from my side).
    If you are using Universal bend type try use simple plane meshes with Unlit Transparent shader.



    VacuumShaders - Facebook Twitter YouTube
     
  41. Sudarmin-Then

    Sudarmin-Then

    Joined:
    Nov 27, 2014
    Posts:
    27
    I tried to use Perspective2D but there's no Z axis bending, I don't need the X and Y bending, is there anyway I could open the Z-axis option up?
     
  42. blitzcloud

    blitzcloud

    Joined:
    Aug 18, 2015
    Posts:
    27
    If your game is using 2d but is not really using the sprites capabilities, like tiling and stuff, just use primitive planes. The more geometry it has, the better the bending will look.
     
  43. Sudarmin-Then

    Sudarmin-Then

    Joined:
    Nov 27, 2014
    Posts:
    27
    I use Spine for the Character, it has Skeleton Mesh (Mesh Filter), I guess there's no way changing my spine character to plane
     
  44. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Sprites can not handle Z axis offset and always will be distorted.
    ZZ.gif


    For 2D sprites there is only one bend type - Perspective2D. If you need other bend effect you will have to use real meshes.




    VacuumShaders - Facebook Twitter YouTube
     
  45. allc1809

    allc1809

    Joined:
    Jul 22, 2017
    Posts:
    3
    Hey, great template! How do I get the one with the deserted car and street scene?
     
  46. allc1809

    allc1809

    Joined:
    Jul 22, 2017
    Posts:
    3
    I'm kind of confused on how to edit this or how to make a new terrain and applying this effect. Does anyone know how?
     
  47. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Modern Ruins


    Import Terrain and Foliage shaders from Curved World settings window. Create material with CW terrain shader and use it Unity terrain.



    VacuumShaders - Facebook Twitter YouTube
     
  48. VirtualDawn

    VirtualDawn

    Joined:
    Sep 15, 2014
    Posts:
    31
    Hey!
    I just bought Curved World and The Amazing Wireframe Shader, and they're both great!

    My problem is that the curved world doesn't seem to work with additive wireframe shaders?
    I can use the Curved world unlit additive, but would rather use the additive wireframe shaders because they truly are amazing.

    edit: Oh, my build is an android build. It seems that curved world doesn't do too well with android, am I right?

    edit2: That can't be. I can open the example scenes as an android build and it works fine. BUT, if I bring my own meshes in the scene and apply the same shaders as the working ones, it doesn't work.

    So maybe the problem is with my meshes? I have a feeling I've forgotten something really simple...
    http://i64.tinypic.com/11jaseo.jpg

    edit3: Aaaand... solved it. I was an idiot and didn't generate the wire mesh from the shader.

    Still a problem with the additive wireframe shader and curved world though.
     
    Last edited: Aug 3, 2017
  49. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Confirm some wireframe shaders problem with Curved World. Already working on fix.



    VacuumShaders - Facebook Twitter YouTube
     
    VirtualDawn likes this.
  50. zero_null

    zero_null

    Joined:
    Mar 11, 2014
    Posts:
    159
    Hello, My game works fine in Unity Editor but in android build. All Textures are getting blacked.
    How can I fix it ?