Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

[RELEASED] DirectX 11 Grass Shader

Discussion in 'Assets and Asset Store' started by Nonakesh, Aug 17, 2015.

  1. Nonakesh

    Nonakesh

    Joined:
    Aug 27, 2011
    Posts:
    446
    That sounds very strange. I have changed some things in the shadow code, so there's a chance that the patch will improve that, but it will likely not be fixed completely. I will try to fix this problem, but until I get a Oculus for myself, I probably won't be able to pinpoint the error correctly. You could help me by posting photos of the Oculus screens, screenshots aren't possible as far as I know. (After the patch was accepted by Unity, of course...)

    Thanks! I have never heard of GPU fx, but the shader should actually be in a single draw call (except I'm missing something here). That one draw call needs a lot of performance though!
     
  2. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,844
    Afaik its a sorta-known issue - possibly related to VR optimisations. You might want to ask the Alloy guys or Thomasz (RTP) as they're incredibly familiar with Unity's woefully undocumented changes. Scrawk (ceto) might help too. Generally there is no need to struggle alone...
     
    Arkade likes this.
  3. Plutoman

    Plutoman

    Joined:
    May 24, 2013
    Posts:
    257
    Yep! It's just a modified version of yours. I first attempted to modify mine and added tessellation to my geometry shader, applying it directly to the meshes, but I wasn't getting the same performance and I didn't feel like digging so deeply in to find out why.

    HSV colors was the biggest change, which was just simplifying the fragment shader so the normals worked (they seemed to be incorrect in deferred, but not forward.. but I was messing with a lot of stuff so that easily could be me), and the width expansion. It's particularly effective for me in tight areas with lots of other vegetation.

    Here's some example shots;
    https://www.dropbox.com/s/0puy0xikoftrcci/Screenshot 2015-08-19 17.38.43.png?dl=0
    https://www.dropbox.com/s/ft0rpwisdpw806p/Screenshot 2015-08-20 15.09.06.png?dl=0
    https://www.dropbox.com/s/qlb0skgtwswa4hw/Screenshot 2015-08-20 15.09.11.png?dl=0
    https://www.dropbox.com/s/ixpzhyvh2ddeie0/Screenshot 2015-08-20 15.09.21.png?dl=0
    https://www.dropbox.com/s/x7j3h5jozsmdswt/Screenshot 2015-08-19 17.49.07.png?dl=0
    https://www.dropbox.com/s/c0hih2rrrlgdrbs/Screenshot 2015-08-19 17.57.26.png?dl=0

    As you can see, the performance difference between a 20x20 area and a 60x60 view area wasn't that dramatic (though it's not exactly cheap, still, for such a thick field of accurate grass, that's far better than you'll get with anything else). Turning the 60x60 lights into shadowed lights gave me about 60fps total, around 25ms processing time on my laptop GPU (GTX 760M). A lot of the processing time is from fill-rate at 900p, not necessarily the grass itself even - well, more specifically, it's not fill-rate, but the fact that tessellation based on edge length means that the performance of the grass is directly proportional to the pixel screen-space. This is also with 3 texture samples and a HSV to RGB conversion + some math, as I find setting colors in HSV so more useful to vary hues rather than saturation. Picking more randomized colors is easier. It's also extremely smooth looking around, the grass is so dynamically filled and modified that you cannot tell the LOD changes.

    If you're particularly concerned about performance.. my guess that the best look vs performance approach is going to be a single texture variant, since you can run a much lower density and still get a decent view, and you can have it do quads at a low LOD level. The pixel performance won't change that dramatically since it's already not the bottleneck. It won't need to be nearly as thick to look really good, which will dramatically lower the processing intensity. I'll probably explore that later, for intel HD cards. At the moment, I've directly added all the grass to my terrain shaders so it's processed in one go, which means all the tessellation passes are back-to-back (my terrain is tessellated already).

    Taking a look at the intro pictures, I would guess those run quite blazing fast compared to my thick field, even, as you can have one blade for every 10 I have.

    I rather like graphics, actually. Sometimes it takes a wall of text to realize how obsessed you are.
     
    hippocoder likes this.
  4. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    I've tried this over and over....I cannot get it to displace. I'm looking forward to a demo scene! :)
    I see its adding a normal map to the displacement slot, but there's no displacement at any values, size..amount..
    The map doesn't get edited. I tried another normal map and that displaced, do I need to set a map first then let the script add its own? or is it a choice to use the script or an editable texture?
    I've also tried a mesh collider, box collider... set the layers...added the displacer to my player...

    Thanks!
     
  5. Nonakesh

    Nonakesh

    Joined:
    Aug 27, 2011
    Posts:
    446
    That really sounds like you did everything right.. could you send me your scene, or a small test scene of your setup? It would be really helpful to see what could have gone wrong.

    Oh, I quite know what you mean! That is how I started the shader actually. The small test of mine suddenly got a bit out of hand! :)

    I'd also be interested into the Intel HD cards. I've read somewhere that their performance with geometry shaders is far above AMD and Nvidia, but I guess they'd just immediately switch to the bottleneck of the fill rate instead.

    That sounds like a good idea actually! It's still a bit hard to debug without having a VR kit myself, but with a bit of help it could work out.
     
  6. VirtualisDev

    VirtualisDev

    Joined:
    Jul 21, 2015
    Posts:
    30
    Thanks for all this !

    (i didn't undersand what you said : "I forget this one in the package... oh well, I guess @Timothee35 who requested it, will see it here anyways!")
     
  7. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    435
    Very nice shader!
    Unfortunately we couldn't make it run on PS4 (with deferred shading)... yet Unity's documentation seems to indicate that tessellation and geometry shaders should work there.

    @Nonakesh Any ideas about this?
    @hippocoder You mentionned you were targeting PS4 too, did you manage to make it work there?

    Thanks!
     
  8. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,844
    Hi Jean - haven't tested yet. It might be a semantic or define issue. Are you using the latest Unity build for PS4? In these cases it's worth bug reporting to Unity as well since it's not bullet proof their end either.
     
  9. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    435
    Well I'm not the person testing directly, but we're at 5.1.2 (no patch).
    Didn't see any possibly problematic semantics but I might have missed some things.
    About the defines, what could be wrong?
     
  10. Nonakesh

    Nonakesh

    Joined:
    Aug 27, 2011
    Posts:
    446
    I just forgot to add that in the changelog on the asset store, sorry for being confusing!

    Is it just not working at all, or are there visual bugs? If it's the former, could you post the error messages? You can see those in the inspector when selecting the Grass.shader file. Also are you sure tessellation is supported on PS4? Everywhere I've been looking it says that tessellation is DX11 only.
     
  11. Plutoman

    Plutoman

    Joined:
    May 24, 2013
    Posts:
    257
    It should be, PS4 supports the DX11 API afaik. I'm targeting it, too, but I have not tested either (mainly as I haven't yet bought the PS4 to test with...). Or rather, it supports OpenGL in a way that's modified to support the same 11.2 feature set. Unity's compiler should handle that, but it's quite possible that it doesn't (since the HLSL to GLSL compiler might not be perfect). I don't think it can run straight HLSL.. but I don't know entirely offhand.
     
  12. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    435
    I do get errors in Unity, a bunch actually but I suspect them to be a chain reaction.
    Here they are:
    Shader error in 'Stix Games/Grass': Program 'domain', expected type specifier, but found 'else' instead at line 123 (on ps4)
    Compiling Domain program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 123)

    Shader error in 'Stix Games/Grass': Program 'frag', expected type specifier, but found 'else' instead at line 123 (on ps4)
    Compiling Fragment program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 123)

    Shader error in 'Stix Games/Grass': Program 'geom', expected type specifier, but found 'else' instead at line 123 (on ps4)
    Compiling Geometry program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 123)

    Shader error in 'Stix Games/Grass': Program 'hull', expected type specifier, but found 'else' instead at line 123 (on ps4)
    Compiling Hull program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 123)

    Shader error in 'Stix Games/Grass': Program 'vert', expected type specifier, but found 'else' instead at line 123 (on ps4)
    Compiling Vertex program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 123)

    Shader error in 'Stix Games/Grass': Program 'domain', expected type specifier, but found 'else' instead at line 128 (on ps4)
    Compiling Domain program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 128)

    Shader error in 'Stix Games/Grass': Program 'frag', expected type specifier, but found 'else' instead at line 128 (on ps4)
    Compiling Fragment program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 128)

    Shader error in 'Stix Games/Grass': Program 'geom', expected type specifier, but found 'else' instead at line 128 (on ps4)
    Compiling Geometry program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 128)

    Shader error in 'Stix Games/Grass': Program 'hull', expected type specifier, but found 'else' instead at line 128 (on ps4)
    Compiling Hull program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 128)

    Shader error in 'Stix Games/Grass': Program 'vert', expected type specifier, but found 'else' instead at line 128 (on ps4)
    Compiling Vertex program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 128)

    Shader error in 'Stix Games/Grass': Program 'domain', expected type specifier, but found 'identifier' instead at line 135 (on ps4)
    Compiling Domain program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 135)

    Shader error in 'Stix Games/Grass': Program 'frag', expected type specifier, but found 'identifier' instead at line 135 (on ps4)
    Compiling Fragment program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 135)

    Shader error in 'Stix Games/Grass': Program 'geom', expected type specifier, but found 'identifier' instead at line 135 (on ps4)
    Compiling Geometry program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 135)

    Shader error in 'Stix Games/Grass': Program 'hull', expected type specifier, but found 'identifier' instead at line 135 (on ps4)
    Compiling Hull program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 135)

    Shader error in 'Stix Games/Grass': Program 'vert', expected type specifier, but found 'identifier' instead at line 135 (on ps4)
    Compiling Vertex program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 135)

    Shader error in 'Stix Games/Grass': Program 'domain', unexpected undeclared identifier 'vertexPosition' at line 141 (on ps4)
    Compiling Domain program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 141)

    Shader error in 'Stix Games/Grass': Program 'frag', unexpected undeclared identifier 'vertexPosition' at line 141 (on ps4)
    Compiling Fragment program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 141)

    Shader error in 'Stix Games/Grass': Program 'geom', unexpected undeclared identifier 'vertexPosition' at line 141 (on ps4)
    Compiling Geometry program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 141)

    Shader error in 'Stix Games/Grass': Program 'hull', unexpected undeclared identifier 'vertexPosition' at line 141 (on ps4)
    Compiling Hull program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 141)

    Shader error in 'Stix Games/Grass': Program 'vert', unexpected undeclared identifier 'vertexPosition' at line 141 (on ps4)
    Compiling Vertex program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 141)

    Shader error in 'Stix Games/Grass': Program 'domain', unexpected undeclared identifier 'vertexPosition' at line 142 (on ps4)
    Compiling Domain program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 142)

    Shader error in 'Stix Games/Grass': Program 'frag', unexpected undeclared identifier 'vertexPosition' at line 142 (on ps4)
    Compiling Fragment program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 142)

    Shader error in 'Stix Games/Grass': Program 'geom', unexpected undeclared identifier 'vertexPosition' at line 142 (on ps4)
    Compiling Geometry program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 142)

    Shader error in 'Stix Games/Grass': Program 'hull', unexpected undeclared identifier 'vertexPosition' at line 142 (on ps4)
    Compiling Hull program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 142)

    Shader error in 'Stix Games/Grass': Program 'vert', unexpected undeclared identifier 'vertexPosition' at line 142 (on ps4)
    Compiling Vertex program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 142)

    Shader error in 'Stix Games/Grass': Program 'domain', expected type specifier, but found 'identifier' instead at line 143 (on ps4)
    Compiling Domain program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 143)

    Shader error in 'Stix Games/Grass': Program 'frag', expected type specifier, but found 'identifier' instead at line 143 (on ps4)
    Compiling Fragment program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 143)

    Shader error in 'Stix Games/Grass': Program 'geom', expected type specifier, but found 'identifier' instead at line 143 (on ps4)
    Compiling Geometry program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 143)

    Shader error in 'Stix Games/Grass': Program 'hull', expected type specifier, but found 'identifier' instead at line 143 (on ps4)
    Compiling Hull program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 143)

    Shader error in 'Stix Games/Grass': Program 'vert', expected type specifier, but found 'identifier' instead at line 143 (on ps4)
    Compiling Vertex program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 143)

    Shader error in 'Stix Games/Grass': Program 'domain', unexpected undeclared identifier 'tLoc'. Did you mean 'acos'? at line 146 (on ps4)
    Compiling Domain program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 146)

    Shader error in 'Stix Games/Grass': Program 'frag', unexpected undeclared identifier 'tLoc'. Did you mean 'acos'? at line 146 (on ps4)
    Compiling Fragment program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 146)

    Shader error in 'Stix Games/Grass': Program 'geom', unexpected undeclared identifier 'tLoc'. Did you mean 'acos'? at line 146 (on ps4)
    Compiling Geometry program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 146)

    Shader error in 'Stix Games/Grass': Program 'hull', unexpected undeclared identifier 'tLoc'. Did you mean 'acos'? at line 146 (on ps4)
    Compiling Hull program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 146)

    Shader error in 'Stix Games/Grass': Program 'vert', unexpected undeclared identifier 'tLoc'. Did you mean 'acos'? at line 146 (on ps4)
    Compiling Vertex program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 146)

    Shader error in 'Stix Games/Grass': Program 'domain', expected type specifier, but found 'identifier' instead at line 150 (on ps4)
    Compiling Domain program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 150)

    Shader error in 'Stix Games/Grass': Program 'frag', expected type specifier, but found 'identifier' instead at line 150 (on ps4)
    Compiling Fragment program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 150)

    Shader error in 'Stix Games/Grass': Program 'geom', expected type specifier, but found 'identifier' instead at line 150 (on ps4)
    Compiling Geometry program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 150)

    Shader error in 'Stix Games/Grass': Program 'hull', expected type specifier, but found 'identifier' instead at line 150 (on ps4)
    Compiling Hull program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 150)

    Shader error in 'Stix Games/Grass': Program 'vert', expected type specifier, but found 'identifier' instead at line 150 (on ps4)
    Compiling Vertex program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 150)

    Shader error in 'Stix Games/Grass': Program 'domain', expected type specifier, but found 'identifier' instead at line 153 (on ps4)
    Compiling Domain program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 153)

    Shader error in 'Stix Games/Grass': Program 'frag', expected type specifier, but found 'identifier' instead at line 153 (on ps4)
    Compiling Fragment program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 153)

    Shader error in 'Stix Games/Grass': Program 'geom', expected type specifier, but found 'identifier' instead at line 153 (on ps4)
    Compiling Geometry program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 153)

    Shader error in 'Stix Games/Grass': Program 'hull', expected type specifier, but found 'identifier' instead at line 153 (on ps4)
    Compiling Hull program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 153)

    Shader error in 'Stix Games/Grass': Program 'vert', expected type specifier, but found 'identifier' instead at line 153 (on ps4)
    Compiling Vertex program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 153)

    Shader error in 'Stix Games/Grass': Program 'domain', expected type specifier, but found 'identifier' instead at line 158 (on ps4)
    Compiling Domain program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 158)

    Shader error in 'Stix Games/Grass': Program 'frag', expected type specifier, but found 'identifier' instead at line 158 (on ps4)
    Compiling Fragment program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 158)

    Shader error in 'Stix Games/Grass': Program 'geom', expected type specifier, but found 'identifier' instead at line 158 (on ps4)
    Compiling Geometry program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 158)

    Shader error in 'Stix Games/Grass': Program 'hull', expected type specifier, but found 'identifier' instead at line 158 (on ps4)
    Compiling Hull program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 158)

    Shader error in 'Stix Games/Grass': Program 'vert', expected type specifier, but found 'identifier' instead at line 158 (on ps4)
    Compiling Vertex program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 158)

    Shader error in 'Stix Games/Grass': Program 'domain', expected type specifier, but found 'identifier' instead at line 159 (on ps4)
    Compiling Domain program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 159)

    Shader error in 'Stix Games/Grass': Program 'frag', expected type specifier, but found 'identifier' instead at line 159 (on ps4)
    Compiling Fragment program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 159)

    Shader error in 'Stix Games/Grass': Program 'geom', expected type specifier, but found 'identifier' instead at line 159 (on ps4)
    Compiling Geometry program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 159)

    Shader error in 'Stix Games/Grass': Program 'hull', expected type specifier, but found 'identifier' instead at line 159 (on ps4)
    Compiling Hull program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 159)

    Shader error in 'Stix Games/Grass': Program 'vert', expected type specifier, but found 'identifier' instead at line 159 (on ps4)
    Compiling Vertex program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 159)

    Shader error in 'Stix Games/Grass': Program 'domain', expected type specifier, but found 'identifier' instead at line 160 (on ps4)
    Compiling Domain program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 160)

    Shader error in 'Stix Games/Grass': Program 'frag', expected type specifier, but found 'identifier' instead at line 160 (on ps4)
    Compiling Fragment program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 160)

    Shader error in 'Stix Games/Grass': Program 'geom', expected type specifier, but found 'identifier' instead at line 160 (on ps4)
    Compiling Geometry program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 160)

    Shader error in 'Stix Games/Grass': Program 'hull', expected type specifier, but found 'identifier' instead at line 160 (on ps4)
    Compiling Hull program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 160)

    Shader error in 'Stix Games/Grass': Program 'vert', expected type specifier, but found 'identifier' instead at line 160 (on ps4)
    Compiling Vertex program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 160)

    Shader error in 'Stix Games/Grass': Program 'domain', expected type specifier, but found 'return' instead at line 162 (on ps4)
    Compiling Domain program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 162)

    Shader error in 'Stix Games/Grass': Program 'frag', expected type specifier, but found 'return' instead at line 162 (on ps4)
    Compiling Fragment program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 162)

    Shader error in 'Stix Games/Grass': Program 'geom', expected type specifier, but found 'return' instead at line 162 (on ps4)
    Compiling Geometry program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 162)

    Shader error in 'Stix Games/Grass': Program 'hull', expected type specifier, but found 'return' instead at line 162 (on ps4)
    Compiling Hull program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 162)

    Shader error in 'Stix Games/Grass': Program 'vert', expected type specifier, but found 'return' instead at line 162 (on ps4)
    Compiling Vertex program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 162)

    Shader error in 'Stix Games/Grass': Program 'domain', expected an identifier but found keyword 'DOMAIN_PATCH_TYPE' at line 537 (on ps4)
    Compiling Domain program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 537)

    Shader error in 'Stix Games/Grass': Program 'domain', expected type specifier, but found 'DOMAIN_PATCH_TYPE' instead at line 537 (on ps4)
    Compiling Domain program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 537)

    Shader error in 'Stix Games/Grass': Program 'frag', expected an identifier but found keyword 'DOMAIN_PATCH_TYPE' at line 537 (on ps4)
    Compiling Fragment program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 537)

    Shader error in 'Stix Games/Grass': Program 'frag', expected type specifier, but found 'DOMAIN_PATCH_TYPE' instead at line 537 (on ps4)
    Compiling Fragment program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 537)

    Shader error in 'Stix Games/Grass': Program 'geom', expected an identifier but found keyword 'DOMAIN_PATCH_TYPE' at line 537 (on ps4)
    Compiling Geometry program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 537)

    Shader error in 'Stix Games/Grass': Program 'geom', expected type specifier, but found 'DOMAIN_PATCH_TYPE' instead at line 537 (on ps4)
    Compiling Geometry program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 537)

    Shader error in 'Stix Games/Grass': Program 'hull', expected an identifier but found keyword 'DOMAIN_PATCH_TYPE' at line 537 (on ps4)
    Compiling Hull program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 537)

    Shader error in 'Stix Games/Grass': Program 'hull', expected type specifier, but found 'DOMAIN_PATCH_TYPE' instead at line 537 (on ps4)
    Compiling Hull program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 537)

    Shader error in 'Stix Games/Grass': Program 'vert', expected an identifier but found keyword 'DOMAIN_PATCH_TYPE' at line 537 (on ps4)
    Compiling Vertex program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 537)

    Shader error in 'Stix Games/Grass': Program 'vert', expected type specifier, but found 'DOMAIN_PATCH_TYPE' instead at line 537 (on ps4)
    Compiling Vertex program with LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF UNITY_HDR_ON
    (Filename: Grass Line: 537)

    Now that I do see the errors I'll try to sort them out, but if you have ideas let me know!
    Thanks!

    Edit: I found that most of these errors come from GrassTessellation.cginc, in the #ifndef NO_TESSELLATION_SMOOTHING block: if I comment out the 'if/else if/else if' branches, the errors disappear. I can't figure out why it doesn't work though.

    I still can't track down the errors about the 'DOMAIN_PATCH_TYPE', but it does seem to come from GrassTessellation.cginc too.

    Edit 2: So if I removed the domain() program and disable it from Grass.shader, then it compiles fine! But I can't figure out what's wrong in it... maybe it has to do with semantics but having no experience with domain/hull/geometry shaders I can't make much sense out of it (despite trying several random things)
    I hope this can help you though!
     
    Last edited: Aug 22, 2015
  13. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    I'm running into an issue where I can no longer edit my grass shader. No checkboxes work, no changes to texture numbers work. Starting Unity doesn't fix it, but rebooting my pc did.
    Thanks
     
  14. Jean-Moreno

    Jean-Moreno

    Joined:
    Jul 23, 2012
    Posts:
    435
    Tried some new things this morning, and I think I've finally found the one issue that was causing all the others: it was just a name collision!
    It turns out that you can't call your domain function 'domain()' for it to compile properly on PS4.
    Still have to test on device but at least Unity doesn't complain about anything anymore after the name change!
     
    hopeful likes this.
  15. Nonakesh

    Nonakesh

    Joined:
    Aug 27, 2011
    Posts:
    446
    I hope you don't run into the problem again, but that sounds like it's more of a problem with Unity or your PC than it's with the shader. If any other problems occur, please go ahead and share them here!

    Thanks for tracking down the problem that far! Without being able to compile for PS4 that would have been quite difficult to find. If that turns out to work on the PS4, I'll definitely change it in the next patch. It's a small fix after all!
     
  16. khos85

    khos85

    Joined:
    Jul 21, 2013
    Posts:
    541
    Hi, I found this thread, sent an email to you also, your asset looks amazing!
    Hope it is ok to ask a question or two:
    How far can the grass be drawn on terrains, do the same distance limitations apply?
    Also, can grass be drawn on only terrains or other meshes?
     
  17. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Can you spell out the steps needed or supply a test scene that has the grass displacement working. I still cannot get it working, all seems good but the Displacement normal image it added never gets edited.
    Anyone else having issues setting it up or could give step by step? I'm wondering if i'm not using the right type of collider, setup.. It would help if in the manual there were steps, not just bullet points. I cant really send a project right now.

    Thanks!
     
  18. Nonakesh

    Nonakesh

    Joined:
    Aug 27, 2011
    Posts:
    446
    My host is currently having some trouble, so the support mail doesn't work right now. Great timing, I know...

    The view distance really only has two limits: The far clip plane of you camera (which is the limit off all geometry) and your processing power. It doesn't have any hard coded limits, but the performance cost will increase drastically at some point.

    The grass can be drawn on every mesh. Actually it has a few limitations with being drawn on a terrain, like no height, splat and color map support. On the terrain there can also be some grass popping, because of Unitys own LOD system.

    If you can send me your invoice number (in the mail Unity sent you) I can send you the newest patch directly, but here are some steps anyways (Taken from the new version of the manual):
    • The object with the grass material has to be on a layer you have selected in the layer mask.
    • The object with the grass material has to have a collider.
    • The object with the grass material must have a UV map. The displacement is based on a texture, so without one it will not work.
    • The displacing object does not need a collider. The displacement is done by raycasting. Of course you can add one if you need it otherwise, just don’t put the character collider on the grass layer.
    • The grass material has to have a editable displacement texture. It can be added with the Grass Texture Adder class.
    • The texture must be large enough for the area. Keep in mind that very large textures will significantly decrease performance. If you want to have displacement in a very large area, you could split it into smaller parts and use several small textures instead of one large one.
    I'm sorry about the confusion, but those bullet point are everything that's needed, you can use them like a step by step guide. I did forget the UV map in the last version of the manual, so maybe that's your problem. I hope the new version, with the example scene will be more helpful.
     
  19. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,844
    Is it raycasting per blade per frame? I haven't checked but that would be a bit perf hungry with lots of potential workarounds.
     
  20. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    Think we could get this into jove?
     
  21. Nonakesh

    Nonakesh

    Joined:
    Aug 27, 2011
    Posts:
    446
    You mean the shader itself? It's not raycasting at all. The blades of grass are generated in a geometry shader, so the rendering itself is rather efficient. The main bottleneck is the generation of the geometry itself.

    I'm not familiar with jove, but as they are overwriting Unity's lighting system, I assume that some changes to the shader would be necessary.
     
  22. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,844
    No, I just wondered why it required a collider and so forth, given that we have a displacement map.
     
  23. Nonakesh

    Nonakesh

    Joined:
    Aug 27, 2011
    Posts:
    446
    Ah, you mean the displacer. Well, right now I'm using a texture for displacing the grass, which definitely isn't the most efficient way to do it, but in turn it's very flexible. I'm using 3 raycasts for getting the position, size and rotation of the grass on the texture. That information is then used to rewrite parts of the texture. The most expensive step of that is applying the texture. I've been thinking about other ways to do it, but haven't really found a much better way. If you have a idea, I'm all ears!

    Edit: The collider is also for the base geometry, not the one generated by the shader.
     
  24. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,844
    Not sure how relevant this is but my old grass displacement worked by generating, essentially a custom packed normal map. I used a render texture for grass displacement and kept a list of unity sprites which I drew to the render texture. These sprites had directionality, rotation, scale and so forth, as well as baked normal. It was a lighter version of the cryengine 3 technique. The sprites were in world space.

    As I kept a list of them, I was able to update this texture per frame without much hit at all, including feathering the edges of the texture, so when I moved around the world (currently 25 km), displacement was trivial. Naturally it's a texture sample used, but no costly transfer from cpu to gpu. I wasn't using geometry shaders but just grass batches which read the texture in vertex.

    I'm not sure how relevant that is to yours, but it did essentially allow for unlimited displacement (within reason) and of course no raycasts and any shape I wanted. As it was a texture that was refreshed each frame, I could fade the sprites for grass to slowly spring back in shape and so on, and I didn't require a particularly high resolution map (256 or 512 was sufficient for me, for the 25km world as the contents were generated based on world space sprites, and it was feathered).

    I doubt half of that made much sense, sorry :p coffee.
     
  25. Nonakesh

    Nonakesh

    Joined:
    Aug 27, 2011
    Posts:
    446
    That actually sounds like a great idea, I'll definitely try that!

    So were you moving the texture itself in relation to the terrain? And you just rendered the area around the camera, so you could still get persistence without needing a huge texture? It might not be as flexible as what I'm using right now, but it's definitely much more efficient and probably easier to use as well. The only disadvantage I can think of right now is that making trails like that would be a bit difficult, but still manageable.
     
  26. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,844
    Well the trails are kind of persistent by the list of sprites you have. It's not too expensive plus the sprites can fade and return to the pool. The granularity isn't top notch, but you seldom notice it. It doesn't have to be sprites. Trail renderer is an interesting choice for rendering to it too. The texture is of course stationary but the camera that renders the sprites, naturally follows you around.

    I guess it's just a matter of what you might want to experiment with now you have some ideas to play with. I haven't abandoned my grass as it's brutally efficient, except my grass is actually pre-cooked mesh batches instead of geometry shader. It's much quicker, but not very nice to look at. Planned to keep it in some form for short fuzz, but use your system for larger sexier grass :)

    I preferred this approach as I could have 20-30 enemies locally disturbing grass that *didn't stay flattened* ie moving through undergrowth, or having only a limited trail behind them. It's nice for that as well as persistence, you get to choose both.
     
    Nonakesh likes this.
  27. Nonakesh

    Nonakesh

    Joined:
    Aug 27, 2011
    Posts:
    446
    I think your approach is actually quite a lot better than mine. The limitations are reasonable, it's easy to manage, ease to extend and super efficient on top of that. I'll most likely add that to the shader sometimes later, so thanks for the idea!

    By the way, I've always thought that my approach would be perfect for mixing it with mesh grass or plant models to get better, less uniform results, so you could combine both!
     
    JonDadley, hopeful and hippocoder like this.
  28. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    4,947
    I like efficiency, I like good looks, and I like options. This is sounding better and better! :)
     
  29. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Got the grass displacement working, its amazing laying grass down! Wow.
    Thanks
     
    Nonakesh likes this.
  30. broesby

    broesby

    Joined:
    Oct 14, 2012
    Posts:
    112
    Can't figure out if it can work with Terrain Composer, RTP or both??
     
  31. Nonakesh

    Nonakesh

    Joined:
    Aug 27, 2011
    Posts:
    446
    As far as I can see right now, these are both extensions of the Unity terrain system, so I guess it should work with both, but with the same limitations. If they are more than just a shader applied to the Unity terrain, I have no idea. It kind of depends on how they work internally, but it should have the same functionality as with Unity terrain almost everywhere.
     
  32. LeonDrace

    LeonDrace

    Joined:
    Apr 5, 2014
    Posts:
    5
    Hello,

    Iam always looking for new grass alternatives for my game and Iam interested in this but Iam not sure yet, if it would work for me.
    So I've got a couple of questions.
    Since it is sad that it's dynamic, am I able to completly disable grass at specific spots? Since from pictures it seems like it's updating the scaling so I assume yes but just to be sure. The reason beeing Iam working on a some sort of city builder so I need to remove the grass underneath a building that's getting constructed.
    And how precise am I able to update those positions ? I haven't seen any information about the event system for that so Iam kind of curious what Iam able to do at runtime.

    Moreover I have dynamic weather due to that wind is updating more or less permanently for trees, bushes etc.
    Grass is generally since the camera isn't that close not too important but it would be a nice addition I guess.
    So is the wind value procedural, can I update that while runtime without it looking choppy or something?

    best regards,
    Leon
     
  33. Nonakesh

    Nonakesh

    Joined:
    Aug 27, 2011
    Posts:
    446
    Those two things are actually not related, but yes, you can disable parts of the grass. You can specify a few things with texture (so you can change them depending on the position): how high the grass is, what color it has and how dense it is (but make sure to read the manual about that, that point can be a bit tricky).

    Unfortunately you can't change the wind procedurally. The wind is calculated with a set of sine and cosine functions, so when you change the scaling on the wind, the grass twitches around like crazy. You could turn off the strength to zero before changing the speed or the direction of the wind, that would probably work, but might still look strange. This could change in the future if I find a alternative way of calculating the wind. (Maybe with the new displacement technique? I can't promise any time frame for this though...)

    There's another problem I see with your use case: the grass doesn't look that great from far above. It's best used when actually walking though the grass, but when shown from above, you can see the falloff of the grass density very obviously.
     
  34. LeonDrace

    LeonDrace

    Joined:
    Apr 5, 2014
    Posts:
    5
    The wind like I mentioned isn't too dramatic for me. But the camera distance, angle and beeing able to manipulate it in some fashion is.

    Well Iam not that "far" above max. is 30m but that's a reason why Iam always looking for alternatives, since most do really look strange. But from that distance it is still a difference in having grass or not.

    I've included a screenshot.

    That's how it is looking right now with the one Iam currently using, that's actually the best result from that angle I got so far but it is quite heavy right now and not as versatile.Here you are able to see the falloff as well but I still think it's not too bad.
    That's why I was hoping that this Asset would fit my needs a bit better but I guess my usecase is a bit different than most.
     

    Attached Files:

  35. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,844
    Wind speed should be enough actually if it's just time or a multiplier to time... so while bending would act funny, how fast it bends might be sufficient for users? just thinking out loud.
     
  36. Zyblade

    Zyblade

    Joined:
    Jul 1, 2014
    Posts:
    93
    edit: already private message the author,.. nvm
     
    Last edited: Aug 24, 2015
  37. Nonakesh

    Nonakesh

    Joined:
    Aug 27, 2011
    Posts:
    446
    If you aren't using Unity terrain for this, it should work fine. (With Unity terrain you can't turn off the grass right now)
    I've tried it out with that distance so I can say that it could work for you, if you play around with the settings.

    I tried setting it up, you could possibly get much better results:


    Hm, it might work when using a script to manually push the time to the shader, although that would require to add a script to every object that uses the shader, which sounds a bit annoying. Maybe I'll add it as an alternative...
     
  38. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,844
  39. Nonakesh

    Nonakesh

    Joined:
    Aug 27, 2011
    Posts:
    446
    I didn't know that SetGlobalFloat could overwrite builtin values! (And even if it doesn't it would still be rather easy to change)
     
  40. Nonakesh

    Nonakesh

    Joined:
    Aug 27, 2011
    Posts:
    446
    I just got a message from Unity that the patch was accepted! It should be available on the store in the next hour!
     
    hippocoder and JonDadley like this.
  41. JonDadley

    JonDadley

    Joined:
    Sep 2, 2013
    Posts:
    139
    Looks like it's up already! Just updated!
     
    Nonakesh likes this.
  42. Zyblade

    Zyblade

    Joined:
    Jul 1, 2014
    Posts:
    93
    I just realized, my problem with displacement was, I didn't put the TextureUpdater to the plane. Maybe adding this hint to the pdf if someone else got stuck at this point.

    edit: Nvm, updater got added automatically. Dunno what I did wrong. In the new update the example works for me, so yay^^
     
    Last edited: Aug 24, 2015
    hippocoder likes this.
  43. LeonDrace

    LeonDrace

    Joined:
    Apr 5, 2014
    Posts:
    5
    Thanks for showing a screenshot how it might look from my camera angle.

    Good point is that I don't use a terrain for the grass right now so it wouldn't be a big difference.
    Maps are going to be kinda flat so Iam able to use helper objects for the areas where I want grass.
    I assume the object which uses grass will be completly filled with it or am I able to paint it?

    But from the looks of it I think Iam definitly checking it out soonish.
     
  44. khos85

    khos85

    Joined:
    Jul 21, 2013
    Posts:
    541
    I purchased your asset, it certainly is a great looking asset, I love this just in a few minutes I was able to use it and as you get past the Unity terrain grass distance limit! I'm already using your asset to great effect (Well I think anyway),see youtube video of how I added it to my upcoming steam game:



    One thing I did notice is as this a shader if you set e.g. grass height in one scene, then move to another and change the grass height on that scene's object it actually sets the grass height for all grass in all scenes as you set the shader properties... maybe I'm doing something wrong (I might have to read all of the docs :) ) but wanted to know if there is a way around that, set grass height/properties per scenes?

    Also, I know this is DX11 only so MAC/ Linux won't work, is there any plan to somehow try port this to those platforms? (I can't imagine how but thought to ask)

    Thanks for making this nice asset!
     
  45. Nonakesh

    Nonakesh

    Joined:
    Aug 27, 2011
    Posts:
    446
    You can set the grass density or height with a texture. You can draw the texture in any program, or use one of the texture drawing assets.

    Looks interesting! But you should probably change that texture.. texture making really isn't my strongest point! ;)

    The only thing I can think of how that could have happened, is that you used the same material for both scenes. Materials are global in Unity, not bound to the scene. Just duplicate the material and add it in the second scene!
     
  46. khos85

    khos85

    Joined:
    Jul 21, 2013
    Posts:
    541
    Thanks for the info, I kind of like the grass the way it is in those scenes, how would you change it? :) , aside from that, which texture are you referring to, the grass texture is shared between scenes? Probably :) I'll check.
     
  47. Nonakesh

    Nonakesh

    Joined:
    Aug 27, 2011
    Posts:
    446
    I was kidding about the grass texture! Of course you should keep it, if it fits to your scene!
    And the material is the thing called "CropMaterial.mat". It is where you can set the shader and edit its settings.

    You can think of it like that: The material is the (shared) container of all the settings you can change, including the textures and everything. One material is the same wherever you use it, even in different scenes. If you want a different look in different scenes, you will have to use multiple materials. The
     
  48. Nonakesh

    Nonakesh

    Joined:
    Aug 27, 2011
    Posts:
    446
    Oh and I forgot to answer that question: Unfortunately there isn't really a way for me to do that, but as soon as Unity adds the support for the features needed, it should work there as well!
     
  49. roxIndie

    roxIndie

    Joined:
    Oct 14, 2012
    Posts:
    27
    Looks good. Fix the terrain support, and you could easily double the price!
     
  50. kzaurckichz

    kzaurckichz

    Joined:
    Nov 5, 2013
    Posts:
    52
    Just bought it, looks very good, this asset is perfect except for one very simple thing you could add.
    It's missing a feature for defining the UP vector.
    Currently it seams like it uses the world up, but in some cases (Making a planet with grass), we need to be able to set it's up vector so the grass always points outwards from the planet's center.
    The planet is made from thousands (billions with LOD) of separate meshes to form a very big sphere.
    We would like to be able to programmatically set the up vector Per Mesh.
    I think a simple variable in the shader will do (with a few basic tweaks in the shader code).
    I could jump in and try to add it myself, but it would be better if you add this feature or if you give me instructions on where to start.

    Thank you.