Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

T4M Black Edition

Discussion in 'Assets and Asset Store' started by SJAM, Feb 14, 2012.

  1. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
  2. backwheelbates

    backwheelbates

    Joined:
    Jan 14, 2014
    Posts:
    231
    Thanks for the reply. That's right I'm targeting mobile. I'm trying to avoid unity terrains all together. Actually the only feature I was looking for was splatmap painting in unity.

    So I've installed an old unity just for painting splatmaps in t4m and I also found a free splatmap export tool. I'm using custom splat shaders in unity 5 anyways, so this is a decent work around for now.

    edit. Heres the link, its a great export tool!!
    https://mattgadient.com/2014/09/28/unity3d-a-free-script-to-convert-a-splatmap-to-a-png/

    I hope there's a more streamlined workflow coming soon!


     
    Last edited: Jul 22, 2015
  3. backwheelbates

    backwheelbates

    Joined:
    Jan 14, 2014
    Posts:
    231
    Just saw your link.

    Yes I saw this too. It's the whole reason I purchased terrain composer. Although I soon discovered, correct me if I'm wrong, terrain composer requires that you first convert to unity terrain or start with a unity terrain. So it's not at all what I was hoping for.
     
  4. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    Wich link, the one to protopop´s thread or to cte?
    I you just want to paint splatmaps there some tools that can export them like world machine or you can simply paint them yourself in gimp or if you have photoshop and such prg´s.

    Also in the asset store are these tools:

    SplatTerrain (has mobile shader)
    https://www.assetstore.unity3d.com/en/#!/content/17334

    Splat Painter
    https://www.assetstore.unity3d.com/en/#!/content/41837

    and some more, just search after splat.

    I am not sure what you wrote about TerrainComposer.
    You can also start with it an just a fresh terrain.
    Maybe you can try to explain what way you want or use to create terrains?
     
  5. backwheelbates

    backwheelbates

    Joined:
    Jan 14, 2014
    Posts:
    231
    @RandAlThor, hey nice find! I hadnt seen that Splat Painter before, thats exactly what I was looking for. Ive actually already purchased SplatTerrain. So this looks like a really good combo. Thanks!

    About my comments on Terrain Composer, Im modeling my own terrain in Maya. So Ive carefully placed each polygon and setup uvs how Id like them. So doing a geo > terrain > geo conversion means I will lose a lot of the optimization work I had put into it. If I was just starting with a standard terrain, then for sure, Terrain Composer would be the way to go. Hope that makes sense.
     
  6. AlanGreyjoy

    AlanGreyjoy

    Joined:
    Jul 25, 2014
    Posts:
    192
    So, after about a week of work, I have now a 2048x2048 terrain, fully decked out with trees, grass, rocks, everything. I am getting 200FPS in unity and 30FPS+ on my android GPAD (which is a GIANT P.O.S.)
     
  7. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    @AlanGreyjoy
    Do you have pictures to show or can we play it somewhere?
    How do have done the terrain in wich version of Unity?
    T4M or normal terrain and what numbers do you use?

    @Eric_Bates
    Then SplatTerrain is the one for you. You can use your uv´s from Maya and make nice cliff´s for example.
    I read something that Unity changed something and so some of his shaders are not working as good as they should but he is working on an update wich will take a while if i understand it correctly.
     
  8. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    733
    Hey guys...i found a workaround to make t4m usable on unity 5.

    - Import the T4m package and accept the automatic script updating.
    - Find "T4M 4 Textures.shader" (T4M/Shaders/ShaderModel2/Diffuse)
    - Edit shader above adding at the end of line 17 "nolightmap" ( #pragma surface surf Lambert nolightmap)...save.
    - Edit T4MSC.cs and replace line 309 with : " static public PaintHandle PaintPrev = PaintHandle.Follow_Normal_Circle;

    Now we can paint again (without brush preview) but we need to:
    - Fix all T4M shaders errors or use others customized
    - Write a new projector shader Unity 5 compatible (to be replaced in T4MSC.cs line 1400) for brush preview.

    Cheers
    Max
     
    Last edited: Jul 23, 2015
    backwheelbates likes this.
  9. backwheelbates

    backwheelbates

    Joined:
    Jan 14, 2014
    Posts:
    231
    @sjm tech, Great find Max, it would be awesome to get this running again.
     
  10. backwheelbates

    backwheelbates

    Joined:
    Jan 14, 2014
    Posts:
    231
    @sjm tech, Cool, I can confirm that worked. I also upped the splatmap res to 2048, it was previously 512. I also needed to change the brush size to a float rather than an int. This allows for smaller brushes when painting large 2048 maps! This setup works MUCH better than the Splat Painter plugin. Thanks again!
     
  11. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    733
    ;)

    I haven't tried other T4M features but is a start.
    To best edit the brush preview shader and remove the two console warnings you can :
    - create the two shaders locally (es PlantPreview and BrushPreview) instead by code (currently) : line 240 (T4MExtendsSC.cs) and line about 1400 (T4MSC.cs).

    es replace the line :

    Material NewPmat = new material ("shader....
    with

    Code (CSharp):
    1. Shader myShader = Shader.Find("Hidden/PlantPreview ");
    2. Material NewPMat  = new Material (myShader);
    in T4MExtendsSC.cs

    and with

    Code (CSharp):
    1. Shader myShader = Shader.Find("Hidden/BrushPreview");
    2. Material NewPMat  = new Material (myShader);
    in T4MSC.cs
     
  12. TechiTech

    TechiTech

    Joined:
    Dec 13, 2014
    Posts:
    212
    @azert2k seeing that these guys have figured it out for you, are you going to update your asset with these changes?
     
  13. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    733
    i have found here a blog with a good projection shader U5 compatible.
    currently supports only color and brush mask but i think that some shader guru could add another texture to fit the old shader.
     
  14. paopaooreo

    paopaooreo

    Joined:
    Jul 25, 2015
    Posts:
    1
    Why not compatible with unity5
     
  15. backwheelbates

    backwheelbates

    Joined:
    Jan 14, 2014
    Posts:
    231
    This fixes the error in the T4M World Projection Shader.shader

    After this line:

    Code (CSharp):
    1. void vert (inout appdata_full v, out Input o) {
    Insert this extra line:

    Code (CSharp):
    1.  UNITY_INITIALIZE_OUTPUT(Input,o);
    I get the yellow circle when painting, this is actually really useful and good enough for me.
     
  16. backwheelbates

    backwheelbates

    Joined:
    Jan 14, 2014
    Posts:
    231
    @sjm tech

    So, Ive setup a private github repo with a version of T4M that works with Unity 5. This includes the awesome updates that sjm_tech figured out. Ive also upped the splat map res to 2048 and allowed for smaller brush sizes that work better with higher res splat maps. Eventually it would be great to have some options for splat map res, but if you need to change it, just do a search and replace in the T4MSC.cs file and replace 2048 with whatever splat map resolution you would like. (512 was the original default). At least the splat map painting works, I havent tested all the other features though.

    If you'd like access to this repo please private message me with some kind of proof of purchase and your github ID so I can add you. (We are in a weird grey area with commercial tools, and abandoned Asset Store assets.)

    @azert2k, if you want to continue with development please let me know and I can transfer ownership of the repo back to you! Otherwise, we will continue to figure this out. Thanks!
     
  17. TechiTech

    TechiTech

    Joined:
    Dec 13, 2014
    Posts:
    212
    well done Eric ;)
     
  18. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    733
    Hoping in a Stéphane (Azert2k) return I did a modification of the brush preview shader (classic preview type) which works quite well. Only an issue ... i couldn't find a way maintain fixed the size of brush preview during the brush resizing (like the original one).

    Nice work Eric.

    Max
     

    Attached Files:

    Last edited: Jul 27, 2015
  19. backwheelbates

    backwheelbates

    Joined:
    Jan 14, 2014
    Posts:
    231
    Thanks @sjm tech, can't wait to try this one out!
     
  20. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    733
    general fix for Shader Model 3 shaders (and many other):
    - move "half3 col;variable declaration " from inside "void surf" to immediately above externally
    - add "nolightmap" at the end of #pragma surface line
     
  21. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    733
    To fix ShaderModel2 Unlit shaders:
    - replace "fixed4 unity_LightmapST;" with "half4 unity_LightmapST"
     
  22. uncle-TIN

    uncle-TIN

    Joined:
    Nov 3, 2012
    Posts:
    15
    how about fix Shader Model 4 shader in unity 5?
     
  23. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    733
    @uncle TIN what do you mean? there is no shaders model 4 in T4M package!
     
  24. yang200050

    yang200050

    Joined:
    Sep 18, 2014
    Posts:
    1
    @sjm tech
    hi~has the T4M already worked with Unity 5?
    if not,i'd like to join the group to solve the problem together.
    if yes,please tell me what should i do to let the T4M work with Unity 5.
    i'll be very appreciated!
     
  25. soldier11213048

    soldier11213048

    Joined:
    Mar 29, 2015
    Posts:
    11
    Hi,
    T4M is a fantastic tool!
    But could you make T4M compatible with unity 5 even publish a new product?
    Our project had updated to unity5 , it's very important for we.
     
  26. kulesz

    kulesz

    Joined:
    Jul 1, 2012
    Posts:
    138
    Did you blocked PM on the forum? I cannot contact you :)
     
  27. sfaok

    sfaok

    Joined:
    Nov 27, 2012
    Posts:
    23
    Yeah spotted the same thing - also hoping to request repo access.
     
  28. backwheelbates

    backwheelbates

    Joined:
    Jan 14, 2014
    Posts:
    231
    That's strange, not sure why I'm not getting messages through. Can you try again?
     
  29. SJAM

    SJAM

    Joined:
    Jan 11, 2009
    Posts:
    729
    Hi all, thank a lot for your interest for T4M, unfortunately I'm sick and I can't update my products. I have a serious problem to my back, and I can't stay sit too long.
    If someone want make a package and distribute some sources files to fix the problem, I'm fine and I thank him/her.
    I will try to see that with Max.
    I thank Max and Eric too ;)
     
  30. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    733
    Hi Stephane,
    no problem.
    Anything I can do, I'm available.
    All the best
    Max
     
  31. backwheelbates

    backwheelbates

    Joined:
    Jan 14, 2014
    Posts:
    231
    Hey Azert2k,

    Im sorry to hear about your Injury, I hope you can get better soon!

    All the best.
     
  32. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Azert2K has removed all his assets from Asset Store, which includes Mobile Starter Pack #1 : FPS and T4M Black Edition / Source Edition.
     
  33. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    ok I know there is no support but my projects still use this and I'm trying to get rid of the Unity 5 warnings. Anyone know how to get rid of this one?

    Assets/T4M/Editor/T4MSC.cs(3559,30): warning CS0618: `UnityEditor.ModelImporter.tangentImportMode' is obsolete: `tangentImportMode is deprecated. Use importTangents instead'

    These are the 3 offending lines:
    OBJI.splitTangentsAcrossSeams = true;
    OBJI.normalImportMode =ModelImporterTangentSpaceMode.Calculate;
    OBJI.tangentImportMode=ModelImporterTangentSpaceMode.Calculate;

    all depreciated but I'm not sure how to rewrite the lines to get rid of the warnings.
     
  34. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    733
    Replace your 3 lines with:
    Code (CSharp):
    1.     OBJI.importNormals = ModelImporterNormals.Calculate;
    2.     OBJI.importTangents = ModelImporterTangents.CalculateMikk;
    ;)
    Max
     
  35. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    thanks.
     
  36. latas

    latas

    Joined:
    Oct 9, 2013
    Posts:
    149
    Hi everyone. I purchased T4M some time ago. We're still developing in Unity 4.7 because Unity 5.X still has performance issues for Android. Due to the GPU Mali-400 chip, the terrains we've got using T4M MobileLM Shader shows that object completely black. And that black look to works as alpha because that object is overlapping the NGUI Interface. This doesn't happens on other GPU chipsets but it is documented even in the BugTrack of Unity. Due to this I'm not sure how to fix this issue without regenerate all the terrains and maybe not using those shaders. So any idea is very welcome. Thank you very much.
     
  37. zwcloud

    zwcloud

    Joined:
    Mar 15, 2016
    Posts:
    377
  38. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
  39. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Hey dude, you have many fixes, is it possible to release or send me non official Unity 5 compatible files?
    Not sure how to go about this, but stuck with old project that uses T4M and wish to upgrade Unity 5 but many "Pink Shader" issues?
     
  40. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    733
    Hi MrEsquire,
    it's been so long since I looked at t4m code.
    I remember that Eric_Bates set a private github repo...you can try to send a PM to him.
    Meanwhile i'll search a u5 project with working version.
    Best
    Max
     
    Last edited: Jun 16, 2016
  41. Aldrick

    Aldrick

    Joined:
    Feb 19, 2014
    Posts:
    64
    I tried to write a T4M shader that supports more than 4 texture(i.e.,8 textures),it always get "too many interpolators" error message. It is like 3 textures + 1 control mask image = 4 textures is the limit of a surface shader,is that true?The target 4.0 seems to has more allowed interpolators but is very unstable even between different windows PC,not to mention mobile platform.So I would not dare to use target 4.0.
    So is it impossible to get T4M to work with terrain that has 8 textures on it?
     
  42. navirius

    navirius

    Joined:
    Feb 2, 2018
    Posts:
    3
    anyone can give hint how to upgrade this T4M to unity 2017?
     
  43. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    Hello, how does MTE compare respect of T4M? Is it worth it?