Search Unity

[Released] Vegetation Studio Pro

Discussion in 'Assets and Asset Store' started by LennartJohansen, Jun 29, 2018.

  1. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    839
    I had a similar problem a while back with this and it was having to do with the game object (tree or plant) was set in render mode to instanced or Instanced Indirect (not sure which it was) and when switched it to normal, no more floating vegetation. I had to modify the vegetation to function with instanced or change it.
    Not sure if you got the same thing, but worth a test to see.
     
    SAMYTHEBIGJUICY likes this.
  2. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    3,023
    That setting was set to Instanced Indirect. Switching it to Normal or Instanced does not get rid of the tree floating above my camera.

    When I started noticing the tree above the camera was after I setup an imposter on the tree prefab using the Amplify Impostor module with TVE. But maybe the tree was always above the camera and I just started noticing it more with the impostor on the prefab. I cannot say for sure what is causing the tree above the camera.
     
    Last edited: Apr 8, 2023
    SAMYTHEBIGJUICY likes this.
  3. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    3,023
    Here is a picture of VSP, Unity 2021.3, and HDRP with broken billboards. VSP is rendering the near trees as instanced indirect meshes, but is not rendering any far trees with billboarding.
     

    Attached Files:

    Last edited: Apr 8, 2023
  4. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    839
    When it happened to me it was because I had them set to instanced indirect and had to switch them to normal.
    But it may be with yours that amplify imposter is not playing well with VSP. I don’t have that combination so it must be something else from what I experienced.
    I hope you get it figured out.
     
    SAMYTHEBIGJUICY likes this.
  5. JeffG

    JeffG

    Joined:
    Oct 21, 2013
    Posts:
    85
    If the setting for the tree is set to Instanced Indirect, try using Instanced instead.
     

    Attached Files:

  6. maurosso

    maurosso

    Joined:
    Feb 19, 2017
    Posts:
    50
    Just as a precaution to anybody: ATM vegetation studio is abandon ware. If able, avoid using it in comercial projects.

    The developer disappeared . There are multiple functions that are left unfinished, buggy or incompatible with the progressing changes in URP and HDRP.

    I got billboards working on urp 2021.3 with custom mesh trees and customshaders but it was a lot of work. Like...really a lot. Most likely not worth the effort, as due to the specifics of the project, the garbage collection of VS due to an asswards implementation of render buffers update, kills any gains made by instanced indirect rendering.
     
  7. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    839
    Have you tried them on Discord? They are exclusive there for support. Forums are just for us to help each other nowadays, unfortunately.
     
  8. maurosso

    maurosso

    Joined:
    Feb 19, 2017
    Posts:
    50
    Jup. The discord is where the news spread that the developers disapeared.
    There are some users that due to kind heart help out new users or troubleshoot existing bugs and problems. But there has been no official support for well over a year now.
     
    Last edited: Apr 23, 2023
    dsilverthorn likes this.
  9. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    839
    Wow. Thanks for passing that on. I try Discord but I don’t like it. So only go there when I have to. I hate when devs disappear without warning. the good ones stop charging since they know they are not supporting it. I hope they make it back to full support soon.

    Thanks again for letting everyone know.
     
    Last edited: Apr 18, 2023
  10. vinnygombici

    vinnygombici

    Joined:
    Dec 16, 2015
    Posts:
    25
    Hello all, I know the developper is not answering anymore, but we are trying to port our game on Xbox and VSPro seems to make our game crash everytime. So we are trying to get VSpro out of the project. What we would like to do is baked all the work done with a map (because a lot of efforts were put on the biomes/persistant placement, mask, etc..) as a splatmap. Then put that on the Unity terrain using I don't know wich tool. And then try another tool for terrain optimization that could have these splatmaps as inputs (I would tell it which prefab to use for each splatmap). Any way of doing this in your opinion? Thanks!
     
    dsilverthorn likes this.
  11. jason0663

    jason0663

    Joined:
    Dec 4, 2020
    Posts:
    36
    Hi. Ive got a default biome using 16 textures for my overall map. Im using RAM 2019 and have made a biome mask for rivers. I want to create a new biome just for the rivers but do I have to use a subset of the original 16 textures for default biome? Can i use new textures? Your doc says you have to make the biome with same amount of textures as default, and use subset of the original 16. i want to use 4 new textures for my water as I did not configure them in original 16 of default biome I made.
     
    dsilverthorn likes this.
  12. damir2076

    damir2076

    Joined:
    Feb 13, 2018
    Posts:
    10
    I tried VSP on both HDRP and URP with 2022.2.14f1 and 2021.3.20f1 version. On both versions is not rendering any billboards trees, only mesh LODs. But VSP billboard system works great on 2022.2.14f1 only build-in render pipeline.

    VSP is on sale right now. It looks like the man who made the asset is still active.
     
  13. damir2076

    damir2076

    Joined:
    Feb 13, 2018
    Posts:
    10
    Do you have any tip how do you accomplished rendering billboard on URP or HDRP rendering pipeline?
     
  14. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    3,023
    My testing had the same results as yours. Tree billboarding is broken in VSP right now for HDRP and URP. I really wish Unity would stop letting the VSP author into sales until author starts replying to questions.
     
  15. cloverme

    cloverme

    Joined:
    Apr 6, 2018
    Posts:
    198
    If you're using HDRP v13 or below, someone in the discord has a fix for it:
    https://discord.com/channels/374537133584678913/462349035613847552/1018451367116939285

    On the latter... I'm not sure what the situation with the dev is, last post was about a year ago in the forums & discord. His profile here in the forums will occasionally show as "online" but who knows...

    The product still "works" but is quickly becoming outdated with other tools by other devs. Nature Renderer is about 30% faster but lacks a spawner tool, so you have to custom paint stuff again (sigh). Gaia has now has an instancer called "Flora" which isn't terrible, but not great.

    Overall, this is still a "Unity problem" because Unity is still relying on asset store developers to deliver what should be "core" functionality for the engine. It has added some additional support for terrains and vegetation but it's still about 3-4 years behind UE. My conspiracy theory on this is that Unity wants all "realistic" stylized games to leave so it can focus on Mobile/2D and ultra-lowpoly 3d games.
     
    Last edited: May 15, 2023
    damir2076 likes this.
  16. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    3,023
    Last edited: May 21, 2023
    damir2076 likes this.
  17. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    3,023
    I agree. This is definitely a Unity problem. Instead of building expected core features, Unity expects every game developer to rely on a bunch of 3rd party assets. It is a very unrealistic situation for game developers. The assets themselves are priced fairly, but it is impossible for asset authors to properly support all of them over time. Eventually, changes to the Unity engine and other assets causes every asset to break. The only real solution is if Unity creates an official solution for core systems.

    I honestly do think at least some people at Unity would love to see all big games for PC and console to go away, so Unity can happily focus on 2D mobile - especially ad-based hyper casual games. I don't think everybody feels that way, but I do suspect that there are groups of people at Unity that do.

    It is a sad situation right now. There are some big realistic PC games made in Unity, but those games are created in spite of Unity, not because of Unity. Game developers can buy literally every asset within a category, and then mix and match assets until they find a collection of assets that work with the current version of Unity. And then game developers can hurry and try to release their games before Unity changes something that breaks the group of third party assets they were trying to use.
     
    damir2076 and dsilverthorn like this.
  18. damir2076

    damir2076

    Joined:
    Feb 13, 2018
    Posts:
    10
    I use both engines Unity and UE. It's frustrating that UE has a basic foliage tool much better than Unity. And Landscape Grass Type and Procedural Foliage Spawner are miles ahead of Unity and unfortunately any third party asset. in 5.2 they are still improving.

    It took me a few hours for this prototype in UE 5.1 with Foliage tool, Landscape Grass Type and Procedural Foliage Spawner.
    I can't find an asset on Unity that would help me for faster level design than standard UE.
    HighresScreenshot_2023.04.30-06.06.41.jpg

    I think I'll have to make my own procedural spawning tool :)
     
    Last edited: May 22, 2023
    ShilohGames likes this.
  19. maurosso

    maurosso

    Joined:
    Feb 19, 2017
    Posts:
    50
    sorry for the late reply. Is this still an issue for you?

    Depending on the status of your project, I'd generally advise to pivot to a different tool. If it's too late for that, let me know. I'll try to help you out.
     
  20. damir2076

    damir2076

    Joined:
    Feb 13, 2018
    Posts:
    10
    Thank you very much. I am still searching for solution. I wanted to use VSP on 2022.2.14f1 HDRP, but still with no success.

    I am searching for solution 800 x 800 meters filled with trees. Placement and performance tool.

    I tried in 2020 version GPU Instancer and Nature Renderer 2020 two years ago, but probably did not understand how to use them. Performance was awful. Slower than normal terrain trees.

    I have VSP since 2018, and first time I wanted to try it to see is it faster than normal terrain tree system or prefab placement trees like MeshBrush, ProSurfaceSnap, Prefab World Builder, Prefab Brush+ or Prefab Painter 2.

    If you know good solution for earlier version, I can switch on Unity 2020 or 2021 version. Project is in early phase.
     
  21. maurosso

    maurosso

    Joined:
    Feb 19, 2017
    Posts:
    50
    Hmm, it's all depending on what is your use case, but is HDRP something you really need?
    My solution works for URP (lts 2021.3, but should be backwards and forwards compatible).
    HDRP is a pretty advanced pipeline, and if GPU Instancer is a tool that you find difficult to use, I'd say HDRP might be bit overkill that will give you more headaches than solutions.
    I only lightly toutched upon HDRP, so I'm not sure what changes would be needed to adapt it to HDRP.
    I'll try to post my billboard 'fix' in the comming days.
     
  22. damir2076

    damir2076

    Joined:
    Feb 13, 2018
    Posts:
    10
    Unreal Engine 5 has phenomenal vegetation. URP is totally limited. It cannot be compared to UE5 for serious level design for the PC version. I've completed the android game so far and the URP was good enough, but for the PC version I'd rather use UE5 than the limited URP.

    I need HDRP, because i want to use Diffusion Profile and Screen Space Reflection. I hope HDRP will work, if not I will use UE5.

    Thank you for your answer. I hope you will post billboard 'fix' :)
     
  23. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    839
    I am trying to get Touch React to work and cannot get anything to happen.Using 2021.3.19 and have tried all kinds of things. Manual doesn't say much but I have seen others get it to work.
    Has anyone had any luck?
    What do I have to do to get it working?
     
  24. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    Lennart still alive?
     
  25. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    839
    That’s a good question.
     
  26. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    VS Pro is still selling. Someone beside Unity is getting the money.
     
    dsilverthorn likes this.
  27. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    839
    That's a fact.
    Hey, did you ever get touch react working? I've seen Roland's video of it working but can't figure out how to get it going. All I see is the collider but the grass doesn't move.
     
  28. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    Nope. There is a guy that is answering questions in the VS Pro discord, though it isn't the author (Lennart) but some nice person doing good deeds.
     
    dsilverthorn likes this.
  29. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    839
    thanks. I'll see if I can get some answers on that there.
     
  30. vinnygombici

    vinnygombici

    Joined:
    Dec 16, 2015
    Posts:
    25
    Hey everyone, I just did something that might help other devs that are like me really advanced in a project using VSPro but are kind of afraid of the lack of support.
    I simply took all my scenes using VSPro, baked all the vegetation into the persistent vegetation package, then modified the "bake vegetation script" that bakes every tree as objects to the scene, but instead of just creating a bunch of object, I modified it so instead it writes it as a unity tree on the terrain (you can use chat GPT to modify that script). From there, I had a terrain with trees with the same position/rotation/scale as the ones in VSPro; and then I deleted VSpro and used GPU instancer that automatically import the trees on a unity terrain. I had exactly the same performances, not better, not worst, like really the same thing; but then, I was not using VSPro anymore, and GPU instancer is still supported... Anyway, if it can help you, cool!
     
  31. maurosso

    maurosso

    Joined:
    Feb 19, 2017
    Posts:
    50
    Ok ;] Here goes...

    So, the basic way I got it to work is to find the main billboard shader as that is something that is not URP ready. Then look what works and fix it as it goes. Also...I've done this 'fix' months ago, and the specifics are a bit foggy. If something does not work in your case, write here and we'll try to figure it out together, but no promises...I'm not a 'pro'.

    In the pictures is the billboard shader I recreated from the hlsl file of the original shader. If you ask me, why not pure hlsl...notice the 'not a pro' bit ;p

    I've added some additional parameters to control the colour, contrast ect that is project specific for our use case. You'll need to modify it to your needs because I believe opposite to us, you are not after desaturated billboards.

    The meat of the 'fix' are the 2 custom functions, that control the UV's (for the textures that are created by the billboard system) and vertex rotation/transposition. Below is the code for both.

    Code (CSharp):
    1. #ifndef VP_BILLBOARDING_VERTEX_INCLUDED
    2. #define VP_BILLBOARDING_VERTEX_INCLUDED    
    3.  
    4.  
    5. struct Input
    6. {
    7.     float3 vertexWP;
    8.     float4 vertex;
    9.     float3 CameraPos;
    10.     float3 uv3;
    11.     float3 uv2;
    12.     float3 camVect;
    13.     float3 inputNormals;
    14.     float CullDistance;
    15.     float FarCullDistance;
    16. };
    17.  
    18. struct OutputData
    19. {
    20.     float4 vertex;
    21.     float3 normal;
    22.     float4 tangent;
    23. };
    24.  
    25. OutputData VertexBillboardCalc(Input In)
    26. {
    27.     OutputData output;
    28.      
    29.     float4 CENTER = In.vertex;
    30.     float3 CORNER = In.inputNormals * In.uv2.x;
    31.  
    32.     float3 worldspaceCenter = mul(unity_ObjectToWorld, CENTER).xyz;
    33.  
    34.     float3 clipVect;
    35.     //In.CameraPos.y = worldspaceCenter.y;
    36.  
    37.     //clipVect = (mul(unity_ObjectToWorld, CENTER).xyz + float3(0, In.uv3.y, 0)) - In.CameraPos;
    38.     clipVect = (In.vertexWP + float3(0, In.uv3.y, 0)) - In.CameraPos;
    39.  
    40.     //shadowcaster?
    41.     float3 camVector = mul(unity_ObjectToWorld, CENTER).xyz - In.CameraPos;
    42.    
    43.     if (length(clipVect) < In.CullDistance - 3 || length(clipVect) > In.FarCullDistance)
    44.     {
    45.         //CORNER.xyz *= 0;
    46.         output.normal=0;
    47.         output.tangent=0;
    48.         output.vertex = 0;
    49.         return output;
    50.     }
    51.     else
    52.     {
    53.     //In.camVect = mul(unity_ObjectToWorld, CENTER).xyz - In.CameraPos;
    54.  
    55.     //float3 zaxis = normalize(camVector);
    56.     float3 zaxis = normalize(In.camVect);
    57.     float3 xaxis = normalize(cross(float3(0, 1, 0), zaxis));
    58.     float3 yaxis = cross(zaxis, xaxis);
    59.  
    60.     float4x4 lookatMatrix =
    61.     {
    62.         xaxis.x, yaxis.x, zaxis.x, 0,
    63.                     xaxis.y, yaxis.y, zaxis.y, 0,
    64.                     xaxis.z, yaxis.z, zaxis.z, 0,
    65.                     0, 0, 0, 1
    66.     };
    67.     output.vertex = mul(lookatMatrix, float4(CORNER.x, CORNER.y, (yaxis.y - 1.0) * In.uv2.y, 1));
    68.     output.vertex.xyz += CENTER.xyz;
    69.      
    70.     output.normal = -zaxis;
    71.    
    72.     output.tangent.xyz = xaxis;
    73.     output.tangent.w = -1;
    74.     return output;
    75.     }
    76.  
    77. }
    78.     //In.vertex.w = 1;
    79.     //float4 world_pos = mul(UNITY_MATRIX_M, In.vertex);
    80.     //float4 view_pos = mul(UNITY_MATRIX_V, world_pos);
    81.     //float4 clip_pos = mul(UNITY_MATRIX_P, view_pos);
    82.  
    83.     //output.vertex = clip_pos;
    84.  
    85.     //output.normal = float3(0, 0, 0);
    86.     //output.tangent = float4(0, 0, 0, 0);
    87.     //return output;
    88.  
    89.  
    90. void VertexBillboard_float(float3 vertexWP, float4 vertex, float3 _cameraVector, float3 CameraPosition, float3 UV3, float3 UV2, float3 inputNormals, float CullDist, float FarCullDistance,
    91.                             out float3 position, out float3 normal, out float4 tangent)
    92. {
    93. #ifdef SHADERGRAPH_PREVIEW
    94.     position=vertex;
    95.     normal=float3(0,0,0);
    96.     tangent=float4(0,0,0,0);
    97. #else
    98.     Input In;
    99.     In.vertexWP = vertexWP;
    100.     In.vertex = vertex;
    101.     In.vertex.w = 1;
    102.     //In.CameraPos=CameraPosition;
    103.     In.CameraPos = _WorldSpaceCameraPos;
    104.     In.inputNormals = inputNormals;
    105.     In.uv2 = UV2;
    106.     In.uv3 = UV3;
    107.     In.camVect = _cameraVector;
    108.     In.CullDistance = CullDist;
    109.     In.FarCullDistance = FarCullDistance;
    110.  
    111.     OutputData result = VertexBillboardCalc(In);
    112.  
    113.     position = result.vertex.xyz;
    114.     normal = result.normal;
    115.     tangent = result.tangent;
    116.  
    117.  
    118. #endif
    119. }
    120.  
    121.  
    122. #endif
    Code (CSharp):
    1. #ifndef VP_BILLBOARDING_INCLUDED
    2. #define VP_BILLBOARDING_INCLUDED    
    3.  
    4. struct VertInput
    5. {
    6.     float InRow;
    7.     float InCol;
    8.     float2 InputUV;
    9.     float2 InputUV1;
    10.     float3 CameraVector;
    11. };
    12.  
    13. float2 CalcBillboardUV(VertInput In)
    14. {
    15.     float3 zaxis = normalize(In.CameraVector);
    16.     //float4x4 lookatMatrix =
    17.     //{
    18.     //    xaxis.x, yaxis.x, zaxis.x, 0,
    19.                 //    xaxis.y, yaxis.y, zaxis.y, 0,
    20.                 //    xaxis.z, yaxis.z, zaxis.z, 0,
    21.                 //    0, 0, 0, 1
    22.     //};
    23.  
    24.     float2 UV;
    25.     UV.x = In.InputUV.x / In.InRow;
    26.     UV.y = In.InputUV.y / In.InCol;
    27.  
    28.     float angle;
    29.     float step;
    30.  
    31.     float2 atanDir = normalize(float2(-zaxis.z, -zaxis.x));
    32.     angle = (atan2(atanDir.y, atanDir.x) / 6.28319) + 0.5; // angle around Y in range 0....1
    33.  
    34.     angle += In.InputUV1.x;
    35.     angle -= (int) angle;
    36.     step = 1.0 / In.InRow;
    37.  
    38.     //float randomno = frac(sin(dot(Seed, float2(12.9898, 78.233))) * 43758.5453); //used to rotate billboards
    39.     //randomno = lerp(1, In.InRow+1, randomno);
    40.  
    41.     UV.x += step * ((int) ((angle + step * 0.5) * In.InRow));
    42.  
    43.     step = 1.0 / In.InCol;
    44.     angle = saturate(dot(-zaxis, float3(0, 1, 0)));
    45.                  
    46.     angle = clamp(angle, 0, step * (In.InCol - 1));
    47.                  
    48.     UV.y += step * ((int) ((angle + step * 0.5) * In.InCol));
    49.  
    50.     return UV;
    51. }
    52.  
    53. void CalculateBillboardUV_float(float _inRow, float _inCol, float2 _InputUV, float2 _InputUV1, float3 _cameraVector, out float2 _billboardUV)
    54. {
    55. #ifdef SHADERGRAPH_PREVIEW
    56.      _billboardUV= float2(0,0);
    57. #else
    58.     VertInput In;
    59.     In.InRow = _inRow;
    60.     In.InCol = _inCol;
    61.     In.InputUV = _InputUV;
    62.     In.InputUV1 = _InputUV1;
    63.     In.CameraVector = _cameraVector;
    64.  
    65.     _billboardUV = CalcBillboardUV(In);
    66. #endif
    67. }
    68.  
    69.  
    70. #endif
    as you can see, there are various commented approaches that i've experimented with. If someone finds any error or mistakes, feel to modify the code to your liking.

    From what I remember, I also modified one or all three of these shaders (I'm to lazy to GIT revert the project to a commit many months ago...and by the sheer amount of commits it would be a pain in the butt)

    ATree.shader
    Code (CSharp):
    1. Shader "AwesomeTechnologies/Billboards/SingleBillboard"
    2. {
    3.     Properties
    4.     {
    5.         _Color ("Color", Color) = (1,1,1,1)
    6.         _MainTex ("Albedo (RGB)", 2D) = "white" {}
    7.         _Bump ("Bump", 2D) = "white" {}
    8.         _HueVariation ("Hue variation", Color) = (1,1,1,.5)
    9.         _Cutoff("Cutoff" , Range(0,1)) = .5
    10.         _YRotation("Billboard Y Rotation" , Range(0,1)) = 0
    11.         _XTurnFix("Billboard X Rotation fix" , Range(0,10)) = .1
    12.         _CullDistance("Near cull distance",Float) = 0
    13.         _InRow("Frames in row", Int) = 8
    14.         _InCol("Frames in column", Int) = 8
    15.         _CameraPosition("Camera position",Vector) = (0,0,0,0)
    16.      
    17.         [KeywordEnum(OFF, ON)] AT_SINGLEROW ("Single in row", Float) = 0
    18.         [KeywordEnum(OFF, ON)] AT_SINGLECOLUMN ("Single in column", Float) = 0
    19.         [KeywordEnum(ON, OFF)] AT_HUE_VARIATION ("Use SpeedTree HUE variation", Float) = 0
    20.     }
    21.     SubShader {
    22.         Tags { "RenderType"="TransparentCutout" "Queue"="Geometry" "DisableBatching"="True" "IgnoreProjector"="True"}
    23.         LOD 200
    24.  
    25.         CGPROGRAM
    26.         #pragma target 3.0
    27.         #pragma surface surf Lambert noforwardadd alphatest:_Cutoff vertex:vert addshadow    
    28.         #pragma multi_compile AT_HUE_VARIATION_ON AT_HUE_VARIATION_OFF
    29.      
    30.         #include "a_tree.cginc"
    31.      
    32.         ENDCG
    33.     }
    34.     FallBack "Diffuse"
    35. }
    36.  
    ATrees.shader
    Code (CSharp):
    1. Shader "AwesomeTechnologies/Billboards/GroupBillboards"
    2. {
    3.     Properties
    4.     {
    5.         _Color ("Color", Color) = (1,1,1,1)
    6.         _MainTex ("Albedo (RGB)", 2D) = "white" {}
    7.         _Bump ("Bump", 2D) = "white" {}
    8.         _HueVariation ("Hue variation", Color) = (1,1,1,.5)
    9.         _Cutoff("Cutoff" , Range(0,1)) = .5
    10.         _Brightness("Brightness" , Range(0,5)) = 1
    11.         _MipmapBias("Mipmap bias" , Range(-3,0)) = -2
    12.         _CullDistance("Near cull distance",Float) = 0
    13.         _FarCullDistance("Near cull distance",Float) = 0
    14.         _InRow("Frames in row", Int) = 8
    15.         _InCol("Frames in column", Int) = 8
    16.         _CameraPosition("Camera position",Vector) = (0,0,0,0)
    17.         [KeywordEnum(ON, OFF)] AT_HUE_VARIATION ("Use SpeedTree HUE variation", Float) = 0
    18.     }
    19.     SubShader {
    20.         Tags { "RenderType"="TransparentCutout" "Queue"="Alphatest" "DisableBatching"="True" "IgnoreProjector"="True"}
    21.         LOD 200
    22.    
    23.         CGPROGRAM
    24.         #pragma surface surf Lambert noforwardadd alphatest:_Cutoff vertex:vert addshadow
    25.         #pragma multi_compile AT_HUE_VARIATION_ON AT_HUE_VARIATION_OFF
    26.         #pragma multi_compile _ LOD_FADE_CROSSFADE
    27.    
    28.         #pragma target 3.0
    29.    
    30.         #define AT_CHUNK
    31.            
    32.         #include "a_tree.cginc"
    33.    
    34.         ENDCG
    35.     }
    36.     FallBack "Diffuse"
    37. }

    ATrees_baked.shader
    Code (CSharp):
    1. Shader "AwesomeTechnologies/Billboards/BakedGroupBillboards"
    2. {
    3.     Properties
    4.     {
    5.         _Color ("Color", Color) = (1,1,1,1)
    6.         _MainTex ("Albedo (RGB)", 2D) = "white" {}
    7.         _Bump ("Bump", 2D) = "white" {}
    8.         _HueVariation ("Hue variation", Color) = (1,1,1,.5)
    9.         _Cutoff("Cutoff" , Range(0,1)) = .5
    10.         _Brightness("Brightness" , Range(0,5)) = 1
    11.         _MipmapBias("Mipmap bias" , Range(-3,0)) = -2
    12. //        _CullDistance("Near cull distance",Float) = 0
    13. //        _FarCullDistance("Near cull distance",Float) = 0
    14.         _InRow("Frames in row", Int) = 8
    15.         _InCol("Frames in column", Int) = 8
    16. //        _CameraPosition("Camera position",Vector) = (0,0,0,0)
    17.  
    18.         [KeywordEnum(ON, OFF)] AT_HUE_VARIATION ("Use SpeedTree HUE variation", Float) = 0
    19.     }
    20.     SubShader {
    21.         Tags { "RenderType"="TransparentCutout" "Queue"="Alphatest" "DisableBatching"="True" "IgnoreProjector"="True"}
    22.         LOD 200
    23.      
    24.         CGPROGRAM
    25.  
    26.         #pragma surface surf Lambert noforwardadd alphatest:_Cutoff vertex:vert addshadow
    27.         #pragma multi_compile AT_HUE_VARIATION_ON AT_HUE_VARIATION_OFF
    28.      
    29.         #pragma target 3.0
    30.      
    31.         #define AT_CHUNK
    32.              
    33.         #include "a_tree_baked.cginc"
    34.      
    35.  
    36.         ENDCG
    37.     }
    38.     FallBack "Diffuse"
    39. }
    40.  
    I've modified the VegetationStudio scripts to use the new shadergraph shader. Added the shader control parametrs to the VS custom inspector...and it worked.

    If I got it to work, so will you :) But, as noted above, it would be a quite hard endevour for me to create a 'step by step' solution. It was months ago, and I was banging my head at this for quite some weeks...

    There is also a picture of the VS inspector that shows the new shader controls.

    Also...I know it was unasked for, but in the pictures there is also my 'fix' for indirect instanced trees. And the code for the custom function is below. Have fun ;] And may the TechArt Gods be with you ;p

    Code (CSharp):
    1. #ifndef TREE_INSTANCED_INCLUDED
    2. #define TREE_INSTANCED_INCLUDED
    3.  
    4. #ifdef UNITY_PROCEDURAL_INSTANCING_ENABLED
    5.  
    6.     struct IndirectShaderData
    7.     {
    8.         float4x4 PositionMatrix;
    9.         float4x4 InversePositionMatrix;
    10.         float4 ControlData;
    11.     };
    12.  
    13.         StructuredBuffer<IndirectShaderData> IndirectShaderDataBuffer;
    14.         StructuredBuffer<IndirectShaderData> VisibleShaderDataBuffer;
    15.  
    16. #endif
    17.  
    18. void setupScale()
    19. {
    20. #ifdef UNITY_PROCEDURAL_INSTANCING_ENABLED
    21. #ifdef GPU_FRUSTUM_ON
    22.         unity_ObjectToWorld = VisibleShaderDataBuffer[unity_InstanceID].PositionMatrix;
    23.         unity_WorldToObject = VisibleShaderDataBuffer[unity_InstanceID].InversePositionMatrix;
    24. #else
    25.         unity_ObjectToWorld = IndirectShaderDataBuffer[unity_InstanceID].PositionMatrix;
    26.         unity_WorldToObject = IndirectShaderDataBuffer[unity_InstanceID].InversePositionMatrix;
    27. #endif
    28.  
    29.  
    30.  
    31. #endif
    32. }
    33.  
    34. //void setupScale(IndirectShaderData InVisibleShaderDataBuffer, IndirectShaderData InIndirectShaderDataBuffer)
    35. //{
    36. //#ifdef UNITY_PROCEDURAL_INSTANCING_ENABLED
    37. //#ifdef GPU_FRUSTUM_ON
    38. //        unity_ObjectToWorld = InVisibleShaderDataBuffer[unity_InstanceID].PositionMatrix;
    39. //        unity_WorldToObject = InVisibleShaderDataBuffer[unity_InstanceID].InversePositionMatrix;
    40. //#else
    41. //        unity_ObjectToWorld = InIndirectShaderDataBuffer[unity_InstanceID].PositionMatrix;
    42. //        unity_WorldToObject = InIndirectShaderDataBuffer[unity_InstanceID].InversePositionMatrix;
    43. //#endif
    44.  
    45. //#ifdef FAR_CULL_ON_PROCEDURAL_INSTANCING
    46. //#define transformPosition mul(unity_ObjectToWorld, float4(0,0,0,1)).xyz
    47. //#define distanceToCamera length(transformPosition - _WorldSpaceCameraPos.xyz)
    48. //                float cull = 1.0 - saturate((distanceToCamera - _CullFarStart) / _CullFarDistance);
    49. //                unity_ObjectToWorld = mul(unity_ObjectToWorld, float4x4(cull, 0, 0, 0, 0, cull, 0, 0, 0, 0, cull, 0, 0, 0, 0, 1));
    50. //#undef transformPosition
    51. //#undef distanceToCamera
    52. //#endif
    53. //#endif
    54. //}
    55. #ifdef UNITY_PROCEDURAL_INSTANCING_ENABLED
    56. void Setup()
    57. {
    58.     //unity_LODFade = VisibleShaderDataBuffer[unity_InstanceID].ControlData;
    59.     //unity_ObjectToWorld = VisibleShaderDataBuffer[unity_InstanceID].PositionMatrix;
    60.     //unity_WorldToObject = VisibleShaderDataBuffer[unity_InstanceID].InversePositionMatrix;
    61.  
    62.  
    63. #ifdef UNITY_PROCEDURAL_INSTANCING_ENABLED
    64. #ifdef GPU_FRUSTUM_ON
    65.         unity_ObjectToWorld = VisibleShaderDataBuffer[unity_InstanceID].PositionMatrix;
    66.         unity_WorldToObject = VisibleShaderDataBuffer[unity_InstanceID].InversePositionMatrix;
    67. #else
    68.     unity_ObjectToWorld = IndirectShaderDataBuffer[unity_InstanceID].PositionMatrix;
    69.     unity_WorldToObject = IndirectShaderDataBuffer[unity_InstanceID].InversePositionMatrix;
    70. #endif
    71. #endif
    72. }
    73. #endif
    74. void FunkcjaTree_float(float3 input, out float3 output)
    75. {
    76. #ifdef SHADERGRAPH_PREVIEW
    77.     output=float3(0,0,0);
    78. #else
    79.     output = input;
    80. #endif
    81. }
    82.  
    83.  
    84. #endif
    85.  
     
    Last edited: Jun 5, 2023
  32. maurosso

    maurosso

    Joined:
    Feb 19, 2017
    Posts:
    50
    Post with the Treeshader pictures. Also, i see there are some cgnic files I sort of remember to modify as well.

    a_tree.cgnic

    Code (CSharp):
    1. // Upgrade NOTE: upgraded instancing buffer 'Props' to new syntax.
    2.  
    3.      
    4.         sampler2D _MainTex;
    5.         sampler2D _Bump;
    6.         fixed4 _Color;
    7.         float _YRotation;
    8.         float _XTurnFix;
    9.         float _CullDistance;
    10.         float _FarCullDistance;
    11.         float _Brightness;
    12.         float _MipmapBias;
    13.         int _InRow;
    14.         int _InCol;
    15.         int _CameraType;
    16.         float4 _CameraPosition;
    17.      
    18.         #ifdef AT_HUE_VARIATION_ON
    19.             half4 _HueVariation;
    20.         #endif
    21.      
    22.      
    23.         struct Input
    24.         {        
    25.             float2 uv_MainTex;
    26.             float4 d;
    27.             #ifdef LOD_FADE_CROSSFADE
    28.             float3 dc;
    29.             float crossfade_value;
    30.             #endif
    31.             //UNITY_DITHER_CROSSFADE_COORDS
    32.         };
    33.  
    34.             void DitherCrossFade(half3 ditherScreenPos, float crossfadeValue)
    35.             {
    36.                 half2 projUV = ditherScreenPos.xy / ditherScreenPos.z;
    37.                 projUV.xy = frac(projUV.xy + 0.001) + frac(projUV.xy * 2.0 + 0.001);
    38.                 half dither = crossfadeValue - (projUV.y + projUV.x) * 0.25;
    39.                 clip(dither);
    40.             }
    41.  
    42.             half3 VS_ComputeDitherScreenPos(float4 clipPos)
    43.             {
    44.                 half3 screenPos = ComputeScreenPos(clipPos).xyw;
    45.                 screenPos.xy *= _ScreenParams.xy * 0.25;
    46.                 return screenPos;
    47.             }
    48.  
    49.         //#ifdef LOD_FADE_CROSSFADE
    50.         //    void VS_ApplyDitherCrossFade(half3 ditherScreenPos, float crossfadeValue)
    51.         //    {
    52.         //        float fadeValue = ceil(crossfadeValue * 16)/16.0;
    53.         //        //fadeValue = 0.5;
    54.         //        half2 projUV = ditherScreenPos.xy / ditherScreenPos.z;
    55.         //        projUV.y = frac(projUV.y) * 0.0625 + fadeValue; // quantized lod fade by 16 levels
    56.         //        clip(tex2D(_DitherMaskLOD2D, projUV).a - 0.5);
    57.         //    }
    58.         //#endif
    59.  
    60.         // Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader.
    61.         // See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing.
    62.         // #pragma instancing_options assumeuniformscaling
    63.         UNITY_INSTANCING_BUFFER_START(Props)
    64.             // put more per-instance properties here
    65.         UNITY_INSTANCING_BUFFER_END(Props)
    66.      
    67.         //#define AT_CYLINDRICAL_MODE
    68.      
    69.         void vert (inout appdata_full v, out Input o)
    70.         {
    71.             UNITY_INITIALIZE_OUTPUT(Input,o);
    72.          
    73.             #ifdef AT_CHUNK
    74.                 float4 CENTER = v.vertex;
    75.                 float3 CORNER = v.normal * v.texcoord2.x;
    76.             #else
    77.                 float4 CENTER = float4(0,0,0,1);
    78.                 float3 CORNER = v.vertex.xyz;
    79.             #endif
    80.          
    81.             float3 worldspaceCenter = mul(unity_ObjectToWorld, CENTER);
    82.             float3 modifiedCameraPos;
    83.             if (_InCol == 1)
    84.             {
    85.                 modifiedCameraPos =  _WorldSpaceCameraPos;
    86.                 modifiedCameraPos.y = worldspaceCenter.y;
    87.             }
    88.             else
    89.             {
    90.             modifiedCameraPos =  _WorldSpaceCameraPos.xyz;
    91.             }
    92.  
    93.             #define cameraPos modifiedCameraPos;
    94.          
    95.             //#define cameraPos _WorldSpaceCameraPos.xyz
    96.  
    97.             float3 clipVect;
    98.             clipVect = (mul(unity_ObjectToWorld, CENTER).xyz + float3(0,v.texcoord3.y,0)) - _CameraPosition;
    99.  
    100.             #if defined(UNITY_PASS_SHADOWCASTER)
    101.              
    102.                 //float3 camVect = _WorldSpaceLightPos0.w < 0.5 ? _WorldSpaceLightPos0.xyz : mul(unity_ObjectToWorld, CENTER).xyz - _WorldSpaceLightPos0.xyz;
    103.                 float3 camVect;
    104.  
    105.                 if (unity_MatrixVP[3][3] == 1)
    106.                     camVect = _WorldSpaceLightPos0.w < 0.5 ? _WorldSpaceLightPos0.xyz : mul(unity_ObjectToWorld, CENTER).xyz - _WorldSpaceLightPos0.xyz;
    107.                 else
    108.                     camVect = mul(unity_ObjectToWorld, CENTER).xyz - cameraPos;
    109.  
    110.                 #define camVectEvenInShadows (mul(unity_ObjectToWorld, CENTER).xyz - cameraPos)        
    111.             #else
    112.              
    113.                 float3 camVect = mul(unity_ObjectToWorld, CENTER).xyz - cameraPos;
    114.                 #define camVectEvenInShadows camVect
    115.              
    116.             #endif
    117.          
    118.             //if(length(camVectEvenInShadows) < _CullDistance || length(camVectEvenInShadows) > _FarCullDistance)
    119.             if (length(clipVect) < _CullDistance || length(clipVect) > _FarCullDistance)
    120.             {
    121.                 CORNER.xyz *= 0;
    122.             }
    123.             else
    124.             {
    125.             //#ifdef LOD_FADE_CROSSFADE
    126.             //    float distance = length(clipVect) - _CullDistance;
    127.             //    if (distance < 2)
    128.             //    {
    129.             //        o.crossfade_value = 1 - (distance/2);
    130.             //    }
    131.             //    else
    132.             //    {
    133.             //        o.crossfade_value = 0.98;
    134.             //    }
    135.             //#endif
    136.  
    137.                 // Create LookAt matrix
    138.                 float3 zaxis = normalize(camVect);        
    139.                 float3 xaxis = normalize(cross(float3(0, 1, 0), zaxis));
    140.                 float3 yaxis = cross(zaxis, xaxis);
    141.  
    142.                 float4x4 lookatMatrix = {
    143.                     xaxis.x,            yaxis.x,            zaxis.x,       0,
    144.                     xaxis.y,            yaxis.y,            zaxis.y,       0,
    145.                     xaxis.z,            yaxis.z,            zaxis.z,       0,
    146.                     0, 0, 0,  1
    147.                 };
    148.              
    149.                 #ifdef AT_CHUNK
    150.                     v.vertex = mul(lookatMatrix, float4(CORNER.x, CORNER.y, (yaxis.y - 1.0) * v.texcoord2.y, 1));
    151.                 #else
    152.                     v.vertex = mul(lookatMatrix, float4(CORNER.x, CORNER.y, (yaxis.y - 1.0) * _XTurnFix, 1));
    153.                 #endif
    154.          
    155.                 v.vertex.xyz += CENTER.xyz;
    156.              
    157.                 v.normal = -zaxis;
    158.                 v.tangent.xyz = xaxis;
    159.                 v.tangent.w=-1;
    160.              
    161.                 v.texcoord.x /= _InRow;
    162.                 v.texcoord.y /= _InCol;
    163.              
    164.                 float angle;
    165.                 float step;
    166.              
    167.                     float2 atanDir = normalize(float2(-zaxis.z, -zaxis.x));
    168.                     angle = (atan2(atanDir.y, atanDir.x) / 6.28319) + 0.5; // angle around Y in range 0....1
    169.                  
    170.                     #ifdef AT_CHUNK
    171.                         angle += v.texcoord1.x;
    172.                     #else
    173.                         angle += _YRotation;
    174.                     #endif
    175.                  
    176.                     angle -= (int)angle;
    177.                  
    178.                     step = 1.0 / _InRow;
    179.                  
    180.                     v.texcoord.x += step * ((int)((angle + step * 0.5) * _InRow));
    181.  
    182.                     step = 1.0 / _InCol;
    183.                  
    184.                     angle = saturate(dot(-zaxis,float3(0,1,0)));
    185.                  
    186.                     angle = clamp(angle,0,step*(_InCol-1));
    187.                  
    188.                     v.texcoord.y += step * ((int)((angle + step * 0.5) * _InCol));
    189.              
    190.                 o.d.x = v.texcoord1.y;
    191.              
    192.                 #ifdef AT_HUE_VARIATION_ON
    193.                     float hueVariationAmount = frac(CENTER.x + CENTER.y + CENTER.z);
    194.                     //hueVariationAmount += frac(IN.vertex.x + IN.normal.y + IN.normal.x) * 0.5 - 0.3;
    195.                     o.d.y = saturate(hueVariationAmount * _HueVariation.a);
    196.                 #endif
    197.  
    198.                 //#ifdef LOD_FADE_CROSSFADE
    199.                 //    o.dc = VS_ComputeDitherScreenPos(v.vertex);
    200.                 //#endif
    201.  
    202.                 //float4 localSpaceLightPos = mul(unity_ObjectToWorld,_WorldSpaceLightPos0);
    203.                 //v.normal = abs(normalize(localSpaceLightPos));
    204.             }
    205.         }
    206.  
    207.         void surf (Input IN, inout SurfaceOutput o)
    208.         {
    209.             //#ifdef LOD_FADE_CROSSFADE
    210.             //#define unity_LODFade float4(0.5,0.5,0,0)
    211.             //if (IN.crossfade_value > 0.99)
    212.             //{
    213.             //    VS_ApplyDitherCrossFade(IN.dc,IN.crossfade_value);
    214.             //}
    215.  
    216.             //DitherCrossFade(IN.dc, IN.crossfade_value);
    217.             //#endif
    218.  
    219.             //fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
    220.             fixed4 c = tex2Dbias(_MainTex, half4(IN.uv_MainTex,0,_MipmapBias)) * _Color;
    221.          
    222.             #ifdef AT_HUE_VARIATION_ON
    223.                 half3 shiftedColor = lerp(c.rgb, _HueVariation.rgb, IN.d.y);
    224.                 half maxBase = max(c.r, max(c.g, c.b));
    225.                 half newMaxBase = max(shiftedColor.r, max(shiftedColor.g, shiftedColor.b));
    226.                 maxBase /= newMaxBase;
    227.                 maxBase = maxBase * 0.5f + 0.5f;
    228.                 // preserve vibrance
    229.                 shiftedColor.rgb *= maxBase;
    230.                 c.rgb = saturate(shiftedColor);
    231.             #endif
    232.          
    233.             #ifdef AT_CHUNK
    234.                 o.Albedo = c.rgb * IN.d.x *_Color;
    235.             #else
    236.                 o.Albedo = c.rgb * _Color;
    237.             #endif
    238.          
    239.               o.Albedo = clamp(o.Albedo * _Brightness, 0, 1);
    240.  
    241.             o.Normal = tex2D (_Bump, IN.uv_MainTex).rgb  * 2.0 - 1.0;
    242.             //o.Normal.z = abs(o.Normal.z);
    243.             o.Alpha = c.a;
    244.         }
    245.  
    a_tree_baked.cgnic


    Code (CSharp):
    1. // Upgrade NOTE: upgraded instancing buffer 'Props' to new syntax.
    2.  
    3.      
    4.         sampler2D _MainTex;
    5.         sampler2D _Bump;
    6.         fixed4 _Color;
    7.         float _YRotation;
    8.         float _XTurnFix;
    9.         float _VS_CullDistance;
    10.         float _VS_FarCullDistance;
    11.         float _Brightness;
    12.         int _InRow;
    13.         int _InCol;
    14.         int _CameraType;
    15.         float4 _VS_CameraPosition;
    16.      
    17.         #ifdef AT_HUE_VARIATION_ON
    18.             half4 _HueVariation;
    19.         #endif
    20.      
    21.      
    22.         struct Input
    23.         {
    24.             float2 uv_MainTex;
    25.             float4 d;
    26.         };
    27.  
    28.         // Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader.
    29.         // See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing.
    30.         // #pragma instancing_options assumeuniformscaling
    31.         UNITY_INSTANCING_BUFFER_START(Props)
    32.             // put more per-instance properties here
    33.         UNITY_INSTANCING_BUFFER_END(Props)
    34.      
    35.         //#define AT_CYLINDRICAL_MODE
    36.      
    37.         void vert (inout appdata_full v, out Input o)
    38.         {
    39.             UNITY_INITIALIZE_OUTPUT(Input,o);
    40.          
    41.             #ifdef AT_CHUNK
    42.                 float4 CENTER = v.vertex;
    43.                 float3 CORNER = v.normal * v.texcoord2.x;
    44.             #else
    45.                 float4 CENTER = float4(0,0,0,1);
    46.                 float3 CORNER = v.vertex.xyz;
    47.             #endif
    48.          
    49.             #define cameraPos _WorldSpaceCameraPos.xyz
    50.  
    51.             float3 clipVect;
    52.             clipVect = mul(unity_ObjectToWorld, CENTER).xyz - _VS_CameraPosition;
    53.  
    54.             #if defined(UNITY_PASS_SHADOWCASTER)
    55.              
    56.                 //float3 camVect = _WorldSpaceLightPos0.w < 0.5 ? _WorldSpaceLightPos0.xyz : mul(unity_ObjectToWorld, CENTER).xyz - _WorldSpaceLightPos0.xyz;
    57.                 float3 camVect;
    58.  
    59.                 if (unity_MatrixVP[3][3] == 1)
    60.                     camVect = _WorldSpaceLightPos0.w < 0.5 ? _WorldSpaceLightPos0.xyz : mul(unity_ObjectToWorld, CENTER).xyz - _WorldSpaceLightPos0.xyz;
    61.                 else
    62.                     camVect = mul(unity_ObjectToWorld, CENTER).xyz - cameraPos;
    63.  
    64.                 #define camVectEvenInShadows (mul(unity_ObjectToWorld, CENTER).xyz - cameraPos)        
    65.             #else
    66.              
    67.                 float3 camVect = mul(unity_ObjectToWorld, CENTER).xyz - cameraPos;
    68.                 #define camVectEvenInShadows camVect
    69.              
    70.             #endif
    71.          
    72.             //if(length(camVectEvenInShadows) < _CullDistance || length(camVectEvenInShadows) > _FarCullDistance)
    73.             if (length(clipVect) < _VS_CullDistance || length(clipVect) > _VS_FarCullDistance)
    74.             {
    75.                 CORNER.xyz *= 0;
    76.             }
    77.             else
    78.             {
    79.                 //#ifdef AT_CYLINDRICAL_ON
    80.                 //    camVect.y = 0;
    81.                 //#endif
    82.              
    83.                 // Create LookAt matrix
    84.                 float3 zaxis = normalize(camVect);        
    85.                 float3 xaxis = normalize(cross(float3(0, 1, 0), zaxis));
    86.                 float3 yaxis = cross(zaxis, xaxis);
    87.  
    88.                 float4x4 lookatMatrix = {
    89.                     xaxis.x,            yaxis.x,            zaxis.x,       0,
    90.                     xaxis.y,            yaxis.y,            zaxis.y,       0,
    91.                     xaxis.z,            yaxis.z,            zaxis.z,       0,
    92.                     0, 0, 0,  1
    93.                 };
    94.              
    95.                 #ifdef AT_CHUNK
    96.                     v.vertex = mul(lookatMatrix, float4(CORNER.x, CORNER.y, (yaxis.y - 1.0) * v.texcoord2.y, 1));
    97.                 #else
    98.                     v.vertex = mul(lookatMatrix, float4(CORNER.x, CORNER.y, (yaxis.y - 1.0) * _XTurnFix, 1));
    99.                 #endif
    100.          
    101.                 v.vertex.xyz += CENTER.xyz;
    102.              
    103.                 v.normal = -zaxis;
    104.                 v.tangent.xyz = xaxis;
    105.                 v.tangent.w=-1;
    106.              
    107.                 v.texcoord.x /= _InRow;
    108.                 v.texcoord.y /= _InCol;
    109.              
    110.                 float angle;
    111.                 float step;
    112.              
    113.                 //#ifdef AT_SINGLEROW_OFF
    114.                     float2 atanDir = normalize(float2(-zaxis.z, -zaxis.x));
    115.                     angle = (atan2(atanDir.y, atanDir.x) / 6.28319) + 0.5; // angle around Y in range 0....1
    116.                  
    117.                     #ifdef AT_CHUNK
    118.                         angle += v.texcoord1.x;
    119.                     #else
    120.                         angle += _YRotation;
    121.                     #endif
    122.                  
    123.                     angle -= (int)angle;
    124.                  
    125.                     step = 1.0 / _InRow;
    126.                  
    127.                     v.texcoord.x += step * ((int)((angle + step * 0.5) * _InRow));
    128.                 //#endif
    129.              
    130.                 //#ifdef AT_SINGLECOLUMN_OFF
    131.                     step = 1.0 / _InCol;
    132.                  
    133.                     angle = saturate(dot(-zaxis,float3(0,1,0)));
    134.                  
    135.                     angle = clamp(angle,0,step*(_InCol-1));
    136.                  
    137.                     v.texcoord.y += step * ((int)((angle + step * 0.5) * _InCol));
    138.                 //#endif
    139.              
    140.                 o.d.x = v.texcoord1.y;
    141.              
    142.                 #ifdef AT_HUE_VARIATION_ON
    143.                     float hueVariationAmount = frac(CENTER.x + CENTER.y + CENTER.z);
    144.                     //hueVariationAmount += frac(IN.vertex.x + IN.normal.y + IN.normal.x) * 0.5 - 0.3;
    145.                     o.d.y = saturate(hueVariationAmount * _HueVariation.a);
    146.                 #endif
    147.              
    148.             }
    149.         }
    150.      
    151.         void surf (Input IN, inout SurfaceOutput o)
    152.         {
    153.             //fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
    154.             fixed4 c = tex2Dbias(_MainTex, half4(IN.uv_MainTex,0,-2)) * _Color;
    155.          
    156.             #ifdef AT_HUE_VARIATION_ON
    157.                 half3 shiftedColor = lerp(c.rgb, _HueVariation.rgb, IN.d.y);
    158.                 half maxBase = max(c.r, max(c.g, c.b));
    159.                 half newMaxBase = max(shiftedColor.r, max(shiftedColor.g, shiftedColor.b));
    160.                 maxBase /= newMaxBase;
    161.                 maxBase = maxBase * 0.5f + 0.5f;
    162.                 // preserve vibrance
    163.                 shiftedColor.rgb *= maxBase;
    164.                 c.rgb = saturate(shiftedColor);
    165.             #endif
    166.          
    167.             #ifdef AT_CHUNK
    168.                 o.Albedo = c.rgb * IN.d.x *_Color;
    169.             #else
    170.                 o.Albedo = c.rgb * _Color;
    171.             #endif
    172.          
    173.               o.Albedo = clamp(o.Albedo * _Brightness, 0, 1);
    174.  
    175.             o.Normal = tex2D (_Bump, IN.uv_MainTex).rgb  * 2.0 - 1.0;
    176.             //o.Normal.z = abs(o.Normal.z);
    177.             o.Alpha = c.a;
    178.         }
    179.  
    As of now, basicly all parts of VS work for me under URP with custom shaders. Wind was reworked also to facilitate the custom gree and grass shaders I use. Vegetation baking and billboard baking also works. As well as all three types of rendering.
    I have no idea what is transferable between VS and VS Pro.
    Having said that, after much work and effort, it is usable, but far from 'perfect'.
     

    Attached Files:

    Last edited: Jun 7, 2023
  33. oguzkaancomoglu

    oguzkaancomoglu

    Joined:
    Aug 18, 2021
    Posts:
    50
    When you click his account logo, you can see he was there 1 min ago :)

    I was almost buy his asset but when I realised he not responding and not developing his assset I give up to buy.

    This is really weird.

    upload_2023-6-15_13-9-10.png
     
    valentin56610 and dsilverthorn like this.
  34. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    Until the author comes back, I would suggest against buying this in favor of buying a supported asset.
     
  35. whidzee

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    166
    VS Pro seems to be removed from the asset store now. Anyone know what's going on with that? All I can see is regular VS
     
  36. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    The other needs to come down as well. Unsupported assets have no place on the asset store for future versions of Unity.
     
    oguzkaancomoglu and jcarpay like this.
  37. JeffG

    JeffG

    Joined:
    Oct 21, 2013
    Posts:
    85
    Minor cheesy fix in case you delete some prefabs used

    In VegetationSystemProEditor.cs aproox line 1471

    Change

    Code (CSharp):
    1. Texture2D previewTexture = unityTerrain.GetTerrainPreviewTexture(textureIndex);
    with

    Code (CSharp):
    1.  Texture2D previewTexture = null;
    2.  
    3.                     try
    4.                     {
    5.                         previewTexture = unityTerrain.GetTerrainPreviewTexture(textureIndex);
    6.                     }
    7.                     catch { }
     
  38. johnmeyer

    johnmeyer

    Joined:
    Oct 17, 2016
    Posts:
    7
    I’ve tried contacting @LennartJohansen a couple of times via “conversations” on here, another guy has emailed AT, and attempted via discord but no replies as yet

    I see his account is still active, would be great just to be able to speak and see what options exist for those of us who have bought his asset and in effect need extra licenses available for our collaborators.

    As I understand it vspro was purchased as a non extension asset with a “site” license type, so for collaborated developers who work on their own projects creating bundles for use in our main project they always bought their own individual licenses. (Perhaps this was incorrect and we ended up generating a lot of unnecessary sales :) )

    obviously that’s no longer possible, so unless lennart approves something outside of unitys asset store / eula restrictions I assume we’re now stuck unable to grow our group any further
     
    dsilverthorn likes this.
  39. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    Lennart quit. Everyone move on. Nothing to see here.
     
  40. johnmeyer

    johnmeyer

    Joined:
    Oct 17, 2016
    Posts:
    7
    Would be good if he just then said, im not doing nayting with this any more, its a free for all, its no longer bound by asset store EULA etc etc We have a good amount of sub contractors wanting to use it, and as far as i can make out the site license doesnt permit that. A simple permission send via email or DM from the man himself would let us carry on as was, which Id think, as we as a group have already directly influenced over 100 license purchases over the last 18 months, a simple message, even if to say no for x reason wasnt much of an ask
     
    Last edited: Jul 11, 2023
    blacksun666 and hopeful like this.
  41. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    Folks still say he login into the forums
    @LennartJohansen . Bro open source your stuff if you are done!
     
  42. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    If nothing else burns a fire beneath the Unity Terrain team to do anything then one of the few mass vegetation renderer extension being abandoned better.
     
    BrokenVector and Hikiko66 like this.
  43. johnmeyer

    johnmeyer

    Joined:
    Oct 17, 2016
    Posts:
    7
    The lack of alternatives is shocking really. It staggers me how much protection is also left for abandoned assets, especially considering there is no physical protections in place. Ie the eula is an agreement between developer and end user. Developer in effect removes himself from that agreement and end user remains bounded by its terms irregardless, at least I assume that is the case, especially whilst the asset is still downloadable through the my assets section on asset store

    I have asked for clarification what happens if the asset gets completely removed from the store, does it even then still apply
     
  44. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,685
    People hoping to make money off of sales are more concerned about getting a new product out than what happens later, and how to properly retire it. You'd think Unity would be looking out for their customers a little better, but ... it hasn't looked that way yet.
     
    Willbkool_FPCS likes this.
  45. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,292
    I have no information why VSP got deprecated. However, since many of you guys still use it I thought rather than deprecating I'll make my VSP Extensions free. Enjoy! :)
     
  46. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    Lennart quit.
     
  47. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,292
    Is it official now? I'm wondering why he'd remove an asset that's been constantly in sales rather than giving it to someone who maintains it and just take his share from it.
     
    mwituni and dsilverthorn like this.
  48. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    No clue. Great asset and very sad to see it abandoned like so many other good Unity assets.
     
    mwituni and dsilverthorn like this.
  49. Setmaster

    Setmaster

    Joined:
    Sep 2, 2013
    Posts:
    239
    What is a good replacement? Gpu instancer?
     
  50. ScorphiusMultiplayer

    ScorphiusMultiplayer

    Joined:
    Nov 10, 2018
    Posts:
    66
    Gpu instancer is weird.
    For e.g Unity has "Enable GPU Instancing" on materials.
    Lets say if you have 1000 prefabs in the scene and if you turn that option on then the performance is similar to having GPU instance package.

    Also, I tried it last week. On 8kx8k Terrain. It worked in the scene, but then in the build the fps tanked.
    Back to VS as it still works and is better than GPU Instancer
     
    Last edited: Aug 3, 2023
    SickaGames1 likes this.